From 2b006fb27b81c03eb3afb1aef48073dd50e5d6a8 Mon Sep 17 00:00:00 2001 From: shawnlin Date: Thu, 3 Jun 2021 12:57:13 +0800 Subject: [PATCH] Detach the nav once the endTarget is determined as HOME Bug: 189900722 Test: manual - swipe up to home from an app and observe the nav Change-Id: I421de17fe4d8413deaf9ebd63166a6d2d00d096e --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 6 +++++- .../com/android/quickstep/RecentsAnimationController.java | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index be927e0107..306032cff2 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -972,6 +972,10 @@ public abstract class AbsSwipeUpHandler, } if (endTarget == HOME) { duration = HOME_DURATION; + // Early detach the nav bar once the endTarget is determined as HOME + if (mRecentsAnimationController != null) { + mRecentsAnimationController.detachNavigationBarFromApp(true); + } } else if (endTarget == RECENTS) { if (mRecentsView != null) { int nearestPage = mRecentsView.getDestinationPage(); @@ -1496,7 +1500,7 @@ public abstract class AbsSwipeUpHandler, if (LIVE_TILE.get()) { mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED); if (mRecentsAnimationController != null) { - mRecentsAnimationController.getController().detachNavigationBarFromApp(true); + mRecentsAnimationController.detachNavigationBarFromApp(true); } } else if (!hasTargets() || mRecentsAnimationController == null) { // If there are no targets or the animation not started, then there is nothing to finish diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index 462f71440c..50d0569cf2 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -154,6 +154,14 @@ public class RecentsAnimationController { }); } + /** + * @see RecentsAnimationControllerCompat#detachNavigationBarFromApp + */ + @UiThread + public void detachNavigationBarFromApp(boolean moveHomeToTop) { + UI_HELPER_EXECUTOR.execute(() -> mController.detachNavigationBarFromApp(moveHomeToTop)); + } + /** * Sets the final surface transaction on a Task. This is used by Launcher to notify the system * that animating Activity to PiP has completed and the associated task surface should be