Merge "Update FingerprintEnrollFindSensor for UDFPS"
This commit is contained in:
committed by
Android (Google) Code Review
commit
544310993e
48
res/layout/udfps_enroll_find_sensor_layout.xml
Normal file
48
res/layout/udfps_enroll_find_sensor_layout.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?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>
|
@@ -926,6 +926,8 @@
|
|||||||
<string name="security_settings_fingerprint_enroll_find_sensor_title">Touch the sensor</string>
|
<string name="security_settings_fingerprint_enroll_find_sensor_title">Touch the sensor</string>
|
||||||
<!-- Message shown in fingerprint enrollment dialog to locate the sensor -->
|
<!-- 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>
|
<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] -->
|
<!-- 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>
|
<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] -->
|
<!-- Label text shown in fingerprint dialog for renaming a fingerprint template [CHAR LIMIT=22] -->
|
||||||
|
@@ -19,6 +19,7 @@ package com.android.settings.biometrics.fingerprint;
|
|||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.hardware.fingerprint.FingerprintManager;
|
import android.hardware.fingerprint.FingerprintManager;
|
||||||
|
import android.hardware.fingerprint.FingerprintSensorPropertiesInternal;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.View;
|
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.FooterBarMixin;
|
||||||
import com.google.android.setupcompat.template.FooterButton;
|
import com.google.android.setupcompat.template.FooterButton;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity explaining the fingerprint sensor location for fingerprint enrollment.
|
* Activity explaining the fingerprint sensor location for fingerprint enrollment.
|
||||||
*/
|
*/
|
||||||
@@ -44,10 +47,16 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
|
|||||||
|
|
||||||
private FingerprintEnrollSidecar mSidecar;
|
private FingerprintEnrollSidecar mSidecar;
|
||||||
private boolean mNextClicked;
|
private boolean mNextClicked;
|
||||||
|
private boolean mCanAssumeUdfps;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(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());
|
setContentView(getContentView());
|
||||||
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
|
mFooterBarMixin = getLayout().getMixin(FooterBarMixin.class);
|
||||||
mFooterBarMixin.setSecondaryButton(
|
mFooterBarMixin.setSecondaryButton(
|
||||||
@@ -84,15 +93,19 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase {
|
|||||||
throw new IllegalStateException("HAT and GkPwHandle both missing...");
|
throw new IllegalStateException("HAT and GkPwHandle both missing...");
|
||||||
}
|
}
|
||||||
|
|
||||||
View animationView = findViewById(R.id.fingerprint_sensor_location_animation);
|
mAnimation = null;
|
||||||
if (animationView instanceof FingerprintFindSensorAnimation) {
|
if (!mCanAssumeUdfps) {
|
||||||
mAnimation = (FingerprintFindSensorAnimation) animationView;
|
View animationView = findViewById(R.id.fingerprint_sensor_location_animation);
|
||||||
} else {
|
if (animationView instanceof FingerprintFindSensorAnimation) {
|
||||||
mAnimation = null;
|
mAnimation = (FingerprintFindSensorAnimation) animationView;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getContentView() {
|
protected int getContentView() {
|
||||||
|
if (mCanAssumeUdfps) {
|
||||||
|
return R.layout.udfps_enroll_find_sensor_layout;
|
||||||
|
}
|
||||||
return R.layout.fingerprint_enroll_find_sensor;
|
return R.layout.fingerprint_enroll_find_sensor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user