Enhance media temp-allowlist logging

Bug: 235513310
Test: Press media session controll button after running...
  adb shell am compat enable MEDIA_CONTROL_SESSION_ACTIONS com.spotify.music
Change-Id: Ief468fbdb5f462217ac6f0e35ab35c590a51277b
This commit is contained in:
Makoto Onuki
2022-06-09 14:17:26 -07:00
parent d2a02887ae
commit 6c70ed1306

View File

@@ -563,14 +563,16 @@ public class MediaSessionService extends SystemService implements Monitor {
try {
enforcePackageName(callingPackage, callingUid);
if (targetUid != callingUid) {
Log.d(TAG, "tempAllowlistTargetPkgIfPossible callingPackage:"
+ callingPackage + " targetPackage:" + targetPackage
+ " reason:" + reason);
boolean canAllowWhileInUse = mActivityManagerLocal
.canAllowWhileInUsePermissionInFgs(callingPid, callingUid, callingPackage);
boolean canStartFgs = canAllowWhileInUse
|| mActivityManagerLocal.canStartForegroundService(callingPid, callingUid,
callingPackage);
Log.i(TAG, "tempAllowlistTargetPkgIfPossible callingPackage:"
+ callingPackage + " targetPackage:" + targetPackage
+ " reason:" + reason
+ (canAllowWhileInUse ? " [WIU]" : "")
+ (canStartFgs ? " [FGS]" : ""));
if (canAllowWhileInUse) {
mActivityManagerLocal.tempAllowWhileInUsePermissionInFgs(targetUid,
MediaSessionDeviceConfig