@Override public void onStateChanged(boolean accessibilityEnabled, boolean touchExplorationEnabled) { mCameraImageView.setClickable(touchExplorationEnabled); mPhoneImageView.setClickable(touchExplorationEnabled); mCameraImageView.setFocusable(accessibilityEnabled); mPhoneImageView.setFocusable(accessibilityEnabled); updateLockIconClickability(); }
private void updateLockIconClickability() { if (mAccessibilityController == null) { return; } 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()); }