Loading core/java/android/content/Intent.java +9 −1 Original line number Diff line number Diff line Loading @@ -11672,6 +11672,7 @@ public class Intent implements Parcelable, Cloneable { Log.w(TAG, "Failure filling in extras", e); } } mCreatorTokenInfo = other.mCreatorTokenInfo; if (mayHaveCopiedUris && mContentUserHint == UserHandle.USER_CURRENT && other.mContentUserHint != UserHandle.USER_CURRENT) { mContentUserHint = other.mContentUserHint; Loading Loading @@ -12224,6 +12225,13 @@ public class Intent implements Parcelable, Cloneable { mCreatorTokenInfo = null; } /** @hide */ public void removeCreatorToken() { if (mCreatorTokenInfo != null) { mCreatorTokenInfo.mCreatorToken = null; } } /** @hide */ public @Nullable IBinder getCreatorToken() { return mCreatorTokenInfo == null ? null : mCreatorTokenInfo.mCreatorToken; Loading Loading @@ -12251,7 +12259,7 @@ public class Intent implements Parcelable, Cloneable { public void collectExtraIntentKeys() { if (!isPreventIntentRedirectEnabled()) return; if (mExtras != null && !mExtras.isParcelled() && !mExtras.isEmpty()) { if (mExtras != null && !mExtras.isEmpty()) { for (String key : mExtras.keySet()) { if (mExtras.get(key) instanceof Intent) { if (mCreatorTokenInfo == null) { Loading services/core/java/com/android/server/am/ActivityManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5555,6 +5555,8 @@ public class ActivityManagerService extends IActivityManager.Stub if (target instanceof PendingIntentRecord) { final PendingIntentRecord originalRecord = (PendingIntentRecord) target; addCreatorToken(intent, originalRecord.getPackageName()); // In multi-display scenarios, there can be background users who execute the // PendingIntent. In these scenarios, we don't want to use the foreground user as the // current user. Loading services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,8 +1275,8 @@ class ActivityStarter { "Creator PermissionPolicyService.checkStartActivity Caused abortion.", intent, intentCreatorUid, intentCreatorPackage, callingUid, callingPackage); } intent.removeCreatorTokenInfo(); } intent.removeCreatorToken(); // Merge the two options bundles, while realCallerOptions takes precedence. ActivityOptions checkedOptions = options != null Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions) { mAmInternal.addCreatorToken(intent, callingPackage); return startActivityAsUser(caller, callingPackage, callingFeatureId, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions, UserHandle.getCallingUserId()); Loading Loading
core/java/android/content/Intent.java +9 −1 Original line number Diff line number Diff line Loading @@ -11672,6 +11672,7 @@ public class Intent implements Parcelable, Cloneable { Log.w(TAG, "Failure filling in extras", e); } } mCreatorTokenInfo = other.mCreatorTokenInfo; if (mayHaveCopiedUris && mContentUserHint == UserHandle.USER_CURRENT && other.mContentUserHint != UserHandle.USER_CURRENT) { mContentUserHint = other.mContentUserHint; Loading Loading @@ -12224,6 +12225,13 @@ public class Intent implements Parcelable, Cloneable { mCreatorTokenInfo = null; } /** @hide */ public void removeCreatorToken() { if (mCreatorTokenInfo != null) { mCreatorTokenInfo.mCreatorToken = null; } } /** @hide */ public @Nullable IBinder getCreatorToken() { return mCreatorTokenInfo == null ? null : mCreatorTokenInfo.mCreatorToken; Loading Loading @@ -12251,7 +12259,7 @@ public class Intent implements Parcelable, Cloneable { public void collectExtraIntentKeys() { if (!isPreventIntentRedirectEnabled()) return; if (mExtras != null && !mExtras.isParcelled() && !mExtras.isEmpty()) { if (mExtras != null && !mExtras.isEmpty()) { for (String key : mExtras.keySet()) { if (mExtras.get(key) instanceof Intent) { if (mCreatorTokenInfo == null) { Loading
services/core/java/com/android/server/am/ActivityManagerService.java +2 −0 Original line number Diff line number Diff line Loading @@ -5555,6 +5555,8 @@ public class ActivityManagerService extends IActivityManager.Stub if (target instanceof PendingIntentRecord) { final PendingIntentRecord originalRecord = (PendingIntentRecord) target; addCreatorToken(intent, originalRecord.getPackageName()); // In multi-display scenarios, there can be background users who execute the // PendingIntent. In these scenarios, we don't want to use the foreground user as the // current user. Loading
services/core/java/com/android/server/wm/ActivityStarter.java +1 −1 Original line number Diff line number Diff line Loading @@ -1275,8 +1275,8 @@ class ActivityStarter { "Creator PermissionPolicyService.checkStartActivity Caused abortion.", intent, intentCreatorUid, intentCreatorPackage, callingUid, callingPackage); } intent.removeCreatorTokenInfo(); } intent.removeCreatorToken(); // Merge the two options bundles, while realCallerOptions takes precedence. ActivityOptions checkedOptions = options != null Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +0 −1 Original line number Diff line number Diff line Loading @@ -1228,7 +1228,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { String callingFeatureId, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions) { mAmInternal.addCreatorToken(intent, callingPackage); return startActivityAsUser(caller, callingPackage, callingFeatureId, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions, UserHandle.getCallingUserId()); Loading