Add real calling package name to log.

To identyify the sender app that needs to be fixed we need the real
calling package, not the calling package.

Test: atest BackgroundActivityLaunchTest
Change-Id: I7c970d8d43e5e980e95f290cf2bdf1bab4020472
Bug: 236231785
This commit is contained in:
Achim Thesmann
2023-04-21 08:48:18 -07:00
parent 91769359c2
commit cde9e89113

View File

@@ -452,6 +452,9 @@ public class BackgroundActivityStartController {
// If we are here, it means all exemptions not based on PI sender failed, so we'll block
// unless resultIfPiSenderAllowsBal is an allow and the PI sender allows BAL
String realCallingPackage = callingUid == realCallingUid ? callingPackage :
mService.mContext.getPackageManager().getNameForUid(realCallingUid);
String stateDumpLog = " [callingPackage: " + callingPackage
+ "; callingUid: " + callingUid
+ "; appSwitchState: " + appSwitchState
@@ -460,6 +463,7 @@ public class BackgroundActivityStartController {
ActivityManager.class, "PROCESS_STATE_", callingUidProcState)
+ "; isCallingUidPersistentSystemProcess: " + isCallingUidPersistentSystemProcess
+ "; balAllowedByPiSender: " + balAllowedByPiSender
+ "; realCallingPackage: " + realCallingPackage
+ "; realCallingUid: " + realCallingUid
+ "; realCallingUidHasAnyVisibleWindow: " + realCallingUidHasAnyVisibleWindow
+ "; realCallingUidProcState: " + DebugUtils.valueToString(