From 057ce4055e431cc9366f49310251d1d3f3339dec Mon Sep 17 00:00:00 2001 From: Mill Chen Date: Sat, 16 Jan 2021 01:30:14 +0800 Subject: [PATCH] Update FingerprintEnrollFindSensor for UDFPS Since the education page of UDFPS is different from the one for rear fingerprint, it's necessary to create a new education page for UDFPS and update the decription. Bug: 177026524 Test: visual verified Change-Id: I70eb80484cccfbb583c32dbaadbc6c2744b5db60 --- .../udfps_enroll_find_sensor_layout.xml | 48 +++++++++++++++++++ res/values/strings.xml | 2 + .../FingerprintEnrollFindSensor.java | 23 +++++++-- 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 res/layout/udfps_enroll_find_sensor_layout.xml diff --git a/res/layout/udfps_enroll_find_sensor_layout.xml b/res/layout/udfps_enroll_find_sensor_layout.xml new file mode 100644 index 00000000000..259d43fdd92 --- /dev/null +++ b/res/layout/udfps_enroll_find_sensor_layout.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index 43c4c101539..7c1a9a75d00 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -926,6 +926,8 @@ Touch the sensor It\u2019s on the back of your phone. Use your index finger. + + It\u2019s on the screen. Look for the fingerprint with a glowing circle. Illustration with device and fingerprint sensor location diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java index dc0928a1c6f..351c828fdc4 100644 --- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java @@ -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 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..."); } - View animationView = findViewById(R.id.fingerprint_sensor_location_animation); - if (animationView instanceof FingerprintFindSensorAnimation) { - mAnimation = (FingerprintFindSensorAnimation) animationView; - } else { - mAnimation = null; + mAnimation = null; + if (!mCanAssumeUdfps) { + View animationView = findViewById(R.id.fingerprint_sensor_location_animation); + if (animationView instanceof FingerprintFindSensorAnimation) { + mAnimation = (FingerprintFindSensorAnimation) animationView; + } } } protected int getContentView() { + if (mCanAssumeUdfps) { + return R.layout.udfps_enroll_find_sensor_layout; + } return R.layout.fingerprint_enroll_find_sensor; }