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

Commit f41f7c31 authored by Matthew Ng's avatar Matthew Ng
Browse files

Enable quickscrub with system prop flag

By default quickscrub will be disabled. It can be enabled with the
following command:

adb shell setprop persist.quickstep.scrub.enabled true

Bug: 70180755
Test: manual
Change-Id: I61f9dbf442bddbf328c8d5de6a2b7e4052793de1
parent 1776fa33
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Slog;
import android.view.Display;
@@ -131,7 +132,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
        new GestureDetector.SimpleOnGestureListener() {
            @Override
            public boolean onFling(MotionEvent e1, MotionEvent e2, float velX, float velY) {
                if (mQuickScrubActive) {
                if (!isQuickScrubEnabled() || mQuickScrubActive) {
                    return false;
                }
                float velocityX = mIsRTL ? -velX : velX;
@@ -196,12 +197,13 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
            case MotionEvent.ACTION_DOWN: {
                int x = (int) event.getX();
                int y = (int) event.getY();
                if (mHomeButtonRect.contains(x, y)) {
                if (isQuickScrubEnabled() && mHomeButtonRect.contains(x, y)) {
                    mTouchDownX = x;
                    mTouchDownY = y;
                    homeButton.setDelayTouchFeedback(true);
                    mHandler.postDelayed(mLongPressRunnable, LONG_PRESS_DELAY_MS);
                } else {
                    homeButton.setDelayTouchFeedback(false);
                    mTouchDownX = mTouchDownY = -1;
                }
                break;
@@ -356,6 +358,10 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
        }
    }

    boolean isQuickScrubEnabled() {
        return SystemProperties.getBoolean("persist.quickstep.scrub.enabled", false);
    }

    private void startQuickScrub() {
        if (!mQuickScrubActive) {
            mQuickScrubActive = true;