From 5983ac77d8ab1c36abb3f3a874bd4e6f6a573373 Mon Sep 17 00:00:00 2001 From: Saumya Prakash Date: Fri, 23 Feb 2024 20:13:18 +0000 Subject: [PATCH 1/2] Fix jump in app launch when quick switching from Home This change addresses a recent regression that caused quick switch to not scale up to full screen during the launch animation. Fix: 326625526 Test: Launch quick switch from home and ensure it is a smooth transition Flag: N/A Change-Id: Id94d5d3eae0625225f880897e1e5f3cf9e4fea6c --- .../touchcontrollers/NoButtonQuickSwitchTouchController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java index b7a907fa6b..a92e77aa04 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java @@ -324,12 +324,12 @@ public class NoButtonQuickSwitchTouchController implements TouchController, @Override public void onDragEnd(PointF velocity) { + cancelAnimations(); boolean horizontalFling = mSwipeDetector.isFling(velocity.x); boolean verticalFling = mSwipeDetector.isFling(velocity.y); boolean noFling = !horizontalFling && !verticalFling; if (mMotionPauseDetector.isPaused() && noFling) { // Going to Overview. - cancelAnimations(); InteractionJankMonitorWrapper.cancel(Cuj.CUJ_LAUNCHER_QUICK_SWITCH); StateAnimationConfig config = new StateAnimationConfig(); @@ -455,7 +455,6 @@ public class NoButtonQuickSwitchTouchController implements TouchController, nonOverviewAnim.setDuration(Math.max(xDuration, yDuration)); mNonOverviewAnim.setEndAction(() -> onAnimationToStateCompleted(targetState)); - cancelAnimations(); xOverviewAnim.start(); yOverviewAnim.start(); nonOverviewAnim.start(); From e52fee8b8f189964763cff6f5febd16e2b9daf84 Mon Sep 17 00:00:00 2001 From: Fengjiang Li Date: Fri, 23 Feb 2024 14:26:52 -0800 Subject: [PATCH 2/2] Opt-in predicitive back before register the back button The predictive back infra checks the opt-in status when a callback is registered, and drops the registration if the Application / Activity is not opted-in Fix: 326627953 Test: manual Flag: ACONFIG launcher.enable_predictive_back_gesture DISABLED Change-Id: I8f2e2378d0bf966b3784cf08c12045509b6d5682 --- .../com/android/launcher3/uioverrides/QuickstepLauncher.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index 722676a19c..a515109044 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -647,10 +647,13 @@ public class QuickstepLauncher extends Launcher { @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); + // Back dispatcher is registered in {@link BaseActivity#onCreate}. For predictive back to + // work, we must opt-in BEFORE registering back dispatcher. So we need to call + // setEnableOnBackInvokedCallback() before super.onCreate() if (Utilities.ATLEAST_U && enablePredictiveBackGesture()) { getApplicationInfo().setEnableOnBackInvokedCallback(true); } + super.onCreate(savedInstanceState); if (savedInstanceState != null) { mPendingSplitSelectInfo = ObjectWrapper.unwrap( savedInstanceState.getIBinder(PENDING_SPLIT_SELECT_INFO));