From 5b837170ec007e01368e02d1556ce0b2c1a847a7 Mon Sep 17 00:00:00 2001 From: Shan Huang Date: Sat, 30 Apr 2022 05:25:14 +0000 Subject: Skip launcher animation when top window is already animating. Currently we invoke the launcher back callback even when the top window leash is not created (which could happen when it already has an animation in progress, such as activity launch animation). Bug:231636972 Test: Swipe back during activity launch animation. m Change-Id: Icf9a39bf68cb862defde3c2cfa5960eada41d277 --- .../com/android/wm/shell/back/BackAnimationController.java | 4 +++- .../java/com/android/server/wm/BackNavigationController.java | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java index 7760df17a8cd..0f93edca27e6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/BackAnimationController.java @@ -402,7 +402,9 @@ public class BackAnimationController implements RemoteCallable onBackNavigationDone( result, finalRemovedWindowContainer, finalBackType, finalTask, - finalprevActivity, requestAnimation)); + finalprevActivity, prepareAnimation)); infoBuilder.setOnBackNavigationDone(onBackNavigationDone); } @@ -381,14 +383,14 @@ class BackNavigationController { private void onBackNavigationDone( Bundle result, WindowContainer windowContainer, int backType, - Task task, ActivityRecord prevActivity, boolean requestAnimation) { + Task task, ActivityRecord prevActivity, boolean prepareAnimation) { SurfaceControl surfaceControl = windowContainer.getSurfaceControl(); boolean triggerBack = result != null && result.getBoolean( BackNavigationInfo.KEY_TRIGGER_BACK); ProtoLog.d(WM_DEBUG_BACK_PREVIEW, "onBackNavigationDone backType=%s, " + "task=%s, prevActivity=%s", backType, task, prevActivity); - if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && requestAnimation) { + if (backType == BackNavigationInfo.TYPE_RETURN_TO_HOME && prepareAnimation) { if (triggerBack) { if (surfaceControl != null && surfaceControl.isValid()) { // When going back to home, hide the task surface before it is re-parented to -- cgit v1.2.3-59-g8ed1b