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

Commit 38fc7606 authored by Adrian Roos's avatar Adrian Roos
Browse files

Ensure that force lock works with accessibility enabled

Fixes a bug where the force lock gesture was not available
when an accessibility service was active, but touch exploration
wasn't.

Bug: 17514298
Change-Id: Ib42e28f643559040ad5f24d45456b0a41008c647
parent ee3ef2b8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -497,4 +497,13 @@ public class KeyguardAffordanceView extends ImageView {
    public void setIsLeft(boolean left) {
        mIsLeft = left;
    }

    @Override
    public boolean performClick() {
        if (isClickable()) {
            return super.performClick();
        } else {
            return false;
        }
    }
}
+7 −4
Original line number Diff line number Diff line
@@ -284,10 +284,13 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
        if (mAccessibilityController == null) {
            return;
        }
        mLockIcon.setClickable(mUnlockMethodCache.isTrustManaged()
                || mAccessibilityController.isTouchExplorationEnabled());
        mLockIcon.setLongClickable(mAccessibilityController.isTouchExplorationEnabled()
                && mUnlockMethodCache.isTrustManaged());
        boolean clickToUnlock = mAccessibilityController.isTouchExplorationEnabled();
        boolean clickToForceLock = mUnlockMethodCache.isTrustManaged()
                && !mAccessibilityController.isAccessibilityEnabled();
        boolean longClickToForceLock = mUnlockMethodCache.isTrustManaged()
                && !clickToForceLock;
        mLockIcon.setClickable(clickToForceLock || clickToUnlock);
        mLockIcon.setLongClickable(longClickToForceLock);
        mLockIcon.setFocusable(mAccessibilityController.isAccessibilityEnabled());
    }