From ce07a3721aa5461ce246c0a9dd040faab7dda3e7 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 7 May 2021 14:20:38 -0700 Subject: [PATCH] Defer some heavy work from final frame of app -> home transition - Call reapplyState() on the next frame after settling on home. - Post some calls from RecentsView#reset() to the next frame. - Remove onSwipeUpToRecentsComplete() which only called reapplyState() uncessarily. - Also animate TASK_SECONDARY_TRANSLATION back to 0 to ensure state machine is in sync with long swipe resistance properties. Test: profile swipe to home, significantly reduced last frame time. Bug: 183139317 Change-Id: I37b1829f6f1d5a718e99c131935b87b5200d567f --- .../BaseRecentsViewStateController.java | 2 ++ .../com/android/quickstep/AbsSwipeUpHandler.java | 1 - .../android/quickstep/BaseActivityInterface.java | 12 ++---------- .../quickstep/FallbackActivityInterface.java | 6 ------ .../quickstep/LauncherActivityInterface.java | 11 ++++++++--- .../com/android/quickstep/views/RecentsView.java | 16 ++++++++++------ 6 files changed, 22 insertions(+), 26 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java index e508690113..192a29bbe0 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/BaseRecentsViewStateController.java @@ -99,6 +99,8 @@ public abstract class BaseRecentsViewStateController config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_X, LINEAR)); setter.setFloat(mRecentsView, ADJACENT_PAGE_VERTICAL_OFFSET, scaleAndOffset[2], config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR)); + setter.setFloat(mRecentsView, TASK_SECONDARY_TRANSLATION, 0f, + config.getInterpolator(ANIM_OVERVIEW_TRANSLATE_Y, LINEAR)); PagedOrientationHandler orientationHandler = ((RecentsView) mLauncher.getOverviewPanel()).getPagedOrientationHandler(); FloatProperty taskViewsFloat = orientationHandler.getSplitSelectTaskOffset( diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index d04bfe95e2..ac7356fdd3 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1519,7 +1519,6 @@ public abstract class AbsSwipeUpHandler, private void setupLauncherUiAfterSwipeUpToRecentsAnimation() { endLauncherTransitionController(); - mActivityInterface.onSwipeUpToRecentsComplete(); mRecentsView.onSwipeUpAnimationSuccess(); if (LIVE_TILE.get()) { mTaskAnimationManager.setLiveTileCleanUpHandler(mInputConsumerProxy::destroy); diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index b60b1be24b..c8865c4b3b 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -99,16 +99,8 @@ public abstract class BaseActivityInterface { + unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL); + setCurrentPage(0); + LayoutUtils.setViewEnabled(mActionsView, true); + if (mOrientationState.setGestureActive(false)) { + updateOrientationHandler(); + } + }); } public int getRunningTaskId() {