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

Commit 54431099 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Update FingerprintEnrollFindSensor for UDFPS"

parents 119bbbd3 057ce405
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- 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.
-->

<com.google.android.setupdesign.GlifLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/setup_wizard_layout"
    style="?attr/fingerprint_layout_theme"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:clipToPadding="false"
        android:clipChildren="false">

        <LinearLayout
            style="@style/SudContentFrame"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:clipToPadding="false"
            android:clipChildren="false">

            <TextView
                style="@style/SudDescription.Glif"
                android:id="@+id/sud_layout_description"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/sud_description_glif_margin_top"
                android:text="@string/security_settings_udfps_enroll_find_sensor_message"/>
        </LinearLayout>
    </LinearLayout>
</com.google.android.setupdesign.GlifLayout>
+2 −0
Original line number Diff line number Diff line
@@ -926,6 +926,8 @@
    <string name="security_settings_fingerprint_enroll_find_sensor_title">Touch the sensor</string>
    <!-- Message shown in fingerprint enrollment dialog to locate the sensor -->
    <string name="security_settings_fingerprint_enroll_find_sensor_message">It\u2019s on the back of your phone. Use your index finger.</string>
    <!-- Message shown in fingerprint enrollment dialog to locate the sensor [CHAR LIMIT=NONE]-->
    <string name="security_settings_udfps_enroll_find_sensor_message">It\u2019s on the screen. Look for the fingerprint with a glowing circle.</string>
    <!-- Content description of graphic that shows where the fingerprint of the device is [CHAR LIMIT=NONE] -->
    <string name="security_settings_fingerprint_enroll_find_sensor_content_description">Illustration with device and fingerprint sensor location</string>
    <!-- Label text shown in fingerprint dialog for renaming a fingerprint template [CHAR LIMIT=22] -->
+18 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.settings.biometrics.fingerprint;
import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
import android.os.Bundle;
import android.view.View;

@@ -34,6 +35,8 @@ import com.android.settings.password.ChooseLockSettingsHelper;
import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;

import java.util.List;

/**
 * Activity explaining the fingerprint sensor location for fingerprint enrollment.
 */
@@ -44,10 +47,16 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {

    private FingerprintEnrollSidecar mSidecar;
    private boolean mNextClicked;
    private boolean mCanAssumeUdfps;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        final FingerprintManager fingerprintManager = getSystemService(FingerprintManager.class);
        final List<FingerprintSensorPropertiesInternal> props =
                fingerprintManager.getSensorPropertiesInternal();
        mCanAssumeUdfps = props != null && props.size() == 1 && props.get(0).isAnyUdfpsType();
        setContentView(getContentView());
        mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
        mFooterBarMixin.setSecondaryButton(
@@ -84,15 +93,19 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
            throw new IllegalStateException("HAT and GkPwHandle both missing...");
        }

        mAnimation = null;
        if (!mCanAssumeUdfps) {
            View animationView = findViewById(R.id.fingerprint_sensor_location_animation);
            if (animationView instanceof FingerprintFindSensorAnimation) {
                mAnimation = (FingerprintFindSensorAnimation) animationView;
        } else {
            mAnimation = null;
            }
        }
    }

    protected int getContentView() {
        if (mCanAssumeUdfps) {
            return R.layout.udfps_enroll_find_sensor_layout;
        }
        return R.layout.fingerprint_enroll_find_sensor;
    }