Fix UI bugs for udfps enroll in settings.
When the finger is down on the screen and the lighting circle on the sensor is shown, the fingerprint icon is not hidden.
- Udfps enroll view needs to get the touch event on sensor.
This CL propagates FingerprintManager#onPointerDown and #onPointer to mEnrollmentCallback, which will finally notifies settings.
However, when AlternateUdfpsTouchProvider is used in UdfpsController, settings doesn't get #onPointerDown and #onPointer. b/263409677 is tracking this.
Test: manually tested on device:
Turn this flag on via adb command
adb shell setprop
sys.fflag.override.settings_show_udfps_enroll_in_settings true
Bug: 260617060
Change-Id: I15581ca1c42cd0213910e50bc81d934ceea354a3
This commit is contained in:
@@ -470,6 +470,16 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
* @param isAcquiredGood whether the fingerprint image was good.
|
||||
*/
|
||||
public void onAcquired(boolean isAcquiredGood){ }
|
||||
|
||||
/**
|
||||
* Called when a pointer down event has occurred.
|
||||
*/
|
||||
public void onPointerDown(int sensorId){ }
|
||||
|
||||
/**
|
||||
* Called when a pointer up event has occurred.
|
||||
*/
|
||||
public void onPointerUp(int sensorId){ }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1398,7 +1408,7 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
if (mAuthenticationCallback != null) {
|
||||
mAuthenticationCallback.onAuthenticationAcquired(acquireInfo);
|
||||
}
|
||||
if (mEnrollmentCallback != null) {
|
||||
if (mEnrollmentCallback != null && acquireInfo != FINGERPRINT_ACQUIRED_START) {
|
||||
mEnrollmentCallback.onAcquired(acquireInfo == FINGERPRINT_ACQUIRED_GOOD);
|
||||
}
|
||||
final String msg = getAcquiredString(mContext, acquireInfo, vendorCode);
|
||||
@@ -1454,17 +1464,24 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
private void sendUdfpsPointerDown(int sensorId) {
|
||||
if (mAuthenticationCallback == null) {
|
||||
Slog.e(TAG, "sendUdfpsPointerDown, callback null");
|
||||
return;
|
||||
} else {
|
||||
mAuthenticationCallback.onUdfpsPointerDown(sensorId);
|
||||
}
|
||||
|
||||
if (mEnrollmentCallback != null) {
|
||||
mEnrollmentCallback.onPointerDown(sensorId);
|
||||
}
|
||||
mAuthenticationCallback.onUdfpsPointerDown(sensorId);
|
||||
}
|
||||
|
||||
private void sendUdfpsPointerUp(int sensorId) {
|
||||
if (mAuthenticationCallback == null) {
|
||||
Slog.e(TAG, "sendUdfpsPointerUp, callback null");
|
||||
return;
|
||||
} else {
|
||||
mAuthenticationCallback.onUdfpsPointerUp(sensorId);
|
||||
}
|
||||
if (mEnrollmentCallback != null) {
|
||||
mEnrollmentCallback.onPointerUp(sensorId);
|
||||
}
|
||||
mAuthenticationCallback.onUdfpsPointerUp(sensorId);
|
||||
}
|
||||
|
||||
private void sendPowerPressed() {
|
||||
|
||||
@@ -230,6 +230,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
|
||||
session.getSession().onPointerDown(pc.pointerId, (int) pc.x, (int) pc.y, pc.minor,
|
||||
pc.major);
|
||||
}
|
||||
|
||||
if (getListener() != null) {
|
||||
getListener().onUdfpsPointerDown(getSensorId());
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Unable to send pointer down", e);
|
||||
}
|
||||
@@ -246,6 +250,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
|
||||
} else {
|
||||
session.getSession().onPointerUp(pc.pointerId);
|
||||
}
|
||||
|
||||
if (getListener() != null) {
|
||||
getListener().onUdfpsPointerUp(getSensorId());
|
||||
}
|
||||
} catch (RemoteException e) {
|
||||
Slog.e(TAG, "Unable to send pointer up", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user