From 4c83e679c9141aadd70959e2c63dfff7d4b92f37 Mon Sep 17 00:00:00 2001 From: Kevin Chyn Date: Thu, 13 May 2021 17:29:12 -0700 Subject: [PATCH] Prevent UdfpsView from being selectable during a11y enrollment Touching the sensor area also selects the UdfpsView, which triggers unnecessary feedback. Fixes: 187324285 Test: manual Change-Id: I9761c313d917f11fd42e0d584d6303d2150ce1a0 --- .../com/android/systemui/biometrics/UdfpsController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java index 5a50f0eed8338..5805afc3564bb 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java @@ -624,6 +624,14 @@ public class UdfpsController implements DozeReceiver, HbmCallback { animation.init(); mView.setAnimationViewController(animation); + // This view overlaps the sensor area, so prevent it from being selectable + // during a11y. + if (reason == IUdfpsOverlayController.REASON_ENROLL_FIND_SENSOR + || reason == IUdfpsOverlayController.REASON_ENROLL_ENROLLING) { + mView.setImportantForAccessibility( + View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); + } + mWindowManager.addView(mView, computeLayoutParams(animation)); mAccessibilityManager.addTouchExplorationStateChangeListener( mTouchExplorationStateChangeListener);