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

Commit 2904eee3 authored by dianlujitao's avatar dianlujitao Committed by Luca Stefani
Browse files

SystemUI: Don't sleep on double tap below status bar

Change-Id: Ic64c29eae63e96f34dc37cda355401b7e2cd2d39
parent 85e5a576
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ public class StatusBarWindowView extends FrameLayout {
    private FalsingManager mFalsingManager;

    private boolean mDoubleTapToSleepEnabled;
    private int mQuickQsTotalHeight;
    private int mQuickQsOffsetHeight;

    // Implements the floating action mode for TextView's Cut/Copy/Past menu. Normally provided by
    // DecorView, but since this is a special window we have to roll our own.
@@ -135,7 +135,7 @@ public class StatusBarWindowView extends FrameLayout {
        @Override
        public boolean onDoubleTap(MotionEvent e) {
            if (!mService.isDozing() && mDoubleTapToSleepEnabled
                    && e.getY() < mQuickQsTotalHeight) {
                    && e.getY() < mQuickQsOffsetHeight) {
                PowerManager pm = mContext.getSystemService(PowerManager.class);
                if (pm != null) {
                    pm.goToSleep(e.getEventTime());
@@ -184,8 +184,8 @@ public class StatusBarWindowView extends FrameLayout {
                Settings.Secure.DOZE_DOUBLE_TAP_GESTURE,
                Settings.Secure.DOZE_TAP_SCREEN_GESTURE,
                DOUBLE_TAP_SLEEP_GESTURE);
        mQuickQsTotalHeight = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.quick_qs_total_height);
        mQuickQsOffsetHeight = getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.quick_qs_offset_height);
    }

    @Override