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

Commit 45c97cd4 authored by d34d's avatar d34d Committed by Danesh M
Browse files

Keyguard: Allow swiping up when trust managed

When the lock screen is being trust managed, the center keyguard
affordance view becomes clickable and consumes touch events, which
includes the user swiping up from the center icon to unlock.  This
patch checks if the lock screen is being trust managed and if so,
intercepts the touch events while retaining the clickability of the
center lock icon.

Change-Id: I54dd9bfdded3dbd2bf90ed1fc49dd55e5b3a7214
TICKET: CYNGNOS-2687
(cherry picked from commit 59cd5997)
parent 0e9623db
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -242,6 +242,13 @@ public class KeyguardAffordanceHelper {
        return false;
    }

    public boolean isOnLockIcon(MotionEvent event) {
        final float x = event.getX();
        final float y = event.getRawY();

        return isOnIcon(mCenterIcon, x, y);
    }

    public void startHintAnimation(boolean right,
            Runnable onFinishedListener) {
        cancelAnimation();
+7 −2
Original line number Diff line number Diff line
@@ -264,6 +264,8 @@ public class NotificationPanelView extends PanelView implements
    private LiveLockScreenController mLiveLockscreenController;
    private final GestureDetector mGestureDetector;
    private ViewLinker mViewLinker;
    private final UnlockMethodCache mUnlockMethodCache;


    private enum SwipeLockedDirection {
        UNKNOWN,
@@ -394,6 +396,7 @@ public class NotificationPanelView extends PanelView implements
        Point point = new Point();
        display.getSize(point);
        mScreenHeight = point.y;
        mUnlockMethodCache = UnlockMethodCache.getInstance(context);
    }

    public void setStatusBar(PhoneStatusBar bar) {
@@ -824,7 +827,8 @@ public class NotificationPanelView extends PanelView implements
            return true;
        }

        if (isKeyguardInteractiveAndShowing() || mStatusBar.isKeyguardShowingMedia()) {
        if (isKeyguardInteractiveAndShowing() || mStatusBar.isKeyguardShowingMedia() ||
                (mUnlockMethodCache.isTrustManaged() && mAfforanceHelper.isOnLockIcon(event))) {
            return super.onInterceptTouchEvent(event);
        }

@@ -1019,7 +1023,8 @@ public class NotificationPanelView extends PanelView implements
            updateVerticalPanelPosition(event.getX());
        }

        if (isKeyguardInteractiveAndShowing() || mStatusBar.isKeyguardShowingMedia()) {
        if (isKeyguardInteractiveAndShowing() || mStatusBar.isKeyguardShowingMedia() ||
                (mUnlockMethodCache.isTrustManaged() && mAfforanceHelper.isOnLockIcon(event))) {
            super.onTouchEvent(event);
            return true;
        }