Merge changes from topic "facemanager-bypassflag" into sc-dev am: 88a506aad4 am: e26e9b4773
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377220 Change-Id: Ie89fe9811e6f24a9e0944c1ebc04b737152e025c
This commit is contained in:
@@ -168,31 +168,6 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
|
|||||||
mHandler = new MyHandler(context);
|
mHandler = new MyHandler(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Request authentication of a crypto object. This call operates the face recognition hardware
|
|
||||||
* and starts capturing images. It terminates when
|
|
||||||
* {@link AuthenticationCallback#onAuthenticationError(int, CharSequence)} or
|
|
||||||
* {@link AuthenticationCallback#onAuthenticationSucceeded(AuthenticationResult)} is called, at
|
|
||||||
* which point the object is no longer valid. The operation can be canceled by using the
|
|
||||||
* provided cancel object.
|
|
||||||
*
|
|
||||||
* @param crypto object associated with the call or null if none required.
|
|
||||||
* @param cancel an object that can be used to cancel authentication
|
|
||||||
* @param callback an object to receive authentication events
|
|
||||||
* @param handler an optional handler to handle callback events
|
|
||||||
* @throws IllegalArgumentException if the crypto operation is not supported or is not backed
|
|
||||||
* by
|
|
||||||
* <a href="{@docRoot}training/articles/keystore.html">Android
|
|
||||||
* Keystore facility</a>.
|
|
||||||
* @throws IllegalStateException if the crypto primitive is not initialized.
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
|
||||||
public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel,
|
|
||||||
@NonNull AuthenticationCallback callback, @Nullable Handler handler) {
|
|
||||||
authenticate(crypto, cancel, callback, handler, mContext.getUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the provided handler thread for events.
|
* Use the provided handler thread for events.
|
||||||
*/
|
*/
|
||||||
@@ -224,8 +199,10 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
|
|||||||
* @throws IllegalStateException if the crypto primitive is not initialized.
|
* @throws IllegalStateException if the crypto primitive is not initialized.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
@RequiresPermission(USE_BIOMETRIC_INTERNAL)
|
||||||
public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel,
|
public void authenticate(@Nullable CryptoObject crypto, @Nullable CancellationSignal cancel,
|
||||||
@NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId) {
|
@NonNull AuthenticationCallback callback, @Nullable Handler handler, int userId,
|
||||||
|
boolean isKeyguardBypassEnabled) {
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
throw new IllegalArgumentException("Must supply an authentication callback");
|
throw new IllegalArgumentException("Must supply an authentication callback");
|
||||||
}
|
}
|
||||||
@@ -247,7 +224,7 @@ public class FaceManager implements BiometricAuthenticator, BiometricFaceConstan
|
|||||||
final long operationId = crypto != null ? crypto.getOpId() : 0;
|
final long operationId = crypto != null ? crypto.getOpId() : 0;
|
||||||
Trace.beginSection("FaceManager#authenticate");
|
Trace.beginSection("FaceManager#authenticate");
|
||||||
mService.authenticate(mToken, operationId, userId, mServiceReceiver,
|
mService.authenticate(mToken, operationId, userId, mServiceReceiver,
|
||||||
mContext.getOpPackageName());
|
mContext.getOpPackageName(), isKeyguardBypassEnabled);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Slog.w(TAG, "Remote exception while authenticating: ", e);
|
Slog.w(TAG, "Remote exception while authenticating: ", e);
|
||||||
if (callback != null) {
|
if (callback != null) {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ interface IFaceService {
|
|||||||
|
|
||||||
// Authenticate the given sessionId with a face
|
// Authenticate the given sessionId with a face
|
||||||
void authenticate(IBinder token, long operationId, int userId, IFaceServiceReceiver receiver,
|
void authenticate(IBinder token, long operationId, int userId, IFaceServiceReceiver receiver,
|
||||||
String opPackageName);
|
String opPackageName, boolean isKeyguardBypassEnabled);
|
||||||
|
|
||||||
// Uses the face hardware to detect for the presence of a face, without giving details
|
// Uses the face hardware to detect for the presence of a face, without giving details
|
||||||
// about accept/reject/lockout.
|
// about accept/reject/lockout.
|
||||||
|
|||||||
@@ -2407,8 +2407,10 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
if (isEncryptedOrLockdown(userId) && supportsFaceDetection) {
|
if (isEncryptedOrLockdown(userId) && supportsFaceDetection) {
|
||||||
mFaceManager.detectFace(mFaceCancelSignal, mFaceDetectionCallback, userId);
|
mFaceManager.detectFace(mFaceCancelSignal, mFaceDetectionCallback, userId);
|
||||||
} else {
|
} else {
|
||||||
|
final boolean isBypassEnabled = mKeyguardBypassController != null
|
||||||
|
&& mKeyguardBypassController.isBypassEnabled();
|
||||||
mFaceManager.authenticate(null /* crypto */, mFaceCancelSignal,
|
mFaceManager.authenticate(null /* crypto */, mFaceCancelSignal,
|
||||||
mFaceAuthenticationCallback, null /* handler */, userId);
|
mFaceAuthenticationCallback, null /* handler */, userId, isBypassEnabled);
|
||||||
}
|
}
|
||||||
setFaceRunningState(BIOMETRIC_STATE_RUNNING);
|
setFaceRunningState(BIOMETRIC_STATE_RUNNING);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
public void testTriesToAuthenticate_whenBouncer() {
|
public void testTriesToAuthenticate_whenBouncer() {
|
||||||
setKeyguardBouncerVisibility(true);
|
setKeyguardBouncerVisibility(true);
|
||||||
|
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
verify(mFaceManager).isHardwareDetected();
|
verify(mFaceManager).isHardwareDetected();
|
||||||
verify(mFaceManager).hasEnrolledTemplates(anyInt());
|
verify(mFaceManager).hasEnrolledTemplates(anyInt());
|
||||||
}
|
}
|
||||||
@@ -523,7 +523,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -533,7 +533,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -545,7 +546,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -568,13 +570,14 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
mKeyguardUpdateMonitor.dispatchStartedWakingUp();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
|
|
||||||
// Stop scanning when bouncer becomes visible
|
// Stop scanning when bouncer becomes visible
|
||||||
setKeyguardBouncerVisibility(true);
|
setKeyguardBouncerVisibility(true);
|
||||||
clearInvocations(mFaceManager);
|
clearInvocations(mFaceManager);
|
||||||
mKeyguardUpdateMonitor.requestFaceAuth(true);
|
mKeyguardUpdateMonitor.requestFaceAuth(true);
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -582,7 +585,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.setKeyguardOccluded(true);
|
mKeyguardUpdateMonitor.setKeyguardOccluded(true);
|
||||||
mKeyguardUpdateMonitor.setAssistantVisible(true);
|
mKeyguardUpdateMonitor.setAssistantVisible(true);
|
||||||
|
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -594,7 +597,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.onTrustChanged(true /* enabled */,
|
mKeyguardUpdateMonitor.onTrustChanged(true /* enabled */,
|
||||||
KeyguardUpdateMonitor.getCurrentUser(), 0 /* flags */);
|
KeyguardUpdateMonitor.getCurrentUser(), 0 /* flags */);
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -604,7 +607,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.onTrustChanged(true /* enabled */,
|
mKeyguardUpdateMonitor.onTrustChanged(true /* enabled */,
|
||||||
KeyguardUpdateMonitor.getCurrentUser(), 0 /* flags */);
|
KeyguardUpdateMonitor.getCurrentUser(), 0 /* flags */);
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -615,7 +619,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
KeyguardUpdateMonitor.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);
|
KeyguardUpdateMonitor.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN);
|
||||||
|
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -626,7 +631,7 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
KeyguardUpdateMonitor.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT);
|
KeyguardUpdateMonitor.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_LOCKOUT);
|
||||||
|
|
||||||
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
mKeyguardUpdateMonitor.onKeyguardVisibilityChanged(true);
|
||||||
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt());
|
verify(mFaceManager).authenticate(any(), any(), any(), any(), anyInt(), anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -638,7 +643,8 @@ public class KeyguardUpdateMonitorTest extends SysuiTestCase {
|
|||||||
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true);
|
mKeyguardUpdateMonitor.sendKeyguardBouncerChanged(true);
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
|
|
||||||
verify(mFaceManager, never()).authenticate(any(), any(), any(), any());
|
verify(mFaceManager, never()).authenticate(any(), any(), any(), any(), anyInt(),
|
||||||
|
anyBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
|
|||||||
private final LockoutTracker mLockoutTracker;
|
private final LockoutTracker mLockoutTracker;
|
||||||
private final boolean mIsRestricted;
|
private final boolean mIsRestricted;
|
||||||
private final boolean mAllowBackgroundAuthentication;
|
private final boolean mAllowBackgroundAuthentication;
|
||||||
|
private final boolean mIsKeyguardBypassEnabled;
|
||||||
|
|
||||||
protected final long mOperationId;
|
protected final long mOperationId;
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
|
|||||||
int cookie, boolean requireConfirmation, int sensorId, boolean isStrongBiometric,
|
int cookie, boolean requireConfirmation, int sensorId, boolean isStrongBiometric,
|
||||||
int statsModality, int statsClient, @Nullable TaskStackListener taskStackListener,
|
int statsModality, int statsClient, @Nullable TaskStackListener taskStackListener,
|
||||||
@NonNull LockoutTracker lockoutTracker, boolean allowBackgroundAuthentication,
|
@NonNull LockoutTracker lockoutTracker, boolean allowBackgroundAuthentication,
|
||||||
boolean shouldVibrate) {
|
boolean shouldVibrate, boolean isKeyguardBypassEnabled) {
|
||||||
super(context, lazyDaemon, token, listener, targetUserId, owner, cookie, sensorId,
|
super(context, lazyDaemon, token, listener, targetUserId, owner, cookie, sensorId,
|
||||||
shouldVibrate, statsModality, BiometricsProtoEnums.ACTION_AUTHENTICATE,
|
shouldVibrate, statsModality, BiometricsProtoEnums.ACTION_AUTHENTICATE,
|
||||||
statsClient);
|
statsClient);
|
||||||
@@ -110,6 +111,7 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
|
|||||||
mLockoutTracker = lockoutTracker;
|
mLockoutTracker = lockoutTracker;
|
||||||
mIsRestricted = restricted;
|
mIsRestricted = restricted;
|
||||||
mAllowBackgroundAuthentication = allowBackgroundAuthentication;
|
mAllowBackgroundAuthentication = allowBackgroundAuthentication;
|
||||||
|
mIsKeyguardBypassEnabled = isKeyguardBypassEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @LockoutTracker.LockoutMode int handleFailedAttempt(int userId) {
|
public @LockoutTracker.LockoutMode int handleFailedAttempt(int userId) {
|
||||||
@@ -394,6 +396,14 @@ public abstract class AuthenticationClient<T> extends AcquisitionClient<T>
|
|||||||
return mState;
|
return mState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the client supports bypass (e.g. passive auth such as face), and if it's
|
||||||
|
* enabled by the user.
|
||||||
|
*/
|
||||||
|
public boolean isKeyguardBypassEnabled() {
|
||||||
|
return mIsKeyguardBypassEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getProtoEnum() {
|
public int getProtoEnum() {
|
||||||
return BiometricsProto.CM_AUTHENTICATE;
|
return BiometricsProto.CM_AUTHENTICATE;
|
||||||
|
|||||||
@@ -251,7 +251,8 @@ public class FaceService extends SystemService {
|
|||||||
|
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
public void authenticate(final IBinder token, final long operationId, int userId,
|
public void authenticate(final IBinder token, final long operationId, int userId,
|
||||||
final IFaceServiceReceiver receiver, final String opPackageName) {
|
final IFaceServiceReceiver receiver, final String opPackageName,
|
||||||
|
boolean isKeyguardBypassEnabled) {
|
||||||
Utils.checkPermission(getContext(), USE_BIOMETRIC_INTERNAL);
|
Utils.checkPermission(getContext(), USE_BIOMETRIC_INTERNAL);
|
||||||
|
|
||||||
// TODO(b/152413782): If the sensor supports face detect and the device is encrypted or
|
// TODO(b/152413782): If the sensor supports face detect and the device is encrypted or
|
||||||
@@ -275,7 +276,7 @@ public class FaceService extends SystemService {
|
|||||||
provider.second.scheduleAuthenticate(provider.first, token, operationId, userId,
|
provider.second.scheduleAuthenticate(provider.first, token, operationId, userId,
|
||||||
0 /* cookie */,
|
0 /* cookie */,
|
||||||
new ClientMonitorCallbackConverter(receiver), opPackageName, restricted,
|
new ClientMonitorCallbackConverter(receiver), opPackageName, restricted,
|
||||||
statsClient, isKeyguard);
|
statsClient, isKeyguard, isKeyguardBypassEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
@@ -318,10 +319,12 @@ public class FaceService extends SystemService {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final boolean isKeyguardBypassEnabled = false; // only valid for keyguard clients
|
||||||
final boolean restricted = true; // BiometricPrompt is always restricted
|
final boolean restricted = true; // BiometricPrompt is always restricted
|
||||||
provider.scheduleAuthenticate(sensorId, token, operationId, userId, cookie,
|
provider.scheduleAuthenticate(sensorId, token, operationId, userId, cookie,
|
||||||
new ClientMonitorCallbackConverter(sensorReceiver), opPackageName, restricted,
|
new ClientMonitorCallbackConverter(sensorReceiver), opPackageName, restricted,
|
||||||
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT, allowBackgroundAuthentication);
|
BiometricsProtoEnums.CLIENT_BIOMETRIC_PROMPT, allowBackgroundAuthentication,
|
||||||
|
isKeyguardBypassEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // Binder call
|
@Override // Binder call
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public interface ServiceProvider {
|
|||||||
void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId, int userId,
|
void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId, int userId,
|
||||||
int cookie, @NonNull ClientMonitorCallbackConverter callback,
|
int cookie, @NonNull ClientMonitorCallbackConverter callback,
|
||||||
@NonNull String opPackageName, boolean restricted, int statsClient,
|
@NonNull String opPackageName, boolean restricted, int statsClient,
|
||||||
boolean allowBackgroundAuthentication);
|
boolean allowBackgroundAuthentication, boolean isKeyguardBypassEnabled);
|
||||||
|
|
||||||
void cancelAuthentication(int sensorId, @NonNull IBinder token);
|
void cancelAuthentication(int sensorId, @NonNull IBinder token);
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,13 @@ class FaceAuthenticationClient extends AuthenticationClient<ISession> implements
|
|||||||
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
|
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
|
||||||
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
|
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
|
||||||
boolean isStrongBiometric, int statsClient, @NonNull UsageStats usageStats,
|
boolean isStrongBiometric, int statsClient, @NonNull UsageStats usageStats,
|
||||||
@NonNull LockoutCache lockoutCache, boolean allowBackgroundAuthentication) {
|
@NonNull LockoutCache lockoutCache, boolean allowBackgroundAuthentication,
|
||||||
|
boolean isKeyguardBypassEnabled) {
|
||||||
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
||||||
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
||||||
BiometricsProtoEnums.MODALITY_FACE, statsClient, null /* taskStackListener */,
|
BiometricsProtoEnums.MODALITY_FACE, statsClient, null /* taskStackListener */,
|
||||||
lockoutCache, allowBackgroundAuthentication, true /* shouldVibrate */);
|
lockoutCache, allowBackgroundAuthentication, true /* shouldVibrate */,
|
||||||
|
isKeyguardBypassEnabled);
|
||||||
mUsageStats = usageStats;
|
mUsageStats = usageStats;
|
||||||
mLockoutCache = lockoutCache;
|
mLockoutCache = lockoutCache;
|
||||||
mNotificationManager = context.getSystemService(NotificationManager.class);
|
mNotificationManager = context.getSystemService(NotificationManager.class);
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
|||||||
public void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId,
|
public void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId,
|
||||||
int userId, int cookie, @NonNull ClientMonitorCallbackConverter callback,
|
int userId, int cookie, @NonNull ClientMonitorCallbackConverter callback,
|
||||||
@NonNull String opPackageName, boolean restricted, int statsClient,
|
@NonNull String opPackageName, boolean restricted, int statsClient,
|
||||||
boolean allowBackgroundAuthentication) {
|
boolean allowBackgroundAuthentication, boolean isKeyguardBypassEnabled) {
|
||||||
mHandler.post(() -> {
|
mHandler.post(() -> {
|
||||||
final boolean isStrongBiometric = Utils.isStrongBiometric(sensorId);
|
final boolean isStrongBiometric = Utils.isStrongBiometric(sensorId);
|
||||||
final FaceAuthenticationClient client = new FaceAuthenticationClient(
|
final FaceAuthenticationClient client = new FaceAuthenticationClient(
|
||||||
@@ -386,7 +386,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider {
|
|||||||
operationId, restricted, opPackageName, cookie,
|
operationId, restricted, opPackageName, cookie,
|
||||||
false /* requireConfirmation */, sensorId, isStrongBiometric, statsClient,
|
false /* requireConfirmation */, sensorId, isStrongBiometric, statsClient,
|
||||||
mUsageStats, mSensors.get(sensorId).getLockoutCache(),
|
mUsageStats, mSensors.get(sensorId).getLockoutCache(),
|
||||||
allowBackgroundAuthentication);
|
allowBackgroundAuthentication, isKeyguardBypassEnabled);
|
||||||
scheduleForSensor(sensorId, client);
|
scheduleForSensor(sensorId, client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -622,7 +622,7 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider {
|
|||||||
public void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId,
|
public void scheduleAuthenticate(int sensorId, @NonNull IBinder token, long operationId,
|
||||||
int userId, int cookie, @NonNull ClientMonitorCallbackConverter receiver,
|
int userId, int cookie, @NonNull ClientMonitorCallbackConverter receiver,
|
||||||
@NonNull String opPackageName, boolean restricted, int statsClient,
|
@NonNull String opPackageName, boolean restricted, int statsClient,
|
||||||
boolean allowBackgroundAuthentication) {
|
boolean allowBackgroundAuthentication, boolean isKeyguardBypassEnabled) {
|
||||||
mHandler.post(() -> {
|
mHandler.post(() -> {
|
||||||
scheduleUpdateActiveUserWithoutHandler(userId);
|
scheduleUpdateActiveUserWithoutHandler(userId);
|
||||||
|
|
||||||
@@ -630,7 +630,8 @@ public class Face10 implements IHwBinder.DeathRecipient, ServiceProvider {
|
|||||||
final FaceAuthenticationClient client = new FaceAuthenticationClient(mContext,
|
final FaceAuthenticationClient client = new FaceAuthenticationClient(mContext,
|
||||||
mLazyDaemon, token, receiver, userId, operationId, restricted, opPackageName,
|
mLazyDaemon, token, receiver, userId, operationId, restricted, opPackageName,
|
||||||
cookie, false /* requireConfirmation */, mSensorId, isStrongBiometric,
|
cookie, false /* requireConfirmation */, mSensorId, isStrongBiometric,
|
||||||
statsClient, mLockoutTracker, mUsageStats, allowBackgroundAuthentication);
|
statsClient, mLockoutTracker, mUsageStats, allowBackgroundAuthentication,
|
||||||
|
isKeyguardBypassEnabled);
|
||||||
mScheduler.scheduleClientMonitor(client);
|
mScheduler.scheduleClientMonitor(client);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,11 +61,13 @@ class FaceAuthenticationClient extends AuthenticationClient<IBiometricsFace> {
|
|||||||
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
|
@NonNull ClientMonitorCallbackConverter listener, int targetUserId, long operationId,
|
||||||
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
|
boolean restricted, String owner, int cookie, boolean requireConfirmation, int sensorId,
|
||||||
boolean isStrongBiometric, int statsClient, @NonNull LockoutTracker lockoutTracker,
|
boolean isStrongBiometric, int statsClient, @NonNull LockoutTracker lockoutTracker,
|
||||||
@NonNull UsageStats usageStats, boolean allowBackgroundAuthentication) {
|
@NonNull UsageStats usageStats, boolean allowBackgroundAuthentication,
|
||||||
|
boolean isKeyguardBypassEnabled) {
|
||||||
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
||||||
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
||||||
BiometricsProtoEnums.MODALITY_FACE, statsClient, null /* taskStackListener */,
|
BiometricsProtoEnums.MODALITY_FACE, statsClient, null /* taskStackListener */,
|
||||||
lockoutTracker, allowBackgroundAuthentication, true /* shouldVibrate */);
|
lockoutTracker, allowBackgroundAuthentication, true /* shouldVibrate */,
|
||||||
|
isKeyguardBypassEnabled);
|
||||||
mUsageStats = usageStats;
|
mUsageStats = usageStats;
|
||||||
|
|
||||||
final Resources resources = getContext().getResources();
|
final Resources resources = getContext().getResources();
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ class FingerprintAuthenticationClient extends AuthenticationClient<ISession> imp
|
|||||||
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted, owner,
|
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted, owner,
|
||||||
cookie, requireConfirmation, sensorId, isStrongBiometric,
|
cookie, requireConfirmation, sensorId, isStrongBiometric,
|
||||||
BiometricsProtoEnums.MODALITY_FINGERPRINT, statsClient, taskStackListener,
|
BiometricsProtoEnums.MODALITY_FINGERPRINT, statsClient, taskStackListener,
|
||||||
lockoutCache, allowBackgroundAuthentication, true /* shouldVibrate */);
|
lockoutCache, allowBackgroundAuthentication, true /* shouldVibrate */,
|
||||||
|
false /* isKeyguardBypassEnabled */);
|
||||||
mLockoutCache = lockoutCache;
|
mLockoutCache = lockoutCache;
|
||||||
mUdfpsOverlayController = udfpsOverlayController;
|
mUdfpsOverlayController = udfpsOverlayController;
|
||||||
mSensorProps = sensorProps;
|
mSensorProps = sensorProps;
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ class FingerprintAuthenticationClient extends AuthenticationClient<IBiometricsFi
|
|||||||
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
super(context, lazyDaemon, token, listener, targetUserId, operationId, restricted,
|
||||||
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
owner, cookie, requireConfirmation, sensorId, isStrongBiometric,
|
||||||
BiometricsProtoEnums.MODALITY_FINGERPRINT, statsClient, taskStackListener,
|
BiometricsProtoEnums.MODALITY_FINGERPRINT, statsClient, taskStackListener,
|
||||||
lockoutTracker, allowBackgroundAuthentication, true /* shouldVibrate */);
|
lockoutTracker, allowBackgroundAuthentication, true /* shouldVibrate */,
|
||||||
|
false /* isKeyguardBypassEnabled */);
|
||||||
mLockoutFrameworkImpl = lockoutTracker;
|
mLockoutFrameworkImpl = lockoutTracker;
|
||||||
mUdfpsOverlayController = udfpsOverlayController;
|
mUdfpsOverlayController = udfpsOverlayController;
|
||||||
mSensorProps = sensorProps;
|
mSensorProps = sensorProps;
|
||||||
|
|||||||
@@ -360,7 +360,8 @@ public class BiometricSchedulerTest {
|
|||||||
false /* restricted */, TAG, 1 /* cookie */, false /* requireConfirmation */,
|
false /* restricted */, TAG, 1 /* cookie */, false /* requireConfirmation */,
|
||||||
TEST_SENSOR_ID, true /* isStrongBiometric */, 0 /* statsModality */,
|
TEST_SENSOR_ID, true /* isStrongBiometric */, 0 /* statsModality */,
|
||||||
0 /* statsClient */, null /* taskStackListener */, mock(LockoutTracker.class),
|
0 /* statsClient */, null /* taskStackListener */, mock(LockoutTracker.class),
|
||||||
false /* isKeyguard */, true /* shouldVibrate */);
|
false /* isKeyguard */, true /* shouldVibrate */,
|
||||||
|
false /* isKeyguardBypassEnabled */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -388,7 +389,8 @@ public class BiometricSchedulerTest {
|
|||||||
false /* restricted */, TAG, 1 /* cookie */, false /* requireConfirmation */,
|
false /* restricted */, TAG, 1 /* cookie */, false /* requireConfirmation */,
|
||||||
TEST_SENSOR_ID, true /* isStrongBiometric */, 0 /* statsModality */,
|
TEST_SENSOR_ID, true /* isStrongBiometric */, 0 /* statsModality */,
|
||||||
0 /* statsClient */, null /* taskStackListener */, mock(LockoutTracker.class),
|
0 /* statsClient */, null /* taskStackListener */, mock(LockoutTracker.class),
|
||||||
false /* isKeyguard */, true /* shouldVibrate */);
|
false /* isKeyguard */, true /* shouldVibrate */,
|
||||||
|
false /* isKeyguardBypassEnabled */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user