Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0fb1e4b5 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

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
parent e8532d84
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -76,4 +76,10 @@ public class FastOverviewState extends OverviewState {
        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();
    }
}
+11 −0
Original line number Diff line number Diff line
@@ -132,6 +132,17 @@ public class QuickScrubController implements OnAlarmListener {
        }
    }

    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.
     */
+1 −0
Original line number Diff line number Diff line
@@ -700,6 +700,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {

        mRecentsView.setRunningTaskHidden(false);
        mRecentsView.setRunningTaskIconScaledDown(false /* isScaledDown */, false /* animate */);
        mQuickScrubController.cancelActiveQuickscrub();
    }

    private void notifyTransitionCancelled() {