From 087ac777a89b1f9271a0842b4837c6cd0e450013 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Fri, 6 Dec 2024 05:44:14 +0000 Subject: [PATCH] [Biometric Onboarding & Edu] Update Set up Fingerprint/Face Unlock page Update icons, strings and layouts for new UX design Bug: 370940762 Test: manual: Pre condition - no fingerprint/face enrolled For FP: Go Settings>Security & privacy>Device unlock>Fingerprint unlock For Face: Go Settings>Security & privacy>Device unlock>Face unlock Test: atest FaceEnrollIntroductionTest Flag: com.android.settings.flags.biometrics_onboarding_education Change-Id: Iaee6792d1a27be8fa4b443f783a47a3715b6d3a1 --- res-product/values/strings.xml | 38 ++ res/drawable/ic_eyeglasses.xml | 26 ++ res/drawable/ic_familiar_face_and_zone.xml | 26 ++ res/drawable/ic_privacy_tip.xml | 10 + res/drawable/ic_security_privacy_safe.xml | 10 + res/layout/face_enroll_introduction_2.xml | 334 ++++++++++++++++++ res/values/strings.xml | 6 + .../BiometricEnrollIntroduction.java | 6 +- .../face/FaceEnrollIntroduction.java | 45 ++- .../face/FaceEnrollIntroductionTest.java | 5 +- 10 files changed, 498 insertions(+), 8 deletions(-) create mode 100644 res/drawable/ic_eyeglasses.xml create mode 100644 res/drawable/ic_familiar_face_and_zone.xml create mode 100644 res/drawable/ic_privacy_tip.xml create mode 100644 res/drawable/ic_security_privacy_safe.xml create mode 100644 res/layout/face_enroll_introduction_2.xml diff --git a/res-product/values/strings.xml b/res-product/values/strings.xml index d5ef1c888f6..32e545bd7c2 100644 --- a/res-product/values/strings.xml +++ b/res-product/values/strings.xml @@ -89,6 +89,12 @@ Use your face to unlock your tablet or for authentication in apps, like when you sign in to apps or approve a purchase Use your face to unlock your device or for authentication in apps, like when you sign in to apps or approve a purchase + + + + + + Allow your child to use their face to unlock their phone @@ -107,6 +113,18 @@ Using your child\u2019s face to unlock their tablet may be less secure than a strong pattern or PIN. Using your child\u2019s face to unlock their device may be less secure than a strong pattern or PIN. + + + + + + + + + + + + @@ -161,6 +179,12 @@ + + + + + + @@ -193,6 +217,8 @@ Use your face to unlock your device or verify it\u2019s you, like when you sign in to apps or approve a purchase.\n\nKeep in mind:\nYou can only have one face set up at a time. To add another face, delete the current one.\n\nLooking at the device can unlock it when you don\u2019t intend to.\n\nYour device can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour device can be unlocked by someone who looks a lot like you, like an identical sibling. Use your fingerprint to unlock your %s or verify it\u2019s you, like when you sign in to apps or approve a purchase + + Use your fingerprints to unlock your %s or verify it\u2019s you in apps Allow your child to use their fingerprint to unlock their phone or verify it\u2019s them. This happens when they sign in to apps, approve a purchase, and more. @@ -241,6 +267,18 @@ Your child\u2019s tablet can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger. Your child\u2019s device can be unlocked when they don\u2019t intend to, like if someone holds it up to their finger. + + + + + + + + + + + + Use your fingerprint to unlock your tablet or verify it\u2019s you, like when you sign in to apps diff --git a/res/drawable/ic_eyeglasses.xml b/res/drawable/ic_eyeglasses.xml new file mode 100644 index 00000000000..c35d7b30529 --- /dev/null +++ b/res/drawable/ic_eyeglasses.xml @@ -0,0 +1,26 @@ + + + + + diff --git a/res/drawable/ic_familiar_face_and_zone.xml b/res/drawable/ic_familiar_face_and_zone.xml new file mode 100644 index 00000000000..dbef199e896 --- /dev/null +++ b/res/drawable/ic_familiar_face_and_zone.xml @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/res/drawable/ic_privacy_tip.xml b/res/drawable/ic_privacy_tip.xml new file mode 100644 index 00000000000..8f34eb65f22 --- /dev/null +++ b/res/drawable/ic_privacy_tip.xml @@ -0,0 +1,10 @@ + + + diff --git a/res/drawable/ic_security_privacy_safe.xml b/res/drawable/ic_security_privacy_safe.xml new file mode 100644 index 00000000000..99aeaef2496 --- /dev/null +++ b/res/drawable/ic_security_privacy_safe.xml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/res/layout/face_enroll_introduction_2.xml b/res/layout/face_enroll_introduction_2.xml new file mode 100644 index 00000000000..cbc14bce15b --- /dev/null +++ b/res/layout/face_enroll_introduction_2.xml @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values/strings.xml b/res/values/strings.xml index 18b20b9e6c1..9f4672b4b75 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -771,6 +771,8 @@ + + Cancel @@ -898,6 +900,8 @@ You and your child are in control Keep in mind + + Secure and helpful Use your fingerprint to unlock your phone or approve purchases.\n\nNote: You can\u2019t use your fingerprint to unlock this device. For more information, contact your organization\u2019s admin. @@ -928,6 +932,8 @@ For best results, use a screen protector that\u2019s Made for Google certified. With other screen protectors, your child\u2019s fingerprint may not work. + + diff --git a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java index 1f7b3e512b2..77f11ff6f0f 100644 --- a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java +++ b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java @@ -37,6 +37,7 @@ import com.android.internal.widget.LockPatternUtils; import com.android.settings.R; import com.android.settings.SetupWizardUtils; import com.android.settings.Utils; +import com.android.settings.flags.Flags; import com.android.settings.password.ChooseLockGeneric; import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.ConfirmDeviceCredentialActivity; @@ -551,8 +552,11 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase @NonNull protected PorterDuffColorFilter getIconColorFilter() { if (mIconColorFilter == null) { + final int colorType = Flags.biometricsOnboardingEducation() + ? DynamicColorPalette.ColorType.PRIMARY_TEXT + : DynamicColorPalette.ColorType.ACCENT; mIconColorFilter = new PorterDuffColorFilter( - DynamicColorPalette.getColor(this, DynamicColorPalette.ColorType.ACCENT), + DynamicColorPalette.getColor(this, colorType), PorterDuff.Mode.SRC_IN); } return mIconColorFilter; diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java index d3f75195305..78e3770810a 100644 --- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java +++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java @@ -53,6 +53,7 @@ import com.android.settings.biometrics.BiometricEnrollActivity; import com.android.settings.biometrics.BiometricEnrollIntroduction; import com.android.settings.biometrics.BiometricUtils; import com.android.settings.biometrics.MultiBiometricEnrollHelper; +import com.android.settings.flags.Flags; import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.SetupSkipDialog; import com.android.settings.utils.SensorPrivacyManagerHelper; @@ -144,6 +145,19 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { final ImageView iconLooking = findViewById(R.id.icon_looking); iconGlasses.getBackground().setColorFilter(getIconColorFilter()); iconLooking.getBackground().setColorFilter(getIconColorFilter()); + if (Flags.biometricsOnboardingEducation()) { + final ImageView iconSecurityPrivacySafe = findViewById(R.id.icon_security_privacy_safe); + final ImageView iconPrivacyTip = findViewById(R.id.icon_privacy_tip); + final ImageView iconFamiliarFaceAndZone = + findViewById(R.id.icon_familiar_face_and_zone); + final ImageView iconTrashCan = findViewById(R.id.icon_trash_can); + final ImageView iconLink = findViewById(R.id.icon_link); + iconSecurityPrivacySafe.getBackground().setColorFilter(getIconColorFilter()); + iconPrivacyTip.getBackground().setColorFilter(getIconColorFilter()); + iconFamiliarFaceAndZone.getBackground().setColorFilter(getIconColorFilter()); + iconTrashCan.getBackground().setColorFilter(getIconColorFilter()); + iconLink.getBackground().setColorFilter(getIconColorFilter()); + } // Set text for views with multiple variations. final TextView infoMessageGlasses = findViewById(R.id.info_message_glasses); @@ -156,9 +170,19 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { infoMessageLooking.setText(getInfoMessageLooking()); inControlTitle.setText(getInControlTitle()); howMessage.setText(getHowMessage()); - inControlMessage.setText(Html.fromHtml(getString(getInControlMessage()), - Html.FROM_HTML_MODE_LEGACY)); - inControlMessage.setMovementMethod(LinkMovementMethod.getInstance()); + if (Flags.biometricsOnboardingEducation()) { + inControlMessage.setText( + R.string.security_settings_face_enroll_introduction_control_message_2); + final TextView learnMore = findViewById(R.id.message_learn_more); + learnMore.setText(Html.fromHtml(getString( + R.string.security_settings_face_enroll_introduction_learn_more_message), + Html.FROM_HTML_MODE_LEGACY)); + learnMore.setMovementMethod(LinkMovementMethod.getInstance()); + } else { + inControlMessage.setText(Html.fromHtml(getString(getInControlMessage()), + Html.FROM_HTML_MODE_LEGACY)); + inControlMessage.setMovementMethod(LinkMovementMethod.getInstance()); + } lessSecure.setText(getLessSecureMessage()); final ScrollView scrollView = @@ -411,7 +435,11 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { @Override protected int getLayoutResource() { - return R.layout.face_enroll_introduction; + if (Flags.biometricsOnboardingEducation()) { + return R.layout.face_enroll_introduction_2; + } else { + return R.layout.face_enroll_introduction; + } } @Override @@ -594,8 +622,13 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction { setDescriptionText(getString( R.string.private_space_face_enroll_introduction_message)); } else if (mIsFaceStrong) { - setDescriptionText(getString( - R.string.security_settings_face_enroll_introduction_message_class3)); + final int messageRes; + if (Flags.biometricsOnboardingEducation()) { + messageRes = R.string.security_settings_face_enroll_introduction_message_class3_2; + } else { + messageRes = R.string.security_settings_face_enroll_introduction_message_class3; + } + setDescriptionText(getString(messageRes)); } super.updateDescriptionText(); } diff --git a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java index 81a72694592..3bfe8197b1f 100644 --- a/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java +++ b/tests/robotests/src/com/android/settings/biometrics/face/FaceEnrollIntroductionTest.java @@ -64,6 +64,7 @@ import com.android.settings.R; import com.android.settings.Settings; import com.android.settings.biometrics.BiometricEnrollBase; import com.android.settings.biometrics.BiometricUtils; +import com.android.settings.flags.Flags; import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.testutils.FakeFeatureFactory; import com.android.settings.testutils.shadow.SettingsShadowResources; @@ -402,7 +403,9 @@ public class FaceEnrollIntroductionTest { assertThat(getGlifLayout(mActivity).getDescriptionText().toString()).isEqualTo( mContext.getString( - R.string.security_settings_face_enroll_introduction_message_class3)); + Flags.biometricsOnboardingEducation() + ? R.string.security_settings_face_enroll_introduction_message_class3_2 + : R.string.security_settings_face_enroll_introduction_message_class3)); assertThat(mActivity.findViewById(R.id.info_row_less_secure).getVisibility()).isEqualTo( View.GONE); }