Loading core/java/android/app/ActivityClient.java +2 −2 Original line number Diff line number Diff line Loading @@ -77,9 +77,9 @@ public class ActivityClient { * Reports after {@link Activity#onTopResumedActivityChanged(boolean)} is called for losing the * top most position. */ public void activityTopResumedStateLost() { public void activityTopResumedStateLost(IBinder token) { try { getActivityClientController().activityTopResumedStateLost(); getActivityClientController().activityTopResumedStateLost(token); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading core/java/android/app/IActivityClientController.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ interface IActivityClientController { * This call is not one-way because {@link #activityPaused()) is not one-way, or * the top-resumed-lost could be reported after activity paused. */ void activityTopResumedStateLost(); void activityTopResumedStateLost(in IBinder token); /** * Notifies that the activity has completed paused. This call is not one-way because it can make * consecutive launch in the same process more coherent. About the order of binder call, it Loading core/java/android/app/servertransaction/TopResumedActivityChangeItem.java +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class TopResumedActivityChangeItem extends ActivityTransactionItem { // 2. Activity wasn't RESUMED yet, which means that it didn't receive the top state yet. // 3. Activity is PAUSED or in other lifecycle state after PAUSED. In this case top resumed // state loss was already called right before pausing. ActivityClient.getInstance().activityTopResumedStateLost(); ActivityClient.getInstance().activityTopResumedStateLost(getActivityToken()); } // Parcelable implementation Loading core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -196,3 +196,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { namespace: "windowing_sdk" name: "fix_rapid_top_resumed_switch" description: "Prevent top-resumed-activity rapidly switched in multi-window mode." bug: "417956804" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file services/core/java/com/android/server/wm/ActivityClientController.java +10 −2 Original line number Diff line number Diff line Loading @@ -220,10 +220,18 @@ class ActivityClientController extends IActivityClientController.Stub { } @Override public void activityTopResumedStateLost() { public void activityTopResumedStateLost(IBinder token) { final long origId = Binder.clearCallingIdentity(); synchronized (mGlobalLock) { mTaskSupervisor.handleTopResumedStateReleased(false /* timeout */); if (com.android.window.flags.Flags.fixRapidTopResumedSwitch()) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r != null) { mTaskSupervisor.handleTopResumedStateReleasedIfNeeded(r, false /* timeout */); } } else { mTaskSupervisor.handleTopResumedStateReleasedIfNeeded(null, false /* timeout */); } } Binder.restoreCallingIdentity(origId); } Loading Loading
core/java/android/app/ActivityClient.java +2 −2 Original line number Diff line number Diff line Loading @@ -77,9 +77,9 @@ public class ActivityClient { * Reports after {@link Activity#onTopResumedActivityChanged(boolean)} is called for losing the * top most position. */ public void activityTopResumedStateLost() { public void activityTopResumedStateLost(IBinder token) { try { getActivityClientController().activityTopResumedStateLost(); getActivityClientController().activityTopResumedStateLost(token); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading
core/java/android/app/IActivityClientController.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ interface IActivityClientController { * This call is not one-way because {@link #activityPaused()) is not one-way, or * the top-resumed-lost could be reported after activity paused. */ void activityTopResumedStateLost(); void activityTopResumedStateLost(in IBinder token); /** * Notifies that the activity has completed paused. This call is not one-way because it can make * consecutive launch in the same process more coherent. About the order of binder call, it Loading
core/java/android/app/servertransaction/TopResumedActivityChangeItem.java +1 −1 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ public class TopResumedActivityChangeItem extends ActivityTransactionItem { // 2. Activity wasn't RESUMED yet, which means that it didn't receive the top state yet. // 3. Activity is PAUSED or in other lifecycle state after PAUSED. In this case top resumed // state loss was already called right before pausing. ActivityClient.getInstance().activityTopResumedStateLost(); ActivityClient.getInstance().activityTopResumedStateLost(getActivityToken()); } // Parcelable implementation Loading
core/java/android/window/flags/windowing_sdk.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -196,3 +196,13 @@ flag { purpose: PURPOSE_BUGFIX } } flag { namespace: "windowing_sdk" name: "fix_rapid_top_resumed_switch" description: "Prevent top-resumed-activity rapidly switched in multi-window mode." bug: "417956804" metadata { purpose: PURPOSE_BUGFIX } } No newline at end of file
services/core/java/com/android/server/wm/ActivityClientController.java +10 −2 Original line number Diff line number Diff line Loading @@ -220,10 +220,18 @@ class ActivityClientController extends IActivityClientController.Stub { } @Override public void activityTopResumedStateLost() { public void activityTopResumedStateLost(IBinder token) { final long origId = Binder.clearCallingIdentity(); synchronized (mGlobalLock) { mTaskSupervisor.handleTopResumedStateReleased(false /* timeout */); if (com.android.window.flags.Flags.fixRapidTopResumedSwitch()) { final ActivityRecord r = ActivityRecord.forTokenLocked(token); if (r != null) { mTaskSupervisor.handleTopResumedStateReleasedIfNeeded(r, false /* timeout */); } } else { mTaskSupervisor.handleTopResumedStateReleasedIfNeeded(null, false /* timeout */); } } Binder.restoreCallingIdentity(origId); } Loading