Merge "Announce Tuscany help/errors even when text suppressed" into sc-qpr1-dev am: a53bcc03eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15613803 Change-Id: I519e1e57cd389f323c8fc8946cdef1f4531e5cc2
This commit is contained in:
@@ -821,7 +821,7 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showTryFingerprintMsg() {
|
private void showTryFingerprintMsg(String a11yString) {
|
||||||
if (mKeyguardUpdateMonitor.isUdfpsAvailable()) {
|
if (mKeyguardUpdateMonitor.isUdfpsAvailable()) {
|
||||||
// if udfps available, there will always be a tappable affordance to unlock
|
// if udfps available, there will always be a tappable affordance to unlock
|
||||||
// For example, the lock icon
|
// For example, the lock icon
|
||||||
@@ -833,6 +833,11 @@ public class KeyguardIndicationController {
|
|||||||
} else {
|
} else {
|
||||||
showTransientIndication(R.string.keyguard_try_fingerprint);
|
showTransientIndication(R.string.keyguard_try_fingerprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Although we suppress face auth errors visually, we still announce them for a11y
|
||||||
|
if (!TextUtils.isEmpty(a11yString)) {
|
||||||
|
mLockScreenIndicationView.announceForAccessibility(a11yString);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||||
@@ -913,7 +918,7 @@ public class KeyguardIndicationController {
|
|||||||
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
|
} else if (mKeyguardUpdateMonitor.isScreenOn()) {
|
||||||
if (biometricSourceType == BiometricSourceType.FACE
|
if (biometricSourceType == BiometricSourceType.FACE
|
||||||
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
|
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()) {
|
||||||
showTryFingerprintMsg();
|
showTryFingerprintMsg(helpString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showTransientIndication(helpString, false /* isError */, showActionToUnlock);
|
showTransientIndication(helpString, false /* isError */, showActionToUnlock);
|
||||||
@@ -933,7 +938,7 @@ public class KeyguardIndicationController {
|
|||||||
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()
|
&& shouldSuppressFaceMsgAndShowTryFingerprintMsg()
|
||||||
&& !mStatusBarKeyguardViewManager.isBouncerShowing()
|
&& !mStatusBarKeyguardViewManager.isBouncerShowing()
|
||||||
&& mKeyguardUpdateMonitor.isScreenOn()) {
|
&& mKeyguardUpdateMonitor.isScreenOn()) {
|
||||||
showTryFingerprintMsg();
|
showTryFingerprintMsg(errString);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
if (msgId == FaceManager.FACE_ERROR_TIMEOUT) {
|
||||||
@@ -942,7 +947,7 @@ public class KeyguardIndicationController {
|
|||||||
if (!mStatusBarKeyguardViewManager.isBouncerShowing()
|
if (!mStatusBarKeyguardViewManager.isBouncerShowing()
|
||||||
&& mKeyguardUpdateMonitor.isUdfpsEnrolled()
|
&& mKeyguardUpdateMonitor.isUdfpsEnrolled()
|
||||||
&& mKeyguardUpdateMonitor.isFingerprintDetectionRunning()) {
|
&& mKeyguardUpdateMonitor.isFingerprintDetectionRunning()) {
|
||||||
showTryFingerprintMsg();
|
showTryFingerprintMsg(errString);
|
||||||
} else if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
|
} else if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(
|
mStatusBarKeyguardViewManager.showBouncerMessage(
|
||||||
mContext.getResources().getString(R.string.keyguard_unlock_press),
|
mContext.getResources().getString(R.string.keyguard_unlock_press),
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
private static final ComponentName DEVICE_OWNER_COMPONENT = new ComponentName("com.android.foo",
|
private static final ComponentName DEVICE_OWNER_COMPONENT = new ComponentName("com.android.foo",
|
||||||
"bar");
|
"bar");
|
||||||
|
|
||||||
|
private String mKeyguardTryFingerprintMsg;
|
||||||
private String mDisclosureWithOrganization;
|
private String mDisclosureWithOrganization;
|
||||||
private String mDisclosureGeneric;
|
private String mDisclosureGeneric;
|
||||||
private String mFinancedDisclosureWithOrganization;
|
private String mFinancedDisclosureWithOrganization;
|
||||||
@@ -182,6 +183,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
mContext.addMockSystemService(UserManager.class, mUserManager);
|
mContext.addMockSystemService(UserManager.class, mUserManager);
|
||||||
mContext.addMockSystemService(Context.TRUST_SERVICE, mock(TrustManager.class));
|
mContext.addMockSystemService(Context.TRUST_SERVICE, mock(TrustManager.class));
|
||||||
mContext.addMockSystemService(Context.FINGERPRINT_SERVICE, mock(FingerprintManager.class));
|
mContext.addMockSystemService(Context.FINGERPRINT_SERVICE, mock(FingerprintManager.class));
|
||||||
|
mKeyguardTryFingerprintMsg = mContext.getString(R.string.keyguard_try_fingerprint);
|
||||||
mDisclosureWithOrganization = mContext.getString(R.string.do_disclosure_with_name,
|
mDisclosureWithOrganization = mContext.getString(R.string.do_disclosure_with_name,
|
||||||
ORGANIZATION_NAME);
|
ORGANIZATION_NAME);
|
||||||
mDisclosureGeneric = mContext.getString(R.string.do_disclosure_generic);
|
mDisclosureGeneric = mContext.getString(R.string.do_disclosure_generic);
|
||||||
@@ -677,6 +679,34 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
verifyTransientMessage(message);
|
verifyTransientMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void faceAuthMessageSuppressed() {
|
||||||
|
createController();
|
||||||
|
String faceHelpMsg = "Face auth help message";
|
||||||
|
|
||||||
|
// GIVEN state of showing message when keyguard screen is on
|
||||||
|
when(mKeyguardUpdateMonitor.isUnlockingWithBiometricAllowed(anyBoolean())).thenReturn(true);
|
||||||
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
|
when(mKeyguardUpdateMonitor.isScreenOn()).thenReturn(true);
|
||||||
|
|
||||||
|
// GIVEN fingerprint is also running (not udfps)
|
||||||
|
when(mKeyguardUpdateMonitor.isFingerprintDetectionRunning()).thenReturn(true);
|
||||||
|
when(mKeyguardUpdateMonitor.isUdfpsAvailable()).thenReturn(false);
|
||||||
|
|
||||||
|
mController.setVisible(true);
|
||||||
|
|
||||||
|
// WHEN a face help message comes in
|
||||||
|
mController.getKeyguardCallback().onBiometricHelp(
|
||||||
|
KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED, faceHelpMsg,
|
||||||
|
BiometricSourceType.FACE);
|
||||||
|
|
||||||
|
// THEN "try fingerprint" message appears (and not the face help message)
|
||||||
|
verifyTransientMessage(mKeyguardTryFingerprintMsg);
|
||||||
|
|
||||||
|
// THEN the face help message is still announced for a11y
|
||||||
|
verify(mIndicationAreaBottom).announceForAccessibility(eq(faceHelpMsg));
|
||||||
|
}
|
||||||
|
|
||||||
private void sendUpdateDisclosureBroadcast() {
|
private void sendUpdateDisclosureBroadcast() {
|
||||||
mBroadcastReceiver.onReceive(mContext, new Intent());
|
mBroadcastReceiver.onReceive(mContext, new Intent());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user