From 916745dac0818228d6bad8e03b0df62f230ec8cb Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Thu, 12 Aug 2021 14:30:55 -0700 Subject: [PATCH] Fix zordering of recents input consumer - It should be above the top activity of the task Bug: 195427335 Test: atest RecentsAnimationControllerTest Change-Id: Ic2c3a236541d5644f5b34e1c63b10e5e20eaf5f5 --- services/core/java/com/android/server/wm/InputMonitor.java | 2 +- .../com/android/server/wm/RecentsAnimationController.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index d819557006a63..6efda04ba9895 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -543,7 +543,7 @@ final class InputMonitor { if (recentsAnimationController.updateInputConsumerForApp( mRecentsAnimationInputConsumer.mWindowHandle)) { mRecentsAnimationInputConsumer.show(mInputTransaction, - recentsAnimationController.getHighestLayerTask()); + recentsAnimationController.getHighestLayerActivity()); mAddRecentsAnimationInputConsumerHandle = false; } } diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index c457df9f6e869..d7dc3061f250a 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -1103,9 +1103,9 @@ public class RecentsAnimationController implements DeathRecipient { } /** - * Returns the task with the highest layer, or null if none is found. + * Returns the activity with the highest layer, or null if none is found. */ - public Task getHighestLayerTask() { + public ActivityRecord getHighestLayerActivity() { int highestLayer = Integer.MIN_VALUE; Task highestLayerTask = null; for (int i = mPendingAnimations.size() - 1; i >= 0; i--) { @@ -1116,7 +1116,7 @@ public class RecentsAnimationController implements DeathRecipient { highestLayerTask = adapter.mTask; } } - return highestLayerTask; + return highestLayerTask.getTopMostActivity(); } boolean isAnimatingTask(Task task) {