Loading core/java/android/app/ActivityThread.java +5 −1 Original line number Diff line number Diff line Loading @@ -530,6 +530,8 @@ public final class ActivityThread extends ClientTransactionHandler // A reusable token for other purposes, e.g. content capture, translation. It shouldn't be // used without security checks public IBinder shareableActivityToken; // The token of the TaskFragment that embedded this activity. @Nullable public IBinder mTaskFragmentToken; int ident; @UnsupportedAppUsage Intent intent; Loading Loading @@ -623,7 +625,8 @@ public final class ActivityThread extends ClientTransactionHandler List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client, IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { IBinder shareableActivityToken, boolean launchedFromBubble, IBinder taskFragmentToken) { this.token = token; this.assistToken = assistToken; this.shareableActivityToken = shareableActivityToken; Loading @@ -645,6 +648,7 @@ public final class ActivityThread extends ClientTransactionHandler mActivityOptions = activityOptions; mPendingFixedRotationAdjustments = fixedRotationAdjustments; mLaunchedFromBubble = launchedFromBubble; mTaskFragmentToken = taskFragmentToken; init(); } Loading core/java/android/app/servertransaction/LaunchActivityItem.java +13 −7 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public class LaunchActivityItem extends ClientTransactionItem { private IBinder mAssistToken; private IBinder mShareableActivityToken; 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 * optimization for quick look up of the interface so the field is ignored for comparison. Loading @@ -86,7 +87,7 @@ public class LaunchActivityItem extends ClientTransactionItem { mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mState, mPersistentState, mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo, client, mAssistToken, mFixedRotationAdjustments, mShareableActivityToken, mLaunchedFromBubble); mLaunchedFromBubble, mTaskFragmentToken); client.addLaunchingActivity(token, r); client.updateProcessState(mProcState, false); client.updatePendingConfiguration(mCurConfig); Loading Loading @@ -124,7 +125,7 @@ public class LaunchActivityItem extends ClientTransactionItem { boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken, IActivityClientController activityClientController, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { boolean launchedFromBubble, IBinder taskFragmentToken) { LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class); if (instance == null) { instance = new LaunchActivityItem(); Loading @@ -133,7 +134,7 @@ public class LaunchActivityItem extends ClientTransactionItem { voiceInteractor, procState, state, persistentState, pendingResults, pendingNewIntents, activityOptions, isForward, profilerInfo, assistToken, activityClientController, fixedRotationAdjustments, shareableActivityToken, launchedFromBubble); launchedFromBubble, taskFragmentToken); return instance; } Loading @@ -141,7 +142,7 @@ public class LaunchActivityItem extends ClientTransactionItem { @Override public void recycle() { setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null, null, false, null, null, null, null, null, false); null, false, null, null, null, null, null, false, null); ObjectPool.recycle(this); } Loading Loading @@ -172,6 +173,7 @@ public class LaunchActivityItem extends ClientTransactionItem { dest.writeTypedObject(mFixedRotationAdjustments, flags); dest.writeStrongBinder(mShareableActivityToken); dest.writeBoolean(mLaunchedFromBubble); dest.writeStrongBinder(mTaskFragmentToken); } /** Read from Parcel. */ Loading @@ -190,7 +192,8 @@ public class LaunchActivityItem extends ClientTransactionItem { in.readStrongBinder(), IActivityClientController.Stub.asInterface(in.readStrongBinder()), in.readTypedObject(FixedRotationAdjustments.CREATOR), in.readStrongBinder(), in.readBoolean()); in.readBoolean(), in.readStrongBinder()); } public static final @NonNull Creator<LaunchActivityItem> CREATOR = Loading Loading @@ -229,7 +232,8 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mProfilerInfo, other.mProfilerInfo) && Objects.equals(mAssistToken, other.mAssistToken) && Objects.equals(mFixedRotationAdjustments, other.mFixedRotationAdjustments) && Objects.equals(mShareableActivityToken, other.mShareableActivityToken); && Objects.equals(mShareableActivityToken, other.mShareableActivityToken) && Objects.equals(mTaskFragmentToken, other.mTaskFragmentToken); } @Override Loading @@ -252,6 +256,7 @@ public class LaunchActivityItem extends ClientTransactionItem { result = 31 * result + Objects.hashCode(mAssistToken); result = 31 * result + Objects.hashCode(mFixedRotationAdjustments); result = 31 * result + Objects.hashCode(mShareableActivityToken); result = 31 * result + Objects.hashCode(mTaskFragmentToken); return result; } Loading Loading @@ -301,7 +306,7 @@ public class LaunchActivityItem extends ClientTransactionItem { ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken, IActivityClientController activityClientController, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { boolean launchedFromBubble, IBinder taskFragmentToken) { instance.mIntent = intent; instance.mIdent = ident; instance.mInfo = info; Loading @@ -323,5 +328,6 @@ public class LaunchActivityItem extends ClientTransactionItem { instance.mFixedRotationAdjustments = fixedRotationAdjustments; instance.mShareableActivityToken = shareableActivityToken; instance.mLaunchedFromBubble = launchedFromBubble; instance.mTaskFragmentToken = taskFragmentToken; } } core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,8 @@ public class ObjectPoolTests { .setProcState(procState).setState(bundle).setPersistentState(persistableBundle) .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList()) .setIsForward(true).setAssistToken(assistToken) .setShareableActivityToken(shareableActivityToken).build(); .setShareableActivityToken(shareableActivityToken) .setTaskFragmentToken(new Binder()).build(); LaunchActivityItem emptyItem = new LaunchActivityItemBuilder().build(); LaunchActivityItem item = itemSupplier.get(); Loading core/tests/coretests/src/android/app/servertransaction/TestUtils.java +7 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ class TestUtils { private IBinder mShareableActivityToken; private FixedRotationAdjustments mFixedRotationAdjustments; private boolean mLaunchedFromBubble; private IBinder mTaskFragmentToken; LaunchActivityItemBuilder setIntent(Intent intent) { mIntent = intent; Loading Loading @@ -213,13 +214,18 @@ class TestUtils { return this; } LaunchActivityItemBuilder setTaskFragmentToken(IBinder taskFragmentToken) { mTaskFragmentToken = taskFragmentToken; return this; } LaunchActivityItem build() { return LaunchActivityItem.obtain(mIntent, mIdent, mInfo, mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo, mAssistToken, null /* activityClientController */, mFixedRotationAdjustments, mShareableActivityToken, mLaunchedFromBubble); mShareableActivityToken, mLaunchedFromBubble, mTaskFragmentToken); } } } core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ public class TransactionParcelTests { .setPendingNewIntents(referrerIntentList()).setIsForward(true) .setAssistToken(new Binder()).setFixedRotationAdjustments(fixedRotationAdjustments) .setShareableActivityToken(new Binder()) .setTaskFragmentToken(new Binder()) .build(); writeAndPrepareForReading(item); Loading Loading
core/java/android/app/ActivityThread.java +5 −1 Original line number Diff line number Diff line Loading @@ -530,6 +530,8 @@ public final class ActivityThread extends ClientTransactionHandler // A reusable token for other purposes, e.g. content capture, translation. It shouldn't be // used without security checks public IBinder shareableActivityToken; // The token of the TaskFragment that embedded this activity. @Nullable public IBinder mTaskFragmentToken; int ident; @UnsupportedAppUsage Intent intent; Loading Loading @@ -623,7 +625,8 @@ public final class ActivityThread extends ClientTransactionHandler List<ReferrerIntent> pendingNewIntents, ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client, IBinder assistToken, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { IBinder shareableActivityToken, boolean launchedFromBubble, IBinder taskFragmentToken) { this.token = token; this.assistToken = assistToken; this.shareableActivityToken = shareableActivityToken; Loading @@ -645,6 +648,7 @@ public final class ActivityThread extends ClientTransactionHandler mActivityOptions = activityOptions; mPendingFixedRotationAdjustments = fixedRotationAdjustments; mLaunchedFromBubble = launchedFromBubble; mTaskFragmentToken = taskFragmentToken; init(); } Loading
core/java/android/app/servertransaction/LaunchActivityItem.java +13 −7 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public class LaunchActivityItem extends ClientTransactionItem { private IBinder mAssistToken; private IBinder mShareableActivityToken; 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 * optimization for quick look up of the interface so the field is ignored for comparison. Loading @@ -86,7 +87,7 @@ public class LaunchActivityItem extends ClientTransactionItem { mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mState, mPersistentState, mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo, client, mAssistToken, mFixedRotationAdjustments, mShareableActivityToken, mLaunchedFromBubble); mLaunchedFromBubble, mTaskFragmentToken); client.addLaunchingActivity(token, r); client.updateProcessState(mProcState, false); client.updatePendingConfiguration(mCurConfig); Loading Loading @@ -124,7 +125,7 @@ public class LaunchActivityItem extends ClientTransactionItem { boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken, IActivityClientController activityClientController, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { boolean launchedFromBubble, IBinder taskFragmentToken) { LaunchActivityItem instance = ObjectPool.obtain(LaunchActivityItem.class); if (instance == null) { instance = new LaunchActivityItem(); Loading @@ -133,7 +134,7 @@ public class LaunchActivityItem extends ClientTransactionItem { voiceInteractor, procState, state, persistentState, pendingResults, pendingNewIntents, activityOptions, isForward, profilerInfo, assistToken, activityClientController, fixedRotationAdjustments, shareableActivityToken, launchedFromBubble); launchedFromBubble, taskFragmentToken); return instance; } Loading @@ -141,7 +142,7 @@ public class LaunchActivityItem extends ClientTransactionItem { @Override public void recycle() { setValues(this, null, 0, null, null, null, null, null, null, 0, null, null, null, null, null, false, null, null, null, null, null, false); null, false, null, null, null, null, null, false, null); ObjectPool.recycle(this); } Loading Loading @@ -172,6 +173,7 @@ public class LaunchActivityItem extends ClientTransactionItem { dest.writeTypedObject(mFixedRotationAdjustments, flags); dest.writeStrongBinder(mShareableActivityToken); dest.writeBoolean(mLaunchedFromBubble); dest.writeStrongBinder(mTaskFragmentToken); } /** Read from Parcel. */ Loading @@ -190,7 +192,8 @@ public class LaunchActivityItem extends ClientTransactionItem { in.readStrongBinder(), IActivityClientController.Stub.asInterface(in.readStrongBinder()), in.readTypedObject(FixedRotationAdjustments.CREATOR), in.readStrongBinder(), in.readBoolean()); in.readBoolean(), in.readStrongBinder()); } public static final @NonNull Creator<LaunchActivityItem> CREATOR = Loading Loading @@ -229,7 +232,8 @@ public class LaunchActivityItem extends ClientTransactionItem { && Objects.equals(mProfilerInfo, other.mProfilerInfo) && Objects.equals(mAssistToken, other.mAssistToken) && Objects.equals(mFixedRotationAdjustments, other.mFixedRotationAdjustments) && Objects.equals(mShareableActivityToken, other.mShareableActivityToken); && Objects.equals(mShareableActivityToken, other.mShareableActivityToken) && Objects.equals(mTaskFragmentToken, other.mTaskFragmentToken); } @Override Loading @@ -252,6 +256,7 @@ public class LaunchActivityItem extends ClientTransactionItem { result = 31 * result + Objects.hashCode(mAssistToken); result = 31 * result + Objects.hashCode(mFixedRotationAdjustments); result = 31 * result + Objects.hashCode(mShareableActivityToken); result = 31 * result + Objects.hashCode(mTaskFragmentToken); return result; } Loading Loading @@ -301,7 +306,7 @@ public class LaunchActivityItem extends ClientTransactionItem { ActivityOptions activityOptions, boolean isForward, ProfilerInfo profilerInfo, IBinder assistToken, IActivityClientController activityClientController, FixedRotationAdjustments fixedRotationAdjustments, IBinder shareableActivityToken, boolean launchedFromBubble) { boolean launchedFromBubble, IBinder taskFragmentToken) { instance.mIntent = intent; instance.mIdent = ident; instance.mInfo = info; Loading @@ -323,5 +328,6 @@ public class LaunchActivityItem extends ClientTransactionItem { instance.mFixedRotationAdjustments = fixedRotationAdjustments; instance.mShareableActivityToken = shareableActivityToken; instance.mLaunchedFromBubble = launchedFromBubble; instance.mTaskFragmentToken = taskFragmentToken; } }
core/tests/coretests/src/android/app/servertransaction/ObjectPoolTests.java +2 −1 Original line number Diff line number Diff line Loading @@ -156,7 +156,8 @@ public class ObjectPoolTests { .setProcState(procState).setState(bundle).setPersistentState(persistableBundle) .setPendingResults(resultInfoList()).setPendingNewIntents(referrerIntentList()) .setIsForward(true).setAssistToken(assistToken) .setShareableActivityToken(shareableActivityToken).build(); .setShareableActivityToken(shareableActivityToken) .setTaskFragmentToken(new Binder()).build(); LaunchActivityItem emptyItem = new LaunchActivityItemBuilder().build(); LaunchActivityItem item = itemSupplier.get(); Loading
core/tests/coretests/src/android/app/servertransaction/TestUtils.java +7 −1 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ class TestUtils { private IBinder mShareableActivityToken; private FixedRotationAdjustments mFixedRotationAdjustments; private boolean mLaunchedFromBubble; private IBinder mTaskFragmentToken; LaunchActivityItemBuilder setIntent(Intent intent) { mIntent = intent; Loading Loading @@ -213,13 +214,18 @@ class TestUtils { return this; } LaunchActivityItemBuilder setTaskFragmentToken(IBinder taskFragmentToken) { mTaskFragmentToken = taskFragmentToken; return this; } LaunchActivityItem build() { return LaunchActivityItem.obtain(mIntent, mIdent, mInfo, mCurConfig, mOverrideConfig, mCompatInfo, mReferrer, mVoiceInteractor, mProcState, mState, mPersistentState, mPendingResults, mPendingNewIntents, mActivityOptions, mIsForward, mProfilerInfo, mAssistToken, null /* activityClientController */, mFixedRotationAdjustments, mShareableActivityToken, mLaunchedFromBubble); mShareableActivityToken, mLaunchedFromBubble, mTaskFragmentToken); } } }
core/tests/coretests/src/android/app/servertransaction/TransactionParcelTests.java +1 −0 Original line number Diff line number Diff line Loading @@ -209,6 +209,7 @@ public class TransactionParcelTests { .setPendingNewIntents(referrerIntentList()).setIsForward(true) .setAssistToken(new Binder()).setFixedRotationAdjustments(fixedRotationAdjustments) .setShareableActivityToken(new Binder()) .setTaskFragmentToken(new Binder()) .build(); writeAndPrepareForReading(item); Loading