From 5420d290eaeecf6906a9047748edc00b479b8c14 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Tue, 6 Apr 2021 13:00:22 +0800 Subject: Fixes unable to start recents activity Another home activity was on top of the Recents activity in a separate task, but both were in the home root task. The Recents activity did not launched behind when swipes up in gesture nav because the home root task was already the top-most root task. Home Root Task - home task #1 (Other home activity) - home task #2 (Recents activity) Start the Recents activity if the belonging leaf task is not the top-most. Bug: 184241073 Test: test gesture nav with the sample app Change-Id: Id1f0d4d81a0246d6814e482d25e49c36d89fb55d --- services/core/java/com/android/server/wm/RecentsAnimation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java index 4f8ea1ac377a..869133ae948c 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimation.java +++ b/services/core/java/com/android/server/wm/RecentsAnimation.java @@ -171,7 +171,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan final boolean hasExistingActivity = targetActivity != null; if (hasExistingActivity) { mRestoreTargetBehindRootTask = getRootTaskAbove(targetRootTask); - if (mRestoreTargetBehindRootTask == null) { + if (mRestoreTargetBehindRootTask == null + && targetRootTask.getTopMostTask() == targetActivity.getTask()) { notifyAnimationCancelBeforeStart(recentsAnimationRunner); ProtoLog.d(WM_DEBUG_RECENTS_ANIMATIONS, "No root task above target root task=%s", targetRootTask); -- cgit v1.2.3-59-g8ed1b