Skip to content

Commit

Permalink
SystemUI: use DOUBLE_TAP_TO_WAKE setting also for wake from aod
Browse files Browse the repository at this point in the history
Change-Id: I844e36469b0e3b0168eecb62f6e8b0e9b2bff40e
  • Loading branch information
maxwen authored and Lucchetto committed Nov 15, 2020
1 parent b92390c commit 258004e
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ public class NotificationShadeWindowViewController {
private RectF mTempRect = new RectF();
private boolean mIsTrackingBarGesture = false;

// custom additions start
private boolean mDoubleTapEnabledNative;

@Inject
public NotificationShadeWindowViewController(
InjectionInflationController injectionInflationController,
Expand Down Expand Up @@ -170,11 +173,17 @@ public void setupExpandedStatusBar() {
break;
case Settings.Secure.DOZE_TAP_SCREEN_GESTURE:
mSingleTapEnabled = configuration.tapGestureEnabled(UserHandle.USER_CURRENT);
break;
case Settings.Secure.DOUBLE_TAP_TO_WAKE:
mDoubleTapEnabledNative = Settings.Secure.getIntForUser(mView.getContext().getContentResolver(),
Settings.Secure.DOUBLE_TAP_TO_WAKE, 0, UserHandle.USER_CURRENT) == 1;
break;
}
};
mTunerService.addTunable(tunable,
Settings.Secure.DOZE_DOUBLE_TAP_GESTURE,
Settings.Secure.DOZE_TAP_SCREEN_GESTURE);
Settings.Secure.DOZE_TAP_SCREEN_GESTURE,
Settings.Secure.DOUBLE_TAP_TO_WAKE);

GestureDetector.SimpleOnGestureListener gestureListener =
new GestureDetector.SimpleOnGestureListener() {
Expand All @@ -190,7 +199,7 @@ public boolean onSingleTapConfirmed(MotionEvent e) {

@Override
public boolean onDoubleTap(MotionEvent e) {
if (mDoubleTapEnabled || mSingleTapEnabled) {
if (mDoubleTapEnabled || mSingleTapEnabled || mDoubleTapEnabledNative) {
mService.wakeUpIfDozing(
SystemClock.uptimeMillis(), mView, "DOUBLE_TAP");
return true;
Expand Down

0 comments on commit 258004e

Please sign in to comment.