From f41f7c31b9578cc832cad5daf1523bd5633aec67 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Mon, 22 Jan 2018 17:57:05 -0800 Subject: [PATCH] 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 --- .../systemui/statusbar/phone/QuickScrubController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java index 6fc5bbdd5977c..ee1d08872999a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java @@ -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;