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

Commit fd8368f5 authored by Nan Wu's avatar Nan Wu Committed by Android (Google) Code Review
Browse files

Merge "Generate CreatorToken" into main

parents 480405c5 4923b58a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1323,4 +1323,12 @@ public abstract class ActivityManagerInternal {
     */
    public abstract void killApplicationSync(String pkgName, int appId, int userId,
            String reason, int exitInfoReason);

    /**
     * Add a creator token for all embedded intents (stored as extra) of the given intent.
     *
     * @param intent The given intent
     * @hide
     */
    public abstract void addCreatorToken(Intent intent);
}
+3 −0
Original line number Diff line number Diff line
@@ -1094,6 +1094,9 @@ public final class PendingIntent implements Parcelable {
            @Nullable String requiredPermission, @Nullable Bundle options)
            throws CanceledException {
        try {
            if (intent != null) {
                intent.collectExtraIntentKeys();
            }
            String resolvedType = intent != null ?
                    intent.resolveTypeIfNeeded(context.getContentResolver())
                    : null;
+1 −1
Original line number Diff line number Diff line
@@ -1149,7 +1149,7 @@ public class ClipData implements Parcelable {
        for (int i = 0; i < size; i++) {
            final Item item = mItems.get(i);
            if (item.mIntent != null) {
                item.mIntent.prepareToLeaveProcess(leavingPackage);
                item.mIntent.prepareToLeaveProcess(leavingPackage, false);
            }
            if (item.mUri != null && leavingPackage) {
                if (StrictMode.vmFileUriExposureEnabled()) {
+16 −3
Original line number Diff line number Diff line
@@ -12221,6 +12221,8 @@ public class Intent implements Parcelable, Cloneable {
    /**
     * Collects keys in the extra bundle whose value are intents.
     * With these keys collected on the client side, the system server would only unparcel values
     * of these keys and create IntentCreatorToken for them.
     * @hide
     */
    public void collectExtraIntentKeys() {
@@ -12583,22 +12585,29 @@ public class Intent implements Parcelable, Cloneable {
     */
    @android.ravenwood.annotation.RavenwoodThrow
    public void prepareToLeaveProcess(boolean leavingPackage) {
        prepareToLeaveProcess(leavingPackage, true);
    }
    /**
     * @hide
     */
    void prepareToLeaveProcess(boolean leavingPackage, boolean isTopLevel) {
        setAllowFds(false);
        if (mSelector != null) {
            mSelector.prepareToLeaveProcess(leavingPackage);
            mSelector.prepareToLeaveProcess(leavingPackage, false);
        }
        if (mClipData != null) {
            mClipData.prepareToLeaveProcess(leavingPackage, getFlags());
        }
        if (mOriginalIntent != null) {
            mOriginalIntent.prepareToLeaveProcess(leavingPackage);
            mOriginalIntent.prepareToLeaveProcess(leavingPackage, false);
        }
        if (mExtras != null && !mExtras.isParcelled()) {
            final Object intent = mExtras.get(Intent.EXTRA_INTENT);
            if (intent instanceof Intent) {
                ((Intent) intent).prepareToLeaveProcess(leavingPackage);
                ((Intent) intent).prepareToLeaveProcess(leavingPackage, false);
            }
        }
@@ -12672,6 +12681,10 @@ public class Intent implements Parcelable, Cloneable {
                StrictMode.onUnsafeIntentLaunch(this);
            }
        }
        if (isTopLevel) {
            collectExtraIntentKeys();
        }
    }
    /**
+3 −0
Original line number Diff line number Diff line
@@ -288,6 +288,9 @@ public class IntentSender implements Parcelable {
            @Nullable Executor executor, @Nullable OnFinished onFinished)
            throws SendIntentException {
        try {
            if (intent != null) {
                intent.collectExtraIntentKeys();
            }
            String resolvedType = intent != null ?
                    intent.resolveTypeIfNeeded(context.getContentResolver())
                    : null;
Loading