From 05179b66501d31ec3417f3a9ece9f9ade4e9fedd Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 12 Jun 2020 14:54:02 -0700 Subject: [PATCH] Fixing recents animation not getting completed sometimes when using 3P launcher Bug: 158855992 Change-Id: I2c0cb74edfea5406e79aa99d6604183e63c1f0f1 --- .../com/android/quickstep/BaseSwipeUpHandlerV2.java | 4 ++-- .../com/android/quickstep/FallbackSwipeHandler.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java index d55dc0f1b1..e825c5f5b8 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandlerV2.java @@ -131,7 +131,7 @@ public abstract class BaseSwipeUpHandlerV2, Q exte private static final int STATE_CAPTURE_SCREENSHOT = getFlagForIndex(10, "STATE_CAPTURE_SCREENSHOT"); - private static final int STATE_SCREENSHOT_CAPTURED = + protected static final int STATE_SCREENSHOT_CAPTURED = getFlagForIndex(11, "STATE_SCREENSHOT_CAPTURED"); private static final int STATE_SCREENSHOT_VIEW_SHOWN = getFlagForIndex(12, "STATE_SCREENSHOT_VIEW_SHOWN"); @@ -1192,7 +1192,7 @@ public abstract class BaseSwipeUpHandlerV2, Q exte mActivity.clearForceInvisibleFlag(INVISIBLE_BY_STATE_HANDLER); } - private void switchToScreenshot() { + protected void switchToScreenshot() { final int runningTaskId = mGestureState.getRunningTaskId(); if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { if (mRecentsAnimationController != null) { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java index 96913c651c..fc7a119f21 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/FallbackSwipeHandler.java @@ -110,6 +110,16 @@ public class FallbackSwipeHandler extends false /* toRecents */, callback, true /* sendUserLeaveHint */); } + @Override + protected void switchToScreenshot() { + if (mRunningOverHome) { + // When the current task is home, then we don't need to capture anything + mStateCallback.setStateOnUiThread(STATE_SCREENSHOT_CAPTURED); + } else { + super.switchToScreenshot(); + } + } + @Override protected void notifyGestureAnimationStartToRecents() { if (mRunningOverHome) {