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

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

Merge "Fix missing creator token issue due to same intent added twice as extra intent" into main

parents 23d910b5 20b22979
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -12291,7 +12291,6 @@ public class Intent implements Parcelable, Cloneable {
        private IBinder mCreatorToken;
        // Stores all extra keys whose values are intents for a top level intent.
        private ArraySet<NestedIntentKey> mNestedIntentKeys;
    }
    /**
@@ -12353,6 +12352,7 @@ public class Intent implements Parcelable, Cloneable {
        public int hashCode() {
            return Objects.hash(mType, mKey, mIndex);
        }
    }
    private @Nullable CreatorTokenInfo mCreatorTokenInfo;
@@ -12416,7 +12416,7 @@ public class Intent implements Parcelable, Cloneable {
                    // removeLaunchSecurityProtection() is called before it is launched.
                    value = null;
                }
                if (value instanceof Intent intent && !visited.contains(intent)) {
                if (value instanceof Intent intent) {
                    handleNestedIntent(intent, visited, new NestedIntentKey(
                            NestedIntentKey.NESTED_INTENT_KEY_TYPE_EXTRA_PARCEL, key, 0));
                } else if (value instanceof Parcelable[] parcelables) {
@@ -12439,7 +12439,6 @@ public class Intent implements Parcelable, Cloneable {
    }
    private void handleNestedIntent(Intent intent, Set<Intent> visited, NestedIntentKey key) {
        visited.add(intent);
        if (mCreatorTokenInfo == null) {
            mCreatorTokenInfo = new CreatorTokenInfo();
        }
@@ -12447,8 +12446,11 @@ public class Intent implements Parcelable, Cloneable {
            mCreatorTokenInfo.mNestedIntentKeys = new ArraySet<>();
        }
        mCreatorTokenInfo.mNestedIntentKeys.add(key);
        if (!visited.contains(intent)) {
            visited.add(intent);
            intent.collectNestedIntentKeysRecur(visited);
        }
    }
    private void handleParcelableArray(Parcelable[] parcelables, String key, Set<Intent> visited) {
        for (int i = 0; i < parcelables.length; i++) {