From 0ae8f3504b96cb93586ed3f9634126d063505061 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Tue, 17 Aug 2021 14:19:37 +0800 Subject: [PATCH] Prevent repeatedly resuming/pausing activities in split The embedding activity was repeatedly pausing/resuming when the app is targeting SDK before Q. That's because we were only comparing the z-order of the root task. However, both of the two activities in split are in the same task. Update the topmost activity by comparing the z-order of the activities. Bug: 196923917 Test: start app with targetSDK prior Q in split Change-Id: Ib6ffb12439689f38e83e320a0c9e739829e0f8fc --- .../android/server/wm/WindowProcessController.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java index 65b065ab8eab3..cd29f0eb61a26 100644 --- a/services/core/java/com/android/server/wm/WindowProcessController.java +++ b/services/core/java/com/android/server/wm/WindowProcessController.java @@ -730,11 +730,14 @@ public class WindowProcessController extends ConfigurationContainer r == activity, + true /* traverseTopToBottom */, mPreQTopResumedActivity); + if (ar != null && ar != mPreQTopResumedActivity) { + canUpdate = true; + } } if (canUpdate) {