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

Commit 87bb772e authored by Kevin Chyn's avatar Kevin Chyn
Browse files

2/n: Add default implementation for multi-biometric enroll

1) Adds a layout for multi-biometric selection in BiometricEnrollActivity
2) Adds widgets for checkboxes
3) Shows ConfirmLock*/ChooseLock* for multi-biometric devices in
   BiometricEnrollActivity
4) finish()'s when loses foreground
5) Adds default string for ChooseLock* and multi-biometrics, e.g.
   "Set up Password + Biometrics", as well as associated plumbing
   to bring the user back to BiometricEnrollActivity once the
   credential is enrolled
6) When max templates enrolled, checkbox becomes disabled and
   description string is updated

Bug: 162341940
Bug: 152242790
Fixes: 161742393

No effect on existing devices with the following:
Test: adb shell am start -a android.settings.BIOMETRIC_ENROLL
Test: SUW
Test: make -j RunSettingsRoboTests

Exempt-From-Owner-Approval: Biometric-related change
to EncryptionInterstitial

Change-Id: I855460d50228ace24d4ec5fbe330f02ab406cc02
parent eb8c0f14
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -14,13 +14,12 @@
  ~ 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:viewportHeight="24"
        android:tint="?android:attr/colorControlNormal">
    <path
        android:fillColor="#000000"
        android:pathData="M10.25,13c0,0.69-0.56,1.25-1.25,1.25S7.75,13.69,7.75,13S8.31,11.75,9,11.75S10.25,12.31,10.25,13z M15,11.75 c-0.69,0-1.25,0.56-1.25,1.25s0.56,1.25,1.25,1.25s1.25-0.56,1.25-1.25S15.69,11.75,15,11.75z M22,12c0,5.52-4.48,10-10,10 S2,17.52,2,12S6.48,2,12,2S22,6.48,22,12z M20,12c0-0.78-0.12-1.53-0.33-2.24C18.97,9.91,18.25,10,17.5,10 c-3.13,0-5.92-1.44-7.76-3.69c-1.05,2.56-3.14,4.57-5.74,5.55C4.01,11.9,4,11.95,4,12c0,4.41,3.59,8,8,8S20,16.41,20,12z" />
+64 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <!-- Icon -->
    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_alignParentStart="true" />

    <!-- Title -->
    <com.google.android.setupdesign.view.RichTextView
        style="@style/SudDescription.Glif"
        android:id="@+id/title"
        android:paddingHorizontal="8dp"
        android:paddingTop="16dp"
        android:layout_marginBottom="4dp"
        android:gravity="start"
        android:layout_toEndOf="@+id/icon"
        android:layout_toStartOf="@+id/checkbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <!-- Description -->
    <TextView
        android:id="@+id/description"
        android:paddingHorizontal="8dp"
        android:paddingBottom="16dp"
        android:layout_toEndOf="@+id/icon"
        android:layout_toStartOf="@+id/checkbox"
        android:layout_below="@+id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <!-- Check Box -->
    <CheckBox
        android:layout_alignParentEnd="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/checkbox"
        android:layout_centerVertical="true"
        android:checked="true"/>

</RelativeLayout>
 No newline at end of file
+80 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2020 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.
  -->

<com.google.android.setupdesign.GlifLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:BiometricEnrollCheckbox="http://schemas.android.com/apk/res/com.android.settings"
    style="?attr/face_layout_theme"
    app:sucHeaderText="@string/multi_biometric_enroll_title"
    android:id="@+id/setup_wizard_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        style="@style/SudContentFrame"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        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/multi_biometric_enroll_subtitle"/>

        <com.google.android.setupdesign.view.IllustrationVideoView
            android:id="@+id/illustration_normal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/SudContentIllustration"
            app:sudVideo="@raw/face_settings"/>

        <TextView
            style="@style/SudDescription.Glif"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/setup_with"
            android:text="@string/multi_biometric_enroll_setup_with"
            android:gravity="start"/>

        <include layout="@layout/horizontal_divider"/>

        <com.android.settings.biometrics.BiometricEnrollCheckbox
            android:id="@+id/checkbox_face"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            BiometricEnrollCheckbox:title="@string/multi_biometric_enroll_face_unlock_title"
            BiometricEnrollCheckbox:description="@string/multi_biometric_enroll_face_unlock_description"
            BiometricEnrollCheckbox:icon="@drawable/ic_face_24dp"/>

        <include layout="@layout/horizontal_divider"/>

        <com.android.settings.biometrics.BiometricEnrollCheckbox
            android:id="@+id/checkbox_fingerprint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            BiometricEnrollCheckbox:title="@string/multi_biometric_enroll_fingerprint_unlock_title"
            BiometricEnrollCheckbox:description="@string/multi_biometric_enroll_fingerprint_unlock_description"
            BiometricEnrollCheckbox:icon="@drawable/ic_fingerprint_24dp"/>

        <include layout="@layout/horizontal_divider"/>

    </LinearLayout>

</com.google.android.setupdesign.GlifLayout>
+3 −3
Original line number Diff line number Diff line
@@ -16,12 +16,12 @@
  -->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/face_header_description"
    android:id="@+id/biometric_header_description"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:minHeight="56dp"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:text="@string/lock_settings_picker_face_message"
    style="@style/FaceHeaderStyle" />
    android:text="@string/lock_settings_picker_biometric_message"
    style="@style/BiometricHeaderStyle" />
+0 −26
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 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.
-->

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fingerprint_header_description"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:minHeight="56dp"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:text="@string/lock_settings_picker_fingerprint_message"
    style="@style/FingerprintHeaderStyle" />
Loading