Fix SyntheticPasswordTests
Move the biometric check to the injector so it can be ignored for tests Test: atest SyntheticPasswordTests Change-Id: I261edac299bbda5205b0759670def073a46dc49a
This commit is contained in:
@@ -405,6 +405,10 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
return new SyntheticPasswordManager(getContext(), storage, getUserManager());
|
||||
}
|
||||
|
||||
public boolean hasBiometrics() {
|
||||
return BiometricManager.hasBiometrics(mContext);
|
||||
}
|
||||
|
||||
public int binderGetCallingUid() {
|
||||
return Binder.getCallingUid();
|
||||
}
|
||||
@@ -2423,7 +2427,7 @@ public class LockSettingsService extends ILockSettings.Stub {
|
||||
notifyActivePasswordMetricsAvailable(userCredential, userId);
|
||||
unlockKeystore(authResult.authToken.deriveKeyStorePassword(), userId);
|
||||
// Reset lockout
|
||||
if (BiometricManager.hasBiometrics(mContext)) {
|
||||
if (mInjector.hasBiometrics()) {
|
||||
BiometricManager bm = mContext.getSystemService(BiometricManager.class);
|
||||
Slog.i(TAG, "Resetting lockout, length: "
|
||||
+ authResult.gkResponse.getPayload().length);
|
||||
|
||||
@@ -103,6 +103,11 @@ public class LockSettingsServiceTestable extends LockSettingsService {
|
||||
return mSpManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBiometrics() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int binderGetCallingUid() {
|
||||
return Process.SYSTEM_UID;
|
||||
|
||||
Reference in New Issue
Block a user