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

Commit babaa75f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Only intercept lockIcon touches after longpress" into sc-dev am: 5e013161 am: f6c074dd

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15313964

Change-Id: I98c3e06e5b71d478db5415d9e03d445a52ca1e9c
parents 5a02e518 f6c074dd
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -119,6 +119,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
    private boolean mShowLockIcon;
    private boolean mShowLockIcon;


    private boolean mDownDetected;
    private boolean mDownDetected;
    private boolean mDetectedLongPress;
    private final Rect mSensorTouchLocation = new Rect();
    private final Rect mSensorTouchLocation = new Rect();


    @Inject
    @Inject
@@ -485,6 +486,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
    private final GestureDetector mGestureDetector =
    private final GestureDetector mGestureDetector =
            new GestureDetector(new SimpleOnGestureListener() {
            new GestureDetector(new SimpleOnGestureListener() {
                public boolean onDown(MotionEvent e) {
                public boolean onDown(MotionEvent e) {
                    mDetectedLongPress = false;
                    if (!isClickable()) {
                    if (!isClickable()) {
                        mDownDetected = false;
                        mDownDetected = false;
                        return false;
                        return false;
@@ -517,6 +519,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
                                "lockIcon-onLongPress",
                                "lockIcon-onLongPress",
                                VIBRATION_SONIFICATION_ATTRIBUTES);
                                VIBRATION_SONIFICATION_ATTRIBUTES);
                    }
                    }
                    mDetectedLongPress = true;
                    onAffordanceClick();
                    onAffordanceClick();
                }
                }


@@ -559,7 +562,7 @@ public class LockIconViewController extends ViewController<LockIconView> impleme
        // we continue to intercept all following touches until we see MotionEvent.ACTION_CANCEL UP
        // we continue to intercept all following touches until we see MotionEvent.ACTION_CANCEL UP
        // or MotionEvent.ACTION_UP. this is to avoid passing the touch to NPV
        // or MotionEvent.ACTION_UP. this is to avoid passing the touch to NPV
        // after the lock icon disappears on device entry
        // after the lock icon disappears on device entry
        if (mDownDetected) {
        if (mDownDetected && mDetectedLongPress) {
            if (event.getAction() == MotionEvent.ACTION_CANCEL
            if (event.getAction() == MotionEvent.ACTION_CANCEL
                    || event.getAction() == MotionEvent.ACTION_UP) {
                    || event.getAction() == MotionEvent.ACTION_UP) {
                mDownDetected = false;
                mDownDetected = false;