Cancelling quickscrub state incease we missed quickscrub end event
> This can happen when the remote transition is cancelled while animating down
during quickscrub, cause WindowTransformSwipeHandler to get invalidated
and miss onQuickscrubEnd
Bug: 80140388
Change-Id: I0221e301d4d633bab0defaa6af76e0054776a95a
diff --git a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java b/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
index 43d9822..cd92314 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/FastOverviewState.java
@@ -76,4 +76,10 @@
return Math.min(Math.min(dp.availableHeightPx / usedHeight,
dp.availableWidthPx / usedWidth), MAX_PREVIEW_SCALE_UP);
}
+
+ @Override
+ public void onStateDisabled(Launcher launcher) {
+ super.onStateDisabled(launcher);
+ launcher.<RecentsView>getOverviewPanel().getQuickScrubController().cancelActiveQuickscrub();
+ }
}
diff --git a/quickstep/src/com/android/quickstep/QuickScrubController.java b/quickstep/src/com/android/quickstep/QuickScrubController.java
index 8e1a3d5..95a82dd 100644
--- a/quickstep/src/com/android/quickstep/QuickScrubController.java
+++ b/quickstep/src/com/android/quickstep/QuickScrubController.java
@@ -132,6 +132,17 @@
}
}
+ public void cancelActiveQuickscrub() {
+ if (!mInQuickScrub) {
+ return;
+ }
+ Log.d(TAG, "Quickscrub was active, cancelling");
+ mInQuickScrub = false;
+ mActivityControlHelper = null;
+ mOnFinishedTransitionToQuickScrubRunnable = null;
+ mRecentsView.setNextPageSwitchRunnable(null);
+ }
+
/**
* Initializes the UI for quick scrub, returns true if success.
*/
diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
index e93c807..695e046 100644
--- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -700,6 +700,7 @@
mRecentsView.setRunningTaskHidden(false);
mRecentsView.setRunningTaskIconScaledDown(false /* isScaledDown */, false /* animate */);
+ mQuickScrubController.cancelActiveQuickscrub();
}
private void notifyTransitionCancelled() {