From ae7f264fa2904cfc75ac8d68adc96dd373de4d25 Mon Sep 17 00:00:00 2001 From: Tsung-Mao Fang Date: Mon, 16 Nov 2020 18:34:21 +0800 Subject: [PATCH] Apply top intro preference for face settings page Do a few things in this cl - Use correct way to work with controller. - Refactor xml file. - Separate content of footer to two parts. - First paragraph should become top intro. - Rest should keep in footer. Test: Build apk and see the screen Bug: 173087905 Change-Id: Icb16dedf6b36542b833527471579aaadb5407d87 Screenshot: https://screenshot.googleplex.com/92Jx6zKyTZU8LJa.png --- res/values/strings.xml | 6 ++-- res/xml/security_settings_face.xml | 29 +++++++++++-------- .../biometrics/face/FaceSettings.java | 1 - ...aceSettingsFooterPreferenceController.java | 7 +---- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 5691b3a05c9..2989d8abd22 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -844,9 +844,11 @@ Set up face unlock - Use face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling. + Use face unlock to unlock your device, sign in to apps, and confirm payments. + + Keep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling. - Use face unlock to unlock your device, sign in to apps, and confirm payments.\n\nKeep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling. + Keep in mind:\nLooking at the phone can unlock it when you don\u2019t intend to.\n\nYour phone can be unlocked by someone else if it\u2019s held up to your face, even if your eyes are closed.\n\nYour phone can be unlocked by someone who looks a lot like you, say, an identical sibling. Delete face data? diff --git a/res/xml/security_settings_face.xml b/res/xml/security_settings_face.xml index d450fef4dee..1fc1ca82de5 100644 --- a/res/xml/security_settings_face.xml +++ b/res/xml/security_settings_face.xml @@ -16,15 +16,18 @@ + settings:animation="@raw/face_settings" + settings:controller="com.android.settings.widget.VideoPreferenceController"/> + + + settings:keywords="@string/keywords_face_unlock" + settings:controller="com.android.settings.biometrics.face.FaceSettingsKeyguardPreferenceController"/> + settings:keywords="@string/keywords_face_unlock" + settings:controller="com.android.settings.biometrics.face.FaceSettingsAppPreferenceController"/> + settings:keywords="@string/keywords_face_unlock" + settings:controller="com.android.settings.biometrics.face.FaceSettingsAttentionPreferenceController"/> + settings:keywords="@string/keywords_face_unlock" + settings:controller="com.android.settings.biometrics.face.FaceSettingsConfirmPreferenceController"/> + android:key="security_face_footer" + settings:allowDividerAbove="true" + settings:controller="com.android.settings.biometrics.face.FaceSettingsFooterPreferenceController" /> diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java index 5c8447fd749..775148532f2 100644 --- a/src/com/android/settings/biometrics/face/FaceSettings.java +++ b/src/com/android/settings/biometrics/face/FaceSettings.java @@ -312,7 +312,6 @@ public class FaceSettings extends DashboardFragment { controllers.add(new FaceSettingsAppPreferenceController(context)); controllers.add(new FaceSettingsAttentionPreferenceController(context)); controllers.add(new FaceSettingsRemoveButtonPreferenceController(context)); - controllers.add(new FaceSettingsFooterPreferenceController(context)); controllers.add(new FaceSettingsConfirmPreferenceController(context)); controllers.add(new FaceSettingsEnrollButtonPreferenceController(context)); return controllers; diff --git a/src/com/android/settings/biometrics/face/FaceSettingsFooterPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsFooterPreferenceController.java index c66546790ea..ba1047b0d4d 100644 --- a/src/com/android/settings/biometrics/face/FaceSettingsFooterPreferenceController.java +++ b/src/com/android/settings/biometrics/face/FaceSettingsFooterPreferenceController.java @@ -26,7 +26,6 @@ import com.android.settings.core.BasePreferenceController; import com.android.settings.overlay.FeatureFactory; import com.android.settings.utils.AnnotationSpan; import com.android.settingslib.HelpUtils; -import com.android.settingslib.widget.FooterPreference; /** * Footer for face settings showing the help text and help link. @@ -42,13 +41,9 @@ public class FaceSettingsFooterPreferenceController extends BasePreferenceContro mProvider = FeatureFactory.getFactory(context).getFaceFeatureProvider(); } - public FaceSettingsFooterPreferenceController(Context context) { - this(context, FooterPreference.KEY_FOOTER); - } - @Override public int getAvailabilityStatus() { - return AVAILABLE; + return AVAILABLE_UNSEARCHABLE; } @Override