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

Commit 3822f80d authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Removing TaskFragment token from LaunchActivityItem" into sc-v2-dev am: 5df8cac5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15937027

Change-Id: I956d0cf59bdd8dcb8a96cd7c6f023ed724575d6b
parents c9894b7d 5df8cac5
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -526,9 +526,6 @@ public final class ActivityThread extends ClientTransactionHandler
        // A reusable token for other purposes, e.g. content capture, translation. It shouldn't be
        // A reusable token for other purposes, e.g. content capture, translation. It shouldn't be
        // used without security checks
        // used without security checks
        public IBinder shareableActivityToken;
        public IBinder shareableActivityToken;
        // The token of the initial TaskFragment that embedded this activity. Do not rely on it
        // after creation because the activity could be reparented.
        @Nullable public IBinder mInitialTaskFragmentToken;
        int ident;
        int ident;
        @UnsupportedAppUsage
        @UnsupportedAppUsage
        Intent intent;
        Intent intent;
@@ -622,8 +619,7 @@ public final class ActivityThread extends ClientTransactionHandler
                List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions,
                List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions,
                boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client,
                boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client,
                IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments,
                IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments,
                IBinder shareableActivityToken, boolean launchedFromBubble,
                IBinder shareableActivityToken, boolean launchedFromBubble) {
                IBinder initialTaskFragmentToken) {
            this.token = token;
            this.token = token;
            this.assistToken = assistToken;
            this.assistToken = assistToken;
            this.shareableActivityToken = shareableActivityToken;
            this.shareableActivityToken = shareableActivityToken;
@@ -645,7 +641,6 @@ public final class ActivityThread extends ClientTransactionHandler
            mActivityOptions = activityOptions;
            mActivityOptions = activityOptions;
            mPendingFixedRotationAdjustments = fixedRotationAdjustments;
            mPendingFixedRotationAdjustments = fixedRotationAdjustments;
            mLaunchedFromBubble = launchedFromBubble;
            mLaunchedFromBubble = launchedFromBubble;
            mInitialTaskFragmentToken = initialTaskFragmentToken;
            init();
            init();
        }
        }


+7 −13
Original line number Original line Diff line number Diff line
@@ -73,7 +73,6 @@ public class LaunchActivityItem extends ClientTransactionItem {
    private IBinder mAssistToken;
    private IBinder mAssistToken;
    private IBinder mShareableActivityToken;
    private IBinder mShareableActivityToken;
    private boolean mLaunchedFromBubble;
    private boolean mLaunchedFromBubble;
    private IBinder mTaskFragmentToken;
    /**
    /**
     * It is only non-null if the process is the first time to launch activity. It is only an
     * It is only non-null if the process is the first time to launch activity. It is only an
     * optimization for quick look up of the interface so the field is ignored for comparison.
     * optimization for quick look up of the interface so the field is ignored for comparison.
@@ -87,7 +86,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
                mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mState, mPersistentState,
                mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mState, mPersistentState,
                mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo,
                mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo,
                client, mAssistToken, mFixedRotationAdjustments, mShareableActivityToken,
                client, mAssistToken, mFixedRotationAdjustments, mShareableActivityToken,
                mLaunchedFromBubble, mTaskFragmentToken);
                mLaunchedFromBubble);
        client.addLaunchingActivity(token, r);
        client.addLaunchingActivity(token, r);
        client.updateProcessState(mProcState, false);
        client.updateProcessState(mProcState, false);
        client.updatePendingConfiguration(mCurConfig);
        client.updatePendingConfiguration(mCurConfig);
@@ -125,7 +124,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
            boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken,
            boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken,
            IActivityClientController activityClientController,
            IActivityClientController activityClientController,
            FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken,
            FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken,
            boolean launchedFromBubble, IBinder taskFragmentToken) {
            boolean launchedFromBubble) {
        LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class);
        LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class);
        if (instance == null) {
        if (instance == null) {
            instance = new LaunchActivityItem();
            instance = new LaunchActivityItem();
@@ -134,7 +133,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
                voiceInteractor, procState, state, persistentState, pendingResults,
                voiceInteractor, procState, state, persistentState, pendingResults,
                pendingNewIntents, activityOptions, isForward, profilerInfo, assistToken,
                pendingNewIntents, activityOptions, isForward, profilerInfo, assistToken,
                activityClientController, fixedRotationAdjustments, shareableActivityToken,
                activityClientController, fixedRotationAdjustments, shareableActivityToken,
                launchedFromBubble, taskFragmentToken);
                launchedFromBubble);


        return instance;
        return instance;
    }
    }
@@ -142,7 +141,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
    @Override
    @Override
    public void recycle() {
    public void recycle() {
        setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null,
        setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null,
                null, false, null, null, null, null, null, false, null);
                null, false, null, null, null, null, null, false);
        ObjectPool.recycle(this);
        ObjectPool.recycle(this);
    }
    }


@@ -173,7 +172,6 @@ public class LaunchActivityItem extends ClientTransactionItem {
        dest.writeTypedObject(mFixedRotationAdjustments, flags);
        dest.writeTypedObject(mFixedRotationAdjustments, flags);
        dest.writeStrongBinder(mShareableActivityToken);
        dest.writeStrongBinder(mShareableActivityToken);
        dest.writeBoolean(mLaunchedFromBubble);
        dest.writeBoolean(mLaunchedFromBubble);
        dest.writeStrongBinder(mTaskFragmentToken);
    }
    }


    /** Read from Parcel. */
    /** Read from Parcel. */
@@ -192,8 +190,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
                in.readStrongBinder(),
                in.readStrongBinder(),
                IActivityClientController.Stub.asInterface(in.readStrongBinder()),
                IActivityClientController.Stub.asInterface(in.readStrongBinder()),
                in.readTypedObject(FixedRotationAdjustments.CREATOR), in.readStrongBinder(),
                in.readTypedObject(FixedRotationAdjustments.CREATOR), in.readStrongBinder(),
                in.readBoolean(),
                in.readBoolean());
                in.readStrongBinder());
    }
    }


    public static final @NonNull Creator<LaunchActivityItem> CREATOR =
    public static final @NonNull Creator<LaunchActivityItem> CREATOR =
@@ -232,8 +229,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
                && Objects.equals(mProfilerInfo, other.mProfilerInfo)
                && Objects.equals(mProfilerInfo, other.mProfilerInfo)
                && Objects.equals(mAssistToken, other.mAssistToken)
                && Objects.equals(mAssistToken, other.mAssistToken)
                && Objects.equals(mFixedRotationAdjustments, other.mFixedRotationAdjustments)
                && Objects.equals(mFixedRotationAdjustments, other.mFixedRotationAdjustments)
                && Objects.equals(mShareableActivityToken, other.mShareableActivityToken)
                && Objects.equals(mShareableActivityToken, other.mShareableActivityToken);
                && Objects.equals(mTaskFragmentToken, other.mTaskFragmentToken);
    }
    }


    @Override
    @Override
@@ -256,7 +252,6 @@ public class LaunchActivityItem extends ClientTransactionItem {
        result = 31 * result + Objects.hashCode(mAssistToken);
        result = 31 * result + Objects.hashCode(mAssistToken);
        result = 31 * result + Objects.hashCode(mFixedRotationAdjustments);
        result = 31 * result + Objects.hashCode(mFixedRotationAdjustments);
        result = 31 * result + Objects.hashCode(mShareableActivityToken);
        result = 31 * result + Objects.hashCode(mShareableActivityToken);
        result = 31 * result + Objects.hashCode(mTaskFragmentToken);
        return result;
        return result;
    }
    }


@@ -306,7 +301,7 @@ public class LaunchActivityItem extends ClientTransactionItem {
            ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo,
            ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo,
            IBinder assistToken, IActivityClientController activityClientController,
            IBinder assistToken, IActivityClientController activityClientController,
            FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken,
            FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken,
            boolean launchedFromBubble, IBinder taskFragmentToken) {
            boolean launchedFromBubble) {
        instance.mIntent = intent;
        instance.mIntent = intent;
        instance.mIdent = ident;
        instance.mIdent = ident;
        instance.mInfo = info;
        instance.mInfo = info;
@@ -328,6 +323,5 @@ public class LaunchActivityItem extends ClientTransactionItem {
        instance.mFixedRotationAdjustments = fixedRotationAdjustments;
        instance.mFixedRotationAdjustments = fixedRotationAdjustments;
        instance.mShareableActivityToken = shareableActivityToken;
        instance.mShareableActivityToken = shareableActivityToken;
        instance.mLaunchedFromBubble = launchedFromBubble;
        instance.mLaunchedFromBubble = launchedFromBubble;
        instance.mTaskFragmentToken = taskFragmentToken;
    }
    }
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -157,7 +157,7 @@ public class ObjectPoolTests {
                .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList())
                .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList())
                .setIsForward(true).setAssistToken(assistToken)
                .setIsForward(true).setAssistToken(assistToken)
                .setShareableActivityToken(shareableActivityToken)
                .setShareableActivityToken(shareableActivityToken)
                .setTaskFragmentToken(new Binder()).build();
                .build();


        LaunchActivityItem emptyItem = new LaunchActivityItemBuilder().build();
        LaunchActivityItem emptyItem = new LaunchActivityItemBuilder().build();
        LaunchActivityItem item = itemSupplier.get();
        LaunchActivityItem item = itemSupplier.get();
+1 −7
Original line number Original line Diff line number Diff line
@@ -112,7 +112,6 @@ class TestUtils {
        private IBinder mShareableActivityToken;
        private IBinder mShareableActivityToken;
        private FixedRotationAdjustments mFixedRotationAdjustments;
        private FixedRotationAdjustments mFixedRotationAdjustments;
        private boolean mLaunchedFromBubble;
        private boolean mLaunchedFromBubble;
        private IBinder mTaskFragmentToken;


        LaunchActivityItemBuilder setIntent(Intent intent) {
        LaunchActivityItemBuilder setIntent(Intent intent) {
            mIntent = intent;
            mIntent = intent;
@@ -214,18 +213,13 @@ class TestUtils {
            return this;
            return this;
        }
        }


        LaunchActivityItemBuilder setTaskFragmentToken(IBinder taskFragmentToken) {
            mTaskFragmentToken = taskFragmentToken;
            return this;
        }

        LaunchActivityItem build() {
        LaunchActivityItem build() {
            return LaunchActivityItem.obtain(mIntent, mIdent, mInfo,
            return LaunchActivityItem.obtain(mIntent, mIdent, mInfo,
                    mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor,
                    mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor,
                    mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents,
                    mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents,
                    mActivityOptions, mIsForward, mProfilerInfo, mAssistToken,
                    mActivityOptions, mIsForward, mProfilerInfo, mAssistToken,
                    null /* activityClientController */, mFixedRotationAdjustments,
                    null /* activityClientController */, mFixedRotationAdjustments,
                    mShareableActivityToken, mLaunchedFromBubble, mTaskFragmentToken);
                    mShareableActivityToken, mLaunchedFromBubble);
        }
        }
    }
    }
}
}
+0 −1
Original line number Original line Diff line number Diff line
@@ -209,7 +209,6 @@ public class TransactionParcelTests {
                .setPendingNewIntents(referrerIntentList()).setIsForward(true)
                .setPendingNewIntents(referrerIntentList()).setIsForward(true)
                .setAssistToken(new Binder()).setFixedRotationAdjustments(fixedRotationAdjustments)
                .setAssistToken(new Binder()).setFixedRotationAdjustments(fixedRotationAdjustments)
                .setShareableActivityToken(new Binder())
                .setShareableActivityToken(new Binder())
                .setTaskFragmentToken(new Binder())
                .build();
                .build();


        writeAndPrepareForReading(item);
        writeAndPrepareForReading(item);
Loading