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:
Kevin Chyn
2019-02-21 11:11:59 -08:00
parent 7f7ec2f244
commit cf1a62e830
2 changed files with 10 additions and 1 deletions

View File

@@ -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);

View File

@@ -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;