Merge "Add a default string for failures." into sc-qpr1-dev am: 7d26092122

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15671476

Change-Id: I00b3c562eb7ac39d4b7c0a3fe5e16abe088235fd
This commit is contained in:
Joe Bolinger
2021-09-01 22:23:05 +00:00
committed by Automerger Merge Worker
4 changed files with 10 additions and 4 deletions

View File

@@ -794,9 +794,9 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
// This is used as a last resort in case a vendor string is missing
// It should not happen for anything other than FACE_ERROR_VENDOR, but
// warn and use the default if all else fails.
// TODO(b/196639965): update string
Slog.w(TAG, "Invalid error message: " + errMsg + ", " + vendorCode);
return "";
return context.getString(
com.android.internal.R.string.face_error_vendor_unknown);
}
/**

View File

@@ -1390,9 +1390,9 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
// This is used as a last resort in case a vendor string is missing
// It should not happen for anything other than FINGERPRINT_ERROR_VENDOR, but
// warn and use the default if all else fails.
// TODO(b/196639965): update string
Slog.w(TAG, "Invalid error message: " + errMsg + ", " + vendorCode);
return "";
return context.getString(
com.android.internal.R.string.fingerprint_error_vendor_unknown);
}
/**

View File

@@ -1650,6 +1650,8 @@
<!-- Array containing custom error messages from vendor. Vendor is expected to add and translate these strings -->
<string-array name="fingerprint_error_vendor">
</string-array>
<!-- Default error message to use when fingerprint_error_vendor does not contain a message. [CHAR LIMIT=NONE] -->
<string name="fingerprint_error_vendor_unknown">Something went wrong. Try again.</string>
<!-- Content description which should be used for the fingerprint icon. -->
<string name="fingerprint_icon_content_description">Fingerprint icon</string>
@@ -1760,6 +1762,8 @@
<!-- Array containing custom error messages from vendor. Vendor is expected to add and translate these strings -->
<string-array name="face_error_vendor">
</string-array>
<!-- Default error message to use when face_error_vendor does not contain a message. [CHAR LIMIT=NONE] -->
<string name="face_error_vendor_unknown">Something went wrong. Try again.</string>
<!-- Content description which should be used for the face icon. [CHAR LIMIT=10] -->
<string name="face_icon_content_description">Face icon</string>

View File

@@ -2525,6 +2525,7 @@
<java-symbol type="string" name="fingerprint_error_no_space" />
<java-symbol type="string" name="fingerprint_error_timeout" />
<java-symbol type="array" name="fingerprint_error_vendor" />
<java-symbol type="string" name="fingerprint_error_vendor_unknown" />
<java-symbol type="string" name="fingerprint_acquired_partial" />
<java-symbol type="string" name="fingerprint_acquired_insufficient" />
<java-symbol type="string" name="fingerprint_acquired_imager_dirty" />
@@ -2564,6 +2565,7 @@
<java-symbol type="string" name="face_error_no_space" />
<java-symbol type="string" name="face_error_timeout" />
<java-symbol type="array" name="face_error_vendor" />
<java-symbol type="string" name="face_error_vendor_unknown" />
<java-symbol type="string" name="face_error_canceled" />
<java-symbol type="string" name="face_error_user_canceled" />
<java-symbol type="string" name="face_error_lockout" />