Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ced332a authored by Nan Wu's avatar Nan Wu
Browse files

Log to detect usage of whitelistToken when sending non-PI target

Log ActivityManagerService.sendIntentSender if the target is not a
PendingIntent and a non-null whitelistToken is sent to the client.
This is simply to detect if there are real cases this would happen
before we decide simply remove whitelistToken in that case.

Bug: 279428283
Test: Manual test.
Change-Id: I93062f4973696b9a6fa24aed0dc5aa447a4c1a52
parent a815608a
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -5407,6 +5407,19 @@ public class ActivityManagerService extends IActivityManager.Stub
                intent = new Intent(Intent.ACTION_MAIN);
            }
            try {
                if (allowlistToken != null) {
                    final int callingUid = Binder.getCallingUid();
                    final String packageName;
                    final long token = Binder.clearCallingIdentity();
                    try {
                        packageName = AppGlobals.getPackageManager().getNameForUid(callingUid);
                    } finally {
                        Binder.restoreCallingIdentity(token);
                    }
                    Slog.wtf(TAG, "Send a non-null allowlistToken to a non-PI target."
                            + " Calling package: " + packageName + "; intent: " + intent
                            + "; options: " + options);
                }
                target.send(code, intent, resolvedType, allowlistToken, null,
                        requiredPermission, options);
            } catch (RemoteException e) {