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

Commit d5cc1501 authored by Selim Cinek's avatar Selim Cinek Committed by Android Git Automerger
Browse files

am 1817e501: am 63b6040c: am e9ae5c16: am 69d53b0e: Merge "Enforcing...

am 1817e501: am 63b6040c: am e9ae5c16: am 69d53b0e: Merge "Enforcing falsing-threshold on touch when using AoD" into lmp-dev

* commit '1817e501f12440d8447f3168c9dfe6a6a280360c':
  Enforcing falsing-threshold on touch when using AoD
parents 485736ae fe9d23df
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ public abstract class PanelView extends FrameLayout {
                    }
                    mJustPeeked = false;
                }
                if (-h >= mUnlockFalsingThreshold) {
                if (-h >= getFalsingThreshold()) {
                    mTouchAboveFalsingThreshold = true;
                }
                if (!mJustPeeked && (!waitForTouchSlop || mTracking) && !isTrackingBlocked()) {
@@ -370,6 +370,11 @@ public abstract class PanelView extends FrameLayout {
        return !waitForTouchSlop || mTracking;
    }

    private int getFalsingThreshold() {
        float factor = mStatusBar.isScreenOnComingFromTouch() ? 1.5f : 1.0f;
        return (int) (mUnlockFalsingThreshold * factor);
    }

    protected abstract boolean hasConflictingGestures();

    protected void onTrackingStopped(boolean expand) {
+11 −2
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    private StatusBarWindowManager mStatusBarWindowManager;
    private UnlockMethodCache mUnlockMethodCache;
    private DozeServiceHost mDozeServiceHost;
    private boolean mScreenOnComingFromTouch;

    int mPixelFormat;
    Object mQueueLock = new Object();
@@ -2118,10 +2119,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        return mNotificationPanel.isQsExpanded();
    }

    public boolean isScreenOnComingFromTouch() {
        return mScreenOnComingFromTouch;
    }

    public boolean isFalsingThresholdNeeded() {
        boolean onKeyguard = getBarState() == StatusBarState.KEYGUARD;
        boolean isMethodInsecure = mUnlockMethodCache.isMethodInsecure();
        return onKeyguard && (isMethodInsecure || mDozing);
        return onKeyguard && (isMethodInsecure || mDozing || mScreenOnComingFromTouch);
    }

    @Override  // NotificationData.Environment
@@ -3909,6 +3914,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    public void onScreenTurnedOff() {
        mScreenOnFromKeyguard = false;
        mScreenOnComingFromTouch = false;
        mStackScroller.setAnimationsEnabled(false);
    }

@@ -4011,10 +4017,13 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        return !mNotificationData.getActiveNotifications().isEmpty();
    }

    public void wakeUpIfDozing(long time) {
    public void wakeUpIfDozing(long time, boolean fromTouch) {
        if (mDozing && mScrimController.isPulsing()) {
            PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
            pm.wakeUp(time);
            if (fromTouch) {
                mScreenOnComingFromTouch = true;
            }
        }
    }

+2 −2
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ public class StatusBarWindowView extends FrameLayout {
            case KeyEvent.KEYCODE_VOLUME_DOWN:
            case KeyEvent.KEYCODE_VOLUME_UP:
                if (down) {
                    mService.wakeUpIfDozing(event.getEventTime());
                    mService.wakeUpIfDozing(event.getEventTime(), false);
                }
        }
        if (mService.interceptMediaKey(event)) {
@@ -164,7 +164,7 @@ public class StatusBarWindowView extends FrameLayout {
            intercept = mDragDownHelper.onInterceptTouchEvent(ev);
            // wake up on a touch down event, if dozing
            if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
                mService.wakeUpIfDozing(ev.getEventTime());
                mService.wakeUpIfDozing(ev.getEventTime(), true);
            }
        }
        if (!intercept) {