Skip to content
Snippets Groups Projects
Commit df5f431e authored by Nan Wu's avatar Nan Wu Committed by Android Build Coastguard Worker
Browse files

RESTRICT AUTOMERGE

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.

Do not pass  whitelistToken when sending non-PI target

In ActivityManagerService.sendIntentSender, if the target is not a
PendingIntent, do not send whitelistToken to the client.

Bug: 279428283
Test: Manual test
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6a58836fbdee74e6ba1192814dde0b4597414aa0)
Merged-In: I017486354a1ab2f14d0472c355583d53c27c4810
Change-Id: I017486354a1ab2f14d0472c355583d53c27c4810
parent a3bde4ea
No related branches found
No related tags found
No related merge requests found
......@@ -5430,7 +5430,20 @@ public class ActivityManagerService extends IActivityManager.Stub
intent = new Intent(Intent.ACTION_MAIN);
}
try {
target.send(code, intent, resolvedType, allowlistToken, null,
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, null, null,
requiredPermission, options);
} catch (RemoteException e) {
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment