Merge "Prevent repeatedly resuming/pausing activities in split" into sc-v2-dev am: c983f32c98

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

Change-Id: Ia7aca0c35715ba26eca3c4962a0bf02027193363
This commit is contained in:
Louis Chang
2021-08-19 06:07:13 +00:00
committed by Automerger Merge Worker

View File

@@ -730,12 +730,15 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
canUpdate = true; canUpdate = true;
} }
// Compare the z-order of ActivityStacks if both activities landed on same display. // Update the topmost activity if the activity has higher z-order than the current
if (display == topDisplay // top-resumed activity.
&& mPreQTopResumedActivity.getRootTask().compareTo( if (!canUpdate) {
activity.getRootTask()) <= 0) { final ActivityRecord ar = topDisplay.getActivity(r -> r == activity,
true /* traverseTopToBottom */, mPreQTopResumedActivity);
if (ar != null && ar != mPreQTopResumedActivity) {
canUpdate = true; canUpdate = true;
} }
}
if (canUpdate) { if (canUpdate) {
// Make sure the previous top activity in the process no longer be resumed. // Make sure the previous top activity in the process no longer be resumed.