Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cef573f2 authored by Curtis Belmonte's avatar Curtis Belmonte
Browse files

Consolidate face enroll intro/consent screens

Updates the UI of the face enroll intro screen based on the latest
mocks, while still allowing strings to be overlaid depending on the
device and/or face auth implementation.

Test: Manually tested face enrollment

Bug: 187207438
Change-Id: I5d912261b1eecfc7a241d6b48d549c4ff253ecdf
parent 16e8c767
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<vector
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?android:attr/colorControlNormal">

    <path
        android:fillColor="#000000"
        android:pathData="M18.75,7C16.26,7 14.19,8.74 13.65,11.065C12.39,10.525 11.22,10.675 10.35,11.05C9.795,8.725 7.725,7 5.25,7C2.355,7 0,9.355 0,12.25C0,15.145 2.355,17.5 5.25,17.5C8.01,17.5 10.245,15.37 10.455,12.67C10.905,12.355 12.09,11.77 13.545,12.7C13.785,15.385 16.005,17.5 18.75,17.5C21.645,17.5 24,15.145 24,12.25C24,9.355 21.645,7 18.75,7ZM5.25,16C3.18,16 1.5,14.32 1.5,12.25C1.5,10.18 3.18,8.5 5.25,8.5C7.32,8.5 9,10.18 9,12.25C9,14.32 7.32,16 5.25,16ZM18.75,16C16.68,16 15,14.32 15,12.25C15,10.18 16.68,8.5 18.75,8.5C20.82,8.5 22.5,10.18 22.5,12.25C22.5,14.32 20.82,16 18.75,16Z" />
</vector>
 No newline at end of file
+80 −41
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2019 The Android Open Source Project
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  ~ limitations under the License.
  -->

<com.google.android.setupdesign.GlifLayout
@@ -31,13 +31,6 @@
        android:clipToPadding="false"
        android:orientation="vertical">

        <com.google.android.setupdesign.view.RichTextView
            android:id="@+id/sud_layout_description"
            style="@style/SudDescription.Glif"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/security_settings_face_enroll_introduction_message"/>

        <com.google.android.setupdesign.view.RichTextView
            android:id="@+id/error_text"
            style="@style/SudDescription.Glif"
@@ -48,7 +41,7 @@
        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginVertical="12dp">
            android:layout_marginBottom="12dp">

            <com.google.android.setupdesign.view.IllustrationVideoView
                android:id="@+id/illustration_normal"
@@ -67,23 +60,35 @@
            android:layout_gravity="center_horizontal|bottom"
            android:paddingTop="12dp">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/security_settings_face_enroll_introduction_info_title"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="20sp"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
                android:orientation="horizontal"
                android:paddingTop="24dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_info_outline_24dp">
                </ImageView>
                    android:background="@drawable/ic_face_enroll_introduction_glasses"/>

                <Space
                    android:layout_width="24dp"
                    android:layout_width="16dp"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/security_settings_face_enroll_introduction_footer_part_0"/>
                    android:text="@string/security_settings_face_enroll_introduction_info_glasses"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="16sp"
                    android:lineSpacingExtra="4sp"/>

            </LinearLayout>

@@ -96,15 +101,19 @@
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_shield">
                </ImageView>
                    android:background="@drawable/ic_face_enroll_introduction_visibility"/>

                <Space
                    android:layout_width="24dp"
                    android:layout_width="16dp"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/security_settings_face_enroll_introduction_footer_part_1"/>
                    android:text="@string/security_settings_face_enroll_introduction_info_looking"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="16sp"
                    android:lineSpacingExtra="4sp"/>

            </LinearLayout>

@@ -117,37 +126,67 @@
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_visibility">
                </ImageView>
                    android:background="@drawable/ic_face_enroll_introduction_shield"/>

                <Space
                    android:layout_width="24dp"
                    android:layout_width="16dp"
                    android:layout_height="wrap_content"/>

                <TextView
                    android:id="@+id/face_enroll_introduction_footer_part_2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"/>
                    android:layout_height="wrap_content"
                    android:text="@string/security_settings_face_enroll_introduction_info_security"
                    android:textColor="?android:attr/textColorPrimary"
                    android:textSize="16sp"
                    android:lineSpacingExtra="4sp"/>

            </LinearLayout>

            <LinearLayout
            <Space
                android:layout_width="match_parent"
                android:layout_height="40dp"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingTop="24dp">
                android:text="@string/security_settings_face_enroll_introduction_how_title"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="20sp"/>

                <ImageView
                    android:layout_width="wrap_content"
            <Space
                android:layout_width="match_parent"
                android:layout_height="24dp"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/security_settings_face_enroll_introduction_how_message"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="14sp"
                android:lineSpacingExtra="2sp"/>

            <Space
                android:layout_width="match_parent"
                android:layout_height="24dp"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                    android:background="@drawable/ic_face_enroll_introduction_people">
                </ImageView>
                android:text="@string/security_settings_face_enroll_introduction_control_title"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="20sp"/>

            <Space
                    android:layout_width="24dp"
                    android:layout_height="wrap_content"/>
                android:layout_width="match_parent"
                android:layout_height="24dp"/>

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                    android:text="@string/security_settings_face_enroll_introduction_footer_part_3"/>
            </LinearLayout>
                android:text="@string/security_settings_face_enroll_introduction_control_message"
                android:textColor="?android:attr/textColorPrimary"
                android:textSize="14sp"
                android:lineSpacingExtra="2sp"/>

        </LinearLayout>

+0 −5
Original line number Diff line number Diff line
@@ -269,11 +269,6 @@
    <!-- ComponentName to launch a vendor-specific enrollment activity if available -->
    <string name="config_face_enroll" translatable="false"></string>

    <!-- Fully qualified name of the introductory activity for face enrollment. -->
    <string name="config_face_enroll_introduction" translatable="false">
        com.android.settings.biometrics.face.FaceEnrollIntroduction
    </string>

    <!-- App intent -->
    <string name="config_account_intent_uri" translatable="false"></string>

+17 −9
Original line number Diff line number Diff line
@@ -777,7 +777,7 @@
    <!-- Button text to cancel enrollment [CHAR LIMIT=30] -->
    <string name="security_settings_face_enroll_introduction_no_thanks">No thanks</string>
    <!-- Button text to start enrollment [CHAR LIMIT=30] -->
    <string name="security_settings_face_enroll_introduction_agree">Agree</string>
    <string name="security_settings_face_enroll_introduction_agree">I agree</string>
    <!-- Button text to scroll to the end of a scrollview. [CHAR LIMIT=30] -->
    <string name="security_settings_face_enroll_introduction_more">More</string>
    <!-- Introduction title shown in face enrollment to introduce the face unlock feature [CHAR LIMIT=40] -->
@@ -790,14 +790,22 @@
    <string name="security_settings_face_enroll_introduction_message_unlock_disabled">Use your face to unlock your phone or approve purchases.\n\nNote: You can\u2019t use your face to unlock this device. For more information, contact your organization\u2019s admin.</string>
    <!-- Introduction detail message shown in face enrollment screen in setup wizard. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_message_setup">Use your face to unlock your phone, authorize purchases, or sign in to apps</string>
    <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_footer_part_0"></string>
    <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_footer_part_1"></string>
    <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_footer_part_2"></string>
    <!-- Introduction message shown in face enrollment that provides extra detail. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_footer_part_3"></string>
    <!-- Title of a section on the face enrollment introduction page that provides additional information. [CHAR LIMIT=40] -->
    <string name="security_settings_face_enroll_introduction_info_title"></string>
    <!-- Message on the face enrollment introduction page that provides information about glasses. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_info_glasses"></string>
    <!-- Message on the face enrollment introduction page that provides information about what could cause the phone to unlock. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_info_looking"></string>
    <!-- Message on the face enrollment introduction page that provides information about the security of face unlock. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_info_security"></string>
    <!-- Title of a section on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=40] -->
    <string name="security_settings_face_enroll_introduction_how_title"></string>
    <!-- Message on the face enrollment introduction page that explains how face unlock works. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_how_message"></string>
    <!-- Title of a section on the face enrollment introduction page that explains privacy controls for face unlock. [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_control_title"></string>
    <!-- Message on the face enrollment introduction page that explains privacy controls for face unlock [CHAR LIMIT=NONE] -->
    <string name="security_settings_face_enroll_introduction_control_message"></string>
    <!-- Title shown in face enrollment dialog [CHAR LIMIT=40] -->
    <string name="security_settings_face_enroll_repeat_title">Center your face in the circle</string>
    <!-- Button text to skip enrollment of face [CHAR LIMIT=40] -->
+2 −6
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package com.android.settings.biometrics;

import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;

import android.app.Activity;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
@@ -34,8 +32,8 @@ import androidx.fragment.app.FragmentActivity;

import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.VerifyCredentialResponse;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.biometrics.face.FaceEnrollIntroduction;
import com.android.settings.biometrics.fingerprint.FingerprintEnrollFindSensor;
import com.android.settings.biometrics.fingerprint.FingerprintEnrollIntroduction;
import com.android.settings.biometrics.fingerprint.SetupFingerprintEnrollIntroduction;
@@ -173,9 +171,7 @@ public class BiometricUtils {
     */
    public static Intent getFaceIntroIntent(@NonNull Context context,
            @NonNull Intent activityIntent) {
        final String className = context.getString(R.string.config_face_enroll_introduction);
        Intent intent = new Intent();
        intent.setClassName(SETTINGS_PACKAGE_NAME, className);
        final Intent intent = new Intent(context, FaceEnrollIntroduction.class);
        WizardManagerHelper.copyWizardManagerExtras(activityIntent, intent);
        return intent;
    }
Loading