Merge "Use different prompt messages for biometric|credential" into sc-dev

This commit is contained in:
Curtis Belmonte
2021-03-11 00:43:38 +00:00
committed by Android (Google) Code Review
3 changed files with 36 additions and 4 deletions

View File

@@ -1532,6 +1532,8 @@
<string name="biometric_dialog_default_title">Verify it\u2019s you</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with a biometric (e.g. fingerprint or face). [CHAR LIMIT=70] -->
<string name="biometric_dialog_default_subtitle">Use your biometric to continue</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with a biometric (e.g. fingerprint or face) or their screen lock credential (i.e. PIN, pattern, or password). [CHAR LIMIT=90] -->
<string name="biometric_or_screen_lock_dialog_default_subtitle">Use your biometric or screen lock to continue</string>
<!-- Message shown when biometric hardware is not available [CHAR LIMIT=50] -->
<string name="biometric_error_hw_unavailable">Biometric hardware unavailable</string>
@@ -1604,6 +1606,8 @@
<string name="fingerprint_or_screen_lock_app_setting_name">Use fingerprint or screen lock</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with their fingerprint. [CHAR LIMIT=70] -->
<string name="fingerprint_dialog_default_subtitle">Use your fingerprint to continue</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with their fingerprint or screen lock credential (i.e. PIN, pattern, or password). [CHAR LIMIT=90] -->
<string name="fingerprint_or_screen_lock_dialog_default_subtitle">Use your fingerprint or screen lock to continue</string>
<!-- Array containing custom error messages from vendor. Vendor is expected to add and translate these strings -->
<string-array name="fingerprint_error_vendor">
@@ -1704,6 +1708,8 @@
<string name="face_or_screen_lock_app_setting_name">Use face or screen lock</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with their face. [CHAR LIMIT=70] -->
<string name="face_dialog_default_subtitle">Use face unlock to continue</string>
<!-- Subtitle shown on the system-provided biometric dialog, asking the user to authenticate with their face or screen lock credential (i.e. PIN, pattern, or password). [CHAR LIMIT=90] -->
<string name="face_or_screen_lock_dialog_default_subtitle">Use your face or screen lock to continue</string>
<!-- Array containing custom error messages from vendor. Vendor is expected to add and translate these strings -->
<string-array name="face_error_vendor">

View File

@@ -2473,6 +2473,7 @@
<java-symbol type="string" name="biometric_or_screen_lock_app_setting_name" />
<java-symbol type="string" name="biometric_dialog_default_title" />
<java-symbol type="string" name="biometric_dialog_default_subtitle" />
<java-symbol type="string" name="biometric_or_screen_lock_dialog_default_subtitle" />
<java-symbol type="string" name="biometric_error_hw_unavailable" />
<java-symbol type="string" name="biometric_error_user_canceled" />
<java-symbol type="string" name="biometric_not_recognized" />
@@ -2504,6 +2505,7 @@
<java-symbol type="string" name="fingerprint_app_setting_name" />
<java-symbol type="string" name="fingerprint_or_screen_lock_app_setting_name" />
<java-symbol type="string" name="fingerprint_dialog_default_subtitle" />
<java-symbol type="string" name="fingerprint_or_screen_lock_dialog_default_subtitle" />
<java-symbol type="string" name="fingerprint_authenticated" />
<java-symbol type="string" name="fingerprint_error_no_fingerprints" />
<java-symbol type="string" name="fingerprint_error_hw_not_present" />
@@ -2553,6 +2555,7 @@
<java-symbol type="string" name="face_app_setting_name" />
<java-symbol type="string" name="face_or_screen_lock_app_setting_name" />
<java-symbol type="string" name="face_dialog_default_subtitle" />
<java-symbol type="string" name="face_or_screen_lock_dialog_default_subtitle" />
<java-symbol type="string" name="face_authenticated_no_confirmation_required" />
<java-symbol type="string" name="face_authenticated_confirmation_required" />
<java-symbol type="string" name="face_error_security_update_required" />

View File

@@ -406,26 +406,49 @@ public class AuthService extends SystemService {
mBiometricService.getCurrentModality(
opPackageName, userId, callingUserId, authenticators);
final boolean isCredentialAllowed = Utils.isCredentialRequested(authenticators);
final String result;
switch (getCredentialBackupModality(modality)) {
case BiometricAuthenticator.TYPE_NONE:
result = null;
break;
case BiometricAuthenticator.TYPE_CREDENTIAL:
result = getContext().getString(
R.string.screen_lock_dialog_default_subtitle);
break;
case BiometricAuthenticator.TYPE_FINGERPRINT:
result = getContext().getString(
R.string.fingerprint_dialog_default_subtitle);
if (isCredentialAllowed) {
result = getContext().getString(
R.string.fingerprint_or_screen_lock_dialog_default_subtitle);
} else {
result = getContext().getString(
R.string.fingerprint_dialog_default_subtitle);
}
break;
case BiometricAuthenticator.TYPE_FACE:
result = getContext().getString(R.string.face_dialog_default_subtitle);
if (isCredentialAllowed) {
result = getContext().getString(
R.string.face_or_screen_lock_dialog_default_subtitle);
} else {
result = getContext().getString(R.string.face_dialog_default_subtitle);
}
break;
default:
result = getContext().getString(R.string.biometric_dialog_default_subtitle);
if (isCredentialAllowed) {
result = getContext().getString(
R.string.biometric_or_screen_lock_dialog_default_subtitle);
} else {
result = getContext().getString(
R.string.biometric_dialog_default_subtitle);
}
break;
}
return result;
} finally {
Binder.restoreCallingIdentity(identity);