From 876a3eeab94c8cf15c86d6af2fae445a85751ad4 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Thu, 25 Jan 2018 14:39:25 +0100 Subject: Fix issue with flickering with recents animation The flicker is caused by executeAppTransition only being called after the closing activity has finished pausing, probably because it can enter PIP. We don't need to wait for the activity to finish pausing in this case - just execute the transaction and destroy the surfaces already! Test: go/wm-smoke Test: Swipe up on PIPable activity with new Launcher APK Change-Id: I92efef97b157a13e4670eb0c7e7113afa50302d5 --- services/core/java/com/android/server/am/RecentsAnimation.java | 4 ++++ .../core/java/com/android/server/wm/RecentsAnimationController.java | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/RecentsAnimation.java b/services/core/java/com/android/server/am/RecentsAnimation.java index fe576fdaacbe..f0b27a74a66b 100644 --- a/services/core/java/com/android/server/am/RecentsAnimation.java +++ b/services/core/java/com/android/server/am/RecentsAnimation.java @@ -153,6 +153,10 @@ class RecentsAnimation implements RecentsAnimationCallbacks { mWindowManager.prepareAppTransition(TRANSIT_NONE, false); mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, false); mStackSupervisor.resumeFocusedStackTopActivityLocked(); + + // No reason to wait for the pausing activity in this case, as the hiding of + // surfaces needs to be done immediately. + mWindowManager.executeAppTransition(); }); } } diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java index c7d4b8ed0f16..fe5b65ccbf6d 100644 --- a/services/core/java/com/android/server/wm/RecentsAnimationController.java +++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java @@ -265,7 +265,6 @@ public class RecentsAnimationController { mPendingAnimations.clear(); mService.mInputMonitor.updateInputWindowsLw(true /*force*/); - mService.scheduleAnimationLocked(); mService.destroyInputConsumer(INPUT_CONSUMER_RECENTS_ANIMATION); } -- cgit v1.2.3-59-g8ed1b