From 12f6eb565a7df88a75263ae7fba74d0d23b91d98 Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 25 Mar 2022 15:28:29 +0000 Subject: [PATCH] Add lock icon click handler when a11y is enabled Previously it was only enabled if the user had touch exploration enabled. Test: manually enable voice access and interact with lock & unlock icon with voice Fixes: 215294494 Change-Id: I5e40b3c78ad73c4d726584199a1577d01c3cdc19 --- .../android/keyguard/LockIconViewController.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index a4a0105fae3d3..6f0cd47a3f704 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -212,13 +212,13 @@ public class LockIconViewController extends ViewController impleme updateBurnInOffsets(); updateVisibility(); - mAccessibilityManager.addTouchExplorationStateChangeListener( - mTouchExplorationStateChangeListener); + mAccessibilityManager.addAccessibilityStateChangeListener( + mAccessibilityStateChangeListener); updateAccessibility(); } private void updateAccessibility() { - if (mAccessibilityManager.isTouchExplorationEnabled()) { + if (mAccessibilityManager.isEnabled()) { mView.setOnClickListener(mA11yClickListener); } else { mView.setOnClickListener(null); @@ -238,8 +238,8 @@ public class LockIconViewController extends ViewController impleme mCancelDelayedUpdateVisibilityRunnable = null; } - mAccessibilityManager.removeTouchExplorationStateChangeListener( - mTouchExplorationStateChangeListener); + mAccessibilityManager.removeAccessibilityStateChangeListener( + mAccessibilityStateChangeListener); } public float getTop() { @@ -721,6 +721,6 @@ public class LockIconViewController extends ViewController impleme private final View.OnClickListener mA11yClickListener = v -> onLongPress(); - private final AccessibilityManager.TouchExplorationStateChangeListener - mTouchExplorationStateChangeListener = enabled -> updateAccessibility(); + private final AccessibilityManager.AccessibilityStateChangeListener + mAccessibilityStateChangeListener = enabled -> updateAccessibility(); }