Initialize mLastAcquire, and check against it in wasUserDetected

In framework definition, FACE_ACQUIRED_GOOD = 0. We should initialize
mLastAcquire to FACE_ACQUIRED_UNKNOWN (23)

Bug: 187007935
Test: Builds
Change-Id: Ie601d2a9ac77e8b8135f7f3d36f2eb8d1c467d98
This commit is contained in:
Kevin Chyn
2021-05-18 17:08:27 -07:00
parent 4c83e679c9
commit 0c320ca0b6

View File

@@ -68,7 +68,7 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements
private final int[] mKeyguardIgnoreList;
private final int[] mKeyguardIgnoreListVendor;
private int mLastAcquire;
@FaceManager.FaceAcquired private int mLastAcquire = FaceManager.FACE_ACQUIRED_UNKNOWN;
FaceAuthenticationClient(@NonNull Context context,
@NonNull LazyDaemon<ISession> lazyDaemon, @NonNull IBinder token,
@@ -127,7 +127,8 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements
// Do not provide haptic feedback if the user was not detected, and an error (usually
// ERROR_TIMEOUT) is received.
return mLastAcquire != FaceManager.FACE_ACQUIRED_NOT_DETECTED
&& mLastAcquire != FaceManager.FACE_ACQUIRED_SENSOR_DIRTY;
&& mLastAcquire != FaceManager.FACE_ACQUIRED_SENSOR_DIRTY
&& mLastAcquire != FaceManager.FACE_ACQUIRED_UNKNOWN;
}
@Override