Add a flag for moving UdfpsEnroll* from SystemUI to settings.

The added files in this CL are mostly copied from SystemUI. Enabling the flag SETTINGS_SHOW_UDFPS_ENROLL_IN_SETTINGS with this CL, the udfps enrollment icons and progress bar are shown in settings.

Turn this flag on via adb:
adb shell setprop sys.fflag.override.settings_show_udfps_enroll_in_settings true

There are some known issues that will be fixed in the following CLs, including:
- When the finger is down on the screen and the lighting circle on the sensor is shown, the fingerprint icon is not hidden.
- When rotating the screen, fingerprint location is not right.
- Currently the scale factor is hard coded for pixel 7 pro, we should update the scale factor based on the device, etc.

Test: manually tested on device
Bug: 260617060
Change-Id: I5aede070eb1de9eb3b5e1400d6e51a8523079852
This commit is contained in:
Hao Dong
2022-11-28 17:43:48 +00:00
parent cf9fd9941d
commit af35c7cb9d
19 changed files with 1575 additions and 3 deletions

View File

@@ -40,6 +40,11 @@ public abstract class BiometricEnrollSidecar extends InstrumentedFragment {
void onEnrollmentHelp(int helpMsgId, CharSequence helpString);
void onEnrollmentError(int errMsgId, CharSequence errString);
void onEnrollmentProgressChange(int steps, int remaining);
/**
* Called when a fingerprint image has been acquired.
* @param isAcquiredGood whether the fingerprint image was good.
*/
default void onAcquired(boolean isAcquiredGood) { }
}
private int mEnrollmentSteps = -1;
@@ -100,6 +105,19 @@ public abstract class BiometricEnrollSidecar extends InstrumentedFragment {
}
}
private class QueuedAcquired extends QueuedEvent {
private final boolean isAcquiredGood;
public QueuedAcquired(boolean isAcquiredGood) {
this.isAcquiredGood = isAcquiredGood;
}
@Override
public void send(Listener listener) {
listener.onAcquired(isAcquiredGood);
}
}
private final Runnable mTimeoutRunnable = new Runnable() {
@Override
public void run() {
@@ -189,6 +207,14 @@ public abstract class BiometricEnrollSidecar extends InstrumentedFragment {
mEnrolling = false;
}
protected void onAcquired(boolean isAcquiredGood) {
if (mListener != null) {
mListener.onAcquired(isAcquiredGood);
} else {
mQueuedEvents.add(new QueuedAcquired(isAcquiredGood));
}
}
public void setListener(Listener listener) {
mListener = listener;
if (mListener != null) {