From e103b773e6b6af10c9a13d7d0f4009883a814ac6 Mon Sep 17 00:00:00 2001 From: wilsonshih Date: Fri, 6 Mar 2020 16:15:28 +0800 Subject: [PATCH] Fix starting window did not transfer to starting activity. The starting activity was been mis-judged as occluding activity, thus did not transfer starting window to the starting activity. Bug: 150298988 Test: ActivityStackTests Change-Id: I045b3416f8b887754aea27b6371e116c6d23852d --- services/core/java/com/android/server/wm/ActivityStack.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/ActivityStack.java b/services/core/java/com/android/server/wm/ActivityStack.java index 420675c5ba1eb..91fc755fa298d 100644 --- a/services/core/java/com/android/server/wm/ActivityStack.java +++ b/services/core/java/com/android/server/wm/ActivityStack.java @@ -2395,8 +2395,10 @@ class ActivityStack extends Task { } Task task = null; if (!newTask && isOrhasTask) { + // Starting activity cannot be occluding activity, otherwise starting window could be + // remove immediately without transferring to starting activity. final ActivityRecord occludingActivity = getActivity( - (ar) -> !ar.finishing && ar.occludesParent(), true, rTask); + (ar) -> !ar.finishing && ar.occludesParent(), true, r); if (occludingActivity != null) { // Here it is! Now, if this is not yet visible (occluded by another task) to the // user, then just add it without starting; it will get started when the user