From e11ee153508cdf24bd1346fee7b467d5ca41da52 Mon Sep 17 00:00:00 2001 From: Austin Delgado Date: Wed, 12 Jul 2023 14:38:33 -0700 Subject: [PATCH] Update hint action for canceling face auth in BP Fixes: 289019193 Test: Manual, verify expected string is spoken as hint when cancel auth button is focused Change-Id: I363d57f51e0e071f106a69c4265dcad04344a851 --- packages/SystemUI/res/values/strings.xml | 2 ++ .../systemui/biometrics/AuthContainerView.java | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 070748cb92f85..6c01d6f8d2766 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -362,6 +362,8 @@ Face recognized. Press the unlock icon to continue. Authenticated + + Cancel Authentication Use PIN diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java index 7a2f2443dbd2c..76181094c4b31 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java @@ -58,6 +58,10 @@ import android.widget.ScrollView; import android.window.OnBackInvokedCallback; import android.window.OnBackInvokedDispatcher; +import androidx.core.view.AccessibilityDelegateCompat; +import androidx.core.view.ViewCompat; +import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; + import com.android.app.animation.Interpolators; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.jank.InteractionJankMonitor; @@ -333,6 +337,20 @@ public class AuthContainerView extends LinearLayout addView(mFrameLayout); mBiometricScrollView = mFrameLayout.findViewById(R.id.biometric_scrollview); mBackgroundView = mFrameLayout.findViewById(R.id.background); + ViewCompat.setAccessibilityDelegate(mBackgroundView, new AccessibilityDelegateCompat() { + @Override + public void onInitializeAccessibilityNodeInfo(View host, + AccessibilityNodeInfoCompat info) { + super.onInitializeAccessibilityNodeInfo(host, info); + info.addAction( + new AccessibilityNodeInfoCompat.AccessibilityActionCompat( + AccessibilityNodeInfoCompat.ACTION_CLICK, + mContext.getString(R.string.biometric_dialog_cancel_authentication) + ) + ); + } + }); + mPanelView = mFrameLayout.findViewById(R.id.panel); mPanelController = new AuthPanelController(mContext, mPanelView); mBackgroundExecutor = bgExecutor;