From 08bd7960c3ffd43dbec25795fe3fe8457747c506 Mon Sep 17 00:00:00 2001 From: Hao Dong Date: Wed, 12 Apr 2023 00:03:52 +0000 Subject: [PATCH] Fix biometrics unicorn consent string bug. Test: manual test Bug: 277815321 Change-Id: Id32720807d0c6aec199dcd13449f9333d2c36978 --- res-product/values/strings.xml | 6 ++++++ .../biometrics/face/FaceEnrollIntroduction.java | 4 ++++ .../face/FaceEnrollParentalConsent.java | 15 ++++++++++++++- .../FingerprintEnrollParentalConsent.java | 8 ++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/res-product/values/strings.xml b/res-product/values/strings.xml index 2f01c4725bd..2a58f458036 100644 --- a/res-product/values/strings.xml +++ b/res-product/values/strings.xml @@ -96,6 +96,12 @@ Allow your child to use their face to unlock their device + Allow your child to use their face to unlock their phone or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more. + + Allow your child to use their face to unlock their tablet or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more. + + Allow your child to use their face to unlock their device or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more. + Using your child\u2019s face to unlock their phone may be less secure than a strong pattern or PIN. Using your child\u2019s face to unlock their tablet may be less secure than a strong pattern or PIN. diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java index 3e8c45852d7..efd9753a2a2 100644 --- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java +++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java @@ -592,6 +592,10 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { return data; } + protected boolean isFaceStrong() { + return mIsFaceStrong; + } + private void onFaceStrengthChanged() { // Set up and show the "less secure" info section if necessary. if (!mIsFaceStrong && getResources().getBoolean( diff --git a/src/com/android/settings/biometrics/face/FaceEnrollParentalConsent.java b/src/com/android/settings/biometrics/face/FaceEnrollParentalConsent.java index a3a745d698b..aabbf6f9316 100644 --- a/src/com/android/settings/biometrics/face/FaceEnrollParentalConsent.java +++ b/src/com/android/settings/biometrics/face/FaceEnrollParentalConsent.java @@ -47,13 +47,14 @@ public class FaceEnrollParentalConsent extends FaceEnrollIntroduction { R.string.security_settings_face_enroll_introduction_control_consent_title, R.string.security_settings_face_enroll_introduction_control_consent_message, R.string.security_settings_face_enroll_introduction_consent_message_0, + R.string.security_settings_face_enroll_introduction_consent_message_0_class3, R.string.security_settings_face_enroll_introduction_info_consent_less_secure }; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setDescriptionText(R.string.security_settings_face_enroll_introduction_consent_message_0); + updateDescriptionText(); } @Override @@ -144,4 +145,16 @@ public class FaceEnrollParentalConsent extends FaceEnrollIntroduction { public int getMetricsCategory() { return SettingsEnums.FACE_PARENTAL_CONSENT; } + + @Override + protected void updateDescriptionText() { + super.updateDescriptionText(); + if (isFaceStrong()) { + setDescriptionText(getString( + R.string.security_settings_face_enroll_introduction_consent_message_0_class3)); + } else { + setDescriptionText( + R.string.security_settings_face_enroll_introduction_consent_message_0); + } + } } diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollParentalConsent.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollParentalConsent.java index c33ae175a09..7f4142def5c 100644 --- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollParentalConsent.java +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollParentalConsent.java @@ -131,4 +131,12 @@ public class FingerprintEnrollParentalConsent extends FingerprintEnrollIntroduct public int getMetricsCategory() { return SettingsEnums.FINGERPRINT_PARENTAL_CONSENT; } + + + @Override + protected void updateDescriptionText() { + super.updateDescriptionText(); + setDescriptionText( + R.string.security_settings_fingerprint_enroll_introduction_consent_message); + } }