Use biometric onEnrollmentsChanged callback
Instead of manually querying enrollment (IPC) each
time we want to know.
Test: atest KeyguardUpdateMonitorTest
Fixes: 242022358
Change-Id: I20d697f81680af0a061faf9d6ffd0e68ddf22385
diff --git a/packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt b/packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt
index b186018..3757274 100644
--- a/packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt
+++ b/packages/SystemUI/src/com/android/keyguard/ActiveUnlockConfig.kt
@@ -318,9 +318,8 @@
keyguardUpdateMonitor?.let {
val anyFaceEnrolled = it.isFaceEnrolled
- val anyFingerprintEnrolled =
- it.getCachedIsUnlockWithFingerprintPossible(
- selectedUserInteractor.getSelectedUserId())
+ val anyFingerprintEnrolled = it.isUnlockWithFingerprintPossible(
+ selectedUserInteractor.getSelectedUserId())
val udfpsEnrolled = it.isUdfpsEnrolled
if (!anyFaceEnrolled && !anyFingerprintEnrolled) {
@@ -374,9 +373,8 @@
pw.println(" shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment=" +
"${shouldRequestActiveUnlockOnUnlockIntentFromBiometricEnrollment()}")
pw.println(" faceEnrolled=${it.isFaceEnrolled}")
- pw.println(" fpEnrolled=${
- it.getCachedIsUnlockWithFingerprintPossible(
- selectedUserInteractor.getSelectedUserId())}")
+ pw.println(" fpUnlockPossible=${
+ it.isUnlockWithFingerprintPossible(selectedUserInteractor.getSelectedUserId())}")
pw.println(" udfpsEnrolled=${it.isUdfpsEnrolled}")
} ?: pw.println(" keyguardUpdateMonitor is uninitialized")
}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
index 7101ed5..1b6112f 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java
@@ -755,7 +755,7 @@
}
mView.onResume(
mSecurityModel.getSecurityMode(mSelectedUserInteractor.getSelectedUserId()),
- mKeyguardStateController.isFaceAuthEnabled());
+ mKeyguardStateController.isFaceEnrolled());
}
/** Sets an initial message that would override the default message */
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 7d6240b..f19a9ed 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -441,7 +441,6 @@
private int mFaceRunningState = BIOMETRIC_STATE_STOPPED;
private boolean mIsDreaming;
private boolean mLogoutEnabled;
- private boolean mIsFaceEnrolled;
private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private int mPostureState = DEVICE_POSTURE_UNKNOWN;
private FingerprintInteractiveToAuthProvider mFingerprintInteractiveToAuthProvider;
@@ -2083,7 +2082,6 @@
private boolean mFingerprintLockedOut;
private boolean mFingerprintLockedOutPermanent;
private boolean mFaceLockedOutPermanent;
- private final HashMap<Integer, Boolean> mIsUnlockWithFingerprintPossible = new HashMap<>();
/**
* When we receive a {@link android.content.Intent#ACTION_SIM_STATE_CHANGED} broadcast,
@@ -2701,16 +2699,6 @@
}
}
- private void updateFaceEnrolled(int userId) {
- final Boolean isFaceEnrolled = isFaceSupported()
- && mBiometricEnabledForUser.get(userId)
- && mAuthController.isFaceAuthEnrolled(userId);
- if (mIsFaceEnrolled != isFaceEnrolled) {
- mLogger.logFaceEnrolledUpdated(mIsFaceEnrolled, isFaceEnrolled);
- }
- mIsFaceEnrolled = isFaceEnrolled;
- }
-
private boolean isFaceSupported() {
return mFaceManager != null && !mFaceSensorProperties.isEmpty();
}
@@ -2750,10 +2738,17 @@
}
/**
+ * @return true if there's at least one face enrolled for the given user.
+ */
+ public boolean isFaceEnrolled(int userId) {
+ return mAuthController.isFaceAuthEnrolled(userId);
+ }
+
+ /**
* @return true if there's at least one face enrolled
*/
public boolean isFaceEnrolled() {
- return mIsFaceEnrolled;
+ return isFaceEnrolled(mSelectedUserInteractor.getSelectedUserId());
}
private final UserTracker.Callback mUserChangedCallback = new UserTracker.Callback() {
@@ -3442,49 +3437,22 @@
}
@SuppressLint("MissingPermission")
- @VisibleForTesting
- boolean isUnlockWithFingerprintPossible(int userId) {
- // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once.
- boolean newFpEnrolled = isFingerprintSupported()
- && !isFingerprintDisabled(userId) && mFpm.hasEnrolledTemplates(userId);
- Boolean oldFpEnrolled = mIsUnlockWithFingerprintPossible.getOrDefault(userId, false);
- if (oldFpEnrolled != newFpEnrolled) {
- mLogger.logFpEnrolledUpdated(userId, oldFpEnrolled, newFpEnrolled);
- }
- mIsUnlockWithFingerprintPossible.put(userId, newFpEnrolled);
- return mIsUnlockWithFingerprintPossible.get(userId);
- }
-
- /**
- * Cached value for whether fingerprint is enrolled and possible to use for authentication.
- * Note: checking fingerprint enrollment directly with the AuthController requires an IPC.
- */
- public boolean getCachedIsUnlockWithFingerprintPossible(int userId) {
- return mIsUnlockWithFingerprintPossible.getOrDefault(userId, false);
+ public boolean isUnlockWithFingerprintPossible(int userId) {
+ return isFingerprintSupported()
+ && !isFingerprintDisabled(userId) && mAuthController.isFingerprintEnrolled(userId);
}
/**
* @deprecated This is being migrated to use modern architecture.
*/
+ @VisibleForTesting
@Deprecated
- private boolean isUnlockWithFacePossible(int userId) {
+ public boolean isUnlockWithFacePossible(int userId) {
if (isFaceAuthInteractorEnabled()) {
return getFaceAuthInteractor() != null
&& getFaceAuthInteractor().isFaceAuthEnabledAndEnrolled();
}
- return isFaceAuthEnabledForUser(userId) && !isFaceDisabled(userId);
- }
-
- /**
- * If face hardware is available, user has enrolled and enabled auth via setting.
- *
- * @deprecated This is being migrated to use modern architecture.
- */
- @Deprecated
- public boolean isFaceAuthEnabledForUser(int userId) {
- // TODO (b/242022358), make this rely on onEnrollmentChanged event and update it only once.
- updateFaceEnrolled(userId);
- return mIsFaceEnrolled;
+ return isFaceSupported() && isFaceEnrolled(userId) && !isFaceDisabled(userId);
}
private void notifyAboutEnrollmentChange(@BiometricAuthenticator.Modality int modality) {
diff --git a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
index fa07072..5bf8d63 100644
--- a/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
+++ b/packages/SystemUI/src/com/android/keyguard/logging/KeyguardUpdateMonitorLogger.kt
@@ -660,19 +660,6 @@
)
}
- fun logFpEnrolledUpdated(userId: Int, oldValue: Boolean, newValue: Boolean) {
- logBuffer.log(
- TAG,
- DEBUG,
- {
- int1 = userId
- bool1 = oldValue
- bool2 = newValue
- },
- { "Fp enrolled state changed for userId: $int1 old: $bool1, new: $bool2" }
- )
- }
-
fun logTrustUsuallyManagedUpdated(
userId: Int,
oldValue: Boolean,
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt
index 2bd6258..7cdd641 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractor.kt
@@ -405,7 +405,7 @@
/** Whether we want to wait to show the bouncer in case passive auth succeeds. */
private fun usePrimaryBouncerPassiveAuthDelay(): Boolean {
val canRunFaceAuth =
- keyguardStateController.isFaceAuthEnabled &&
+ keyguardStateController.isFaceEnrolled &&
keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(BiometricSourceType.FACE) &&
keyguardUpdateMonitor.doesCurrentPostureAllowFaceAuth()
val canRunActiveUnlock =
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 2f1b589..dd24ca7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -1457,7 +1457,7 @@
}
private boolean canUnlockWithFingerprint() {
- return mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
+ return mKeyguardUpdateMonitor.isUnlockWithFingerprintPossible(
getCurrentUser()) && mKeyguardUpdateMonitor.isUnlockingWithFingerprintAllowed();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
index 59f10ae..91d7370 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BiometricUnlockController.java
@@ -734,8 +734,8 @@
// Suppress all face auth errors if fingerprint can be used to authenticate
if ((biometricSourceType == BiometricSourceType.FACE
- && !mUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
- mSelectedUserInteractor.get().getSelectedUserId()))
+ && !mUpdateMonitor.isUnlockWithFingerprintPossible(
+ mSelectedUserInteractor.get().getSelectedUserId()))
|| (biometricSourceType == BiometricSourceType.FINGERPRINT)) {
mHapticsInteractor.vibrateError();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 8d9fd12..0061fc0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -237,10 +237,10 @@
import com.android.wm.shell.startingsurface.SplashscreenContentDrawer;
import com.android.wm.shell.startingsurface.StartingSurface;
-import dagger.Lazy;
-
import dalvik.annotation.optimization.NeverCompile;
+import dagger.Lazy;
+
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.List;
@@ -2584,7 +2584,7 @@
&& mFingerprintManager.get() != null
&& mFingerprintManager.get().isPowerbuttonFps()
&& mKeyguardUpdateMonitor
- .getCachedIsUnlockWithFingerprintPossible(
+ .isUnlockWithFingerprintPossible(
mUserTracker.getUserId())
&& !touchToUnlockAnytime;
if (DEBUG_WAKEUP_DELAY) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
index 63591d7..b0183d3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBypassController.kt
@@ -58,7 +58,7 @@
private var pendingUnlock: PendingUnlock? = null
private val listeners = mutableListOf<OnBypassStateChangedListener>()
private val faceAuthEnabledChangedCallback = object : KeyguardStateController.Callback {
- override fun onFaceAuthEnabledChanged() = notifyListeners()
+ override fun onFaceEnrolledChanged() = notifyListeners()
}
@IntDef(
@@ -98,7 +98,7 @@
FACE_UNLOCK_BYPASS_NEVER -> false
else -> field
}
- return enabled && mKeyguardStateController.isFaceAuthEnabled &&
+ return enabled && mKeyguardStateController.isFaceEnrolled &&
isPostureAllowedForFaceAuth()
}
private set(value) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt
index 109e77e..3329844 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardLiftController.kt
@@ -117,9 +117,7 @@
val onKeyguard = keyguardUpdateMonitor.isKeyguardVisible &&
!statusBarStateController.isDozing
- val userId = selectedUserInteractor.getSelectedUserId()
- val isFaceEnabled = keyguardUpdateMonitor.isFaceAuthEnabledForUser(userId)
- val shouldListen = (onKeyguard || bouncerVisible) && isFaceEnabled
+ val shouldListen = (onKeyguard || bouncerVisible) && keyguardUpdateMonitor.isFaceEnrolled
if (shouldListen != isListening) {
isListening = shouldListen
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
index 8929e02..52133ee 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateController.java
@@ -130,7 +130,7 @@
/**
* If there are faces enrolled and user enabled face auth on keyguard.
*/
- default boolean isFaceAuthEnabled() {
+ default boolean isFaceEnrolled() {
return false;
}
@@ -265,9 +265,9 @@
/**
* Triggered when face auth becomes available or unavailable. Value should be queried with
- * {@link KeyguardStateController#isFaceAuthEnabled()}.
+ * {@link KeyguardStateController#isFaceEnrolled()}.
*/
- default void onFaceAuthEnabledChanged() {}
+ default void onFaceEnrolledChanged() {}
/**
* Triggered when the notification panel is starting or has finished
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
index c624518..8cc7e7d2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java
@@ -85,7 +85,7 @@
private boolean mTrustManaged;
private boolean mTrusted;
private boolean mDebugUnlocked = false;
- private boolean mFaceAuthEnabled;
+ private boolean mFaceEnrolled;
private float mDismissAmount = 0f;
private boolean mDismissingFromTouch = false;
@@ -216,7 +216,7 @@
private void notifyKeyguardFaceAuthEnabledChanged() {
// Copy the list to allow removal during callback.
- new ArrayList<>(mCallbacks).forEach(Callback::onFaceAuthEnabledChanged);
+ new ArrayList<>(mCallbacks).forEach(Callback::onFaceEnrolledChanged);
}
private void notifyUnlockedChanged() {
@@ -260,16 +260,16 @@
|| (Build.IS_DEBUGGABLE && DEBUG_AUTH_WITH_ADB && mDebugUnlocked);
boolean trustManaged = mKeyguardUpdateMonitor.getUserTrustIsManaged(user);
boolean trusted = mKeyguardUpdateMonitor.getUserHasTrust(user);
- boolean faceAuthEnabled = mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(user);
+ boolean faceEnrolled = mKeyguardUpdateMonitor.isFaceEnrolled(user);
boolean changed = secure != mSecure || canDismissLockScreen != mCanDismissLockScreen
|| trustManaged != mTrustManaged || mTrusted != trusted
- || mFaceAuthEnabled != faceAuthEnabled;
+ || mFaceEnrolled != faceEnrolled;
if (changed || updateAlways) {
mSecure = secure;
mCanDismissLockScreen = canDismissLockScreen;
mTrusted = trusted;
mTrustManaged = trustManaged;
- mFaceAuthEnabled = faceAuthEnabled;
+ mFaceEnrolled = faceEnrolled;
mLogger.logKeyguardStateUpdate(
mSecure, mCanDismissLockScreen, mTrusted, mTrustManaged);
notifyUnlockedChanged();
@@ -290,8 +290,8 @@
}
@Override
- public boolean isFaceAuthEnabled() {
- return mFaceAuthEnabled;
+ public boolean isFaceEnrolled() {
+ return mFaceEnrolled;
}
@Override
@@ -416,7 +416,7 @@
pw.println(" mTrustManaged: " + mTrustManaged);
pw.println(" mTrusted: " + mTrusted);
pw.println(" mDebugUnlocked: " + mDebugUnlocked);
- pw.println(" mFaceAuthEnabled: " + mFaceAuthEnabled);
+ pw.println(" mFaceEnrolled: " + mFaceEnrolled);
pw.println(" isKeyguardFadingAway: " + isKeyguardFadingAway());
pw.println(" isKeyguardGoingAway: " + isKeyguardGoingAway());
pw.println(" isLaunchTransitionFadingAway: " + isLaunchTransitionFadingAway());
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/ActiveUnlockConfigTest.kt b/packages/SystemUI/tests/src/com/android/keyguard/ActiveUnlockConfigTest.kt
index b31f630a4..e429446 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/ActiveUnlockConfigTest.kt
+++ b/packages/SystemUI/tests/src/com/android/keyguard/ActiveUnlockConfigTest.kt
@@ -262,7 +262,7 @@
// GIVEN fingerprint and face are NOT enrolled
activeUnlockConfig.keyguardUpdateMonitor = keyguardUpdateMonitor
`when`(keyguardUpdateMonitor.isFaceEnrolled).thenReturn(false)
- `when`(keyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(0)).thenReturn(false)
+ `when`(keyguardUpdateMonitor.isUnlockWithFingerprintPossible(0)).thenReturn(false)
// WHEN unlock intent is allowed when NO biometrics are enrolled (0)
@@ -292,7 +292,7 @@
// GIVEN fingerprint and face are both enrolled
activeUnlockConfig.keyguardUpdateMonitor = keyguardUpdateMonitor
`when`(keyguardUpdateMonitor.isFaceEnrolled).thenReturn(true)
- `when`(keyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(0)).thenReturn(true)
+ `when`(keyguardUpdateMonitor.isUnlockWithFingerprintPossible(0)).thenReturn(true)
// WHEN unlock intent is allowed when ONLY fingerprint is enrolled or NO biometircs
// are enrolled
@@ -315,7 +315,7 @@
// WHEN fingerprint ONLY enrolled
`when`(keyguardUpdateMonitor.isFaceEnrolled).thenReturn(false)
- `when`(keyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(0)).thenReturn(true)
+ `when`(keyguardUpdateMonitor.isUnlockWithFingerprintPossible(0)).thenReturn(true)
// THEN active unlock triggers allowed on unlock intent
assertTrue(
@@ -326,7 +326,7 @@
// WHEN face ONLY enrolled
`when`(keyguardUpdateMonitor.isFaceEnrolled).thenReturn(true)
- `when`(keyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(0)).thenReturn(false)
+ `when`(keyguardUpdateMonitor.isUnlockWithFingerprintPossible(0)).thenReturn(false)
// THEN active unlock triggers allowed on unlock intent
assertTrue(
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
index aabdcb7..efb0887 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardUpdateMonitorTest.java
@@ -414,6 +414,7 @@
}
private void setupFingerprintAuth(boolean isClass3) throws RemoteException {
+ when(mAuthController.isFingerprintEnrolled(anyInt())).thenReturn(true);
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
when(mFingerprintManager.hasEnrolledTemplates(anyInt())).thenReturn(true);
mFingerprintSensorProperties = List.of(
@@ -2898,18 +2899,22 @@
@Test
public void testFaceSensorProperties() throws RemoteException {
+ // GIVEN no face sensor properties
+ when(mAuthController.isFaceAuthEnrolled(anyInt())).thenReturn(true);
mFaceAuthenticatorsRegisteredCallback.onAllAuthenticatorsRegistered(new ArrayList<>());
- assertThat(mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(
+ // THEN face is not possible
+ assertThat(mKeyguardUpdateMonitor.isUnlockWithFacePossible(
mSelectedUserInteractor.getSelectedUserId())).isFalse();
+ // WHEN there are face sensor properties
mFaceAuthenticatorsRegisteredCallback.onAllAuthenticatorsRegistered(mFaceSensorProperties);
- biometricsEnabledForCurrentUser();
+ // THEN face is possible but face does NOT start listening immediately
+ assertThat(mKeyguardUpdateMonitor.isUnlockWithFacePossible(
+ mSelectedUserInteractor.getSelectedUserId())).isTrue();
verifyFaceAuthenticateNeverCalled();
verifyFaceDetectNeverCalled();
- assertThat(mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(
- mSelectedUserInteractor.getSelectedUserId())).isTrue();
}
@Test
@@ -3167,10 +3172,6 @@
}
private void mockCanBypassLockscreen(boolean canBypass) {
- // force update the isFaceEnrolled cache:
- mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(
- mSelectedUserInteractor.getSelectedUserId());
-
mKeyguardUpdateMonitor.setKeyguardBypassController(mKeyguardBypassController);
when(mKeyguardBypassController.canBypass()).thenReturn(canBypass);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt
index 9373ada..01d487d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/domain/interactor/PrimaryBouncerInteractorTest.kt
@@ -402,7 +402,7 @@
mainHandler.setMode(FakeHandler.Mode.QUEUEING)
// GIVEN bouncer should be delayed due to face auth
- whenever(keyguardStateController.isFaceAuthEnabled).thenReturn(true)
+ whenever(keyguardStateController.isFaceEnrolled).thenReturn(true)
whenever(keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(BiometricSourceType.FACE))
.thenReturn(true)
whenever(keyguardUpdateMonitor.doesCurrentPostureAllowFaceAuth()).thenReturn(true)
@@ -428,7 +428,7 @@
// GIVEN bouncer should not be delayed because device isn't in the right posture for
// face auth
- whenever(keyguardStateController.isFaceAuthEnabled).thenReturn(true)
+ whenever(keyguardStateController.isFaceEnrolled).thenReturn(true)
whenever(keyguardUpdateMonitor.isUnlockingWithBiometricAllowed(BiometricSourceType.FACE))
.thenReturn(true)
whenever(keyguardUpdateMonitor.doesCurrentPostureAllowFaceAuth()).thenReturn(false)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
index 2bcad1d..dd3ac92 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
@@ -73,10 +73,10 @@
import com.android.keyguard.TrustGrantFlags;
import com.android.settingslib.fuelgauge.BatteryStatus;
-import com.android.systemui.res.R;
import com.android.systemui.dock.DockManager;
import com.android.systemui.keyguard.KeyguardIndication;
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController;
+import com.android.systemui.res.R;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -1543,7 +1543,7 @@
private void setupFingerprintUnlockPossible(boolean possible) {
when(mKeyguardUpdateMonitor
- .getCachedIsUnlockWithFingerprintPossible(getCurrentUser()))
+ .isUnlockWithFingerprintPossible(getCurrentUser()))
.thenReturn(possible);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
index cfd220b..164325a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
@@ -140,7 +140,7 @@
mFeatureFlags.set(ONE_WAY_HAPTICS_API_MIGRATION, false);
when(mKeyguardStateController.isShowing()).thenReturn(true);
when(mUpdateMonitor.isDeviceInteractive()).thenReturn(true);
- when(mKeyguardStateController.isFaceAuthEnabled()).thenReturn(true);
+ when(mKeyguardStateController.isFaceEnrolled()).thenReturn(true);
when(mKeyguardStateController.isUnlocked()).thenReturn(false);
when(mKeyguardBypassController.onBiometricAuthenticated(any(), anyBoolean()))
.thenReturn(true);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBypassControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBypassControllerTest.kt
index 6209f73..bd0dbee 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBypassControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBypassControllerTest.kt
@@ -86,7 +86,7 @@
featureFlags.set(Flags.FULL_SCREEN_USER_SWITCHER, true)
whenever(packageManager.hasSystemFeature(PackageManager.FEATURE_FACE)).thenReturn(true)
- whenever(keyguardStateController.isFaceAuthEnabled).thenReturn(true)
+ whenever(keyguardStateController.isFaceEnrolled).thenReturn(true)
}
@After
@@ -158,7 +158,7 @@
keyguardBypassController.registerOnBypassStateChangedListener(bypassListener)
verify(keyguardStateController).addCallback(callback.capture())
- callback.value.onFaceAuthEnabledChanged()
+ callback.value.onFaceEnrolledChanged()
verify(bypassListener).onBypassStateChanged(anyBoolean())
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
index e6b09e3..5c960b6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardStateControllerTest.java
@@ -97,20 +97,20 @@
}
@Test
- public void testFaceAuthEnabledChanged_calledWhenFaceEnrollmentStateChanges() {
+ public void testFaceAuthEnrolleddChanged_calledWhenFaceEnrollmentStateChanges() {
KeyguardStateController.Callback callback = mock(KeyguardStateController.Callback.class);
- when(mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(anyInt())).thenReturn(false);
+ when(mKeyguardUpdateMonitor.isFaceEnrolled(anyInt())).thenReturn(false);
verify(mKeyguardUpdateMonitor).registerCallback(mUpdateCallbackCaptor.capture());
mKeyguardStateController.addCallback(callback);
- assertThat(mKeyguardStateController.isFaceAuthEnabled()).isFalse();
+ assertThat(mKeyguardStateController.isFaceEnrolled()).isFalse();
- when(mKeyguardUpdateMonitor.isFaceAuthEnabledForUser(anyInt())).thenReturn(true);
+ when(mKeyguardUpdateMonitor.isFaceEnrolled(anyInt())).thenReturn(true);
mUpdateCallbackCaptor.getValue().onBiometricEnrollmentStateChanged(
BiometricSourceType.FACE);
- assertThat(mKeyguardStateController.isFaceAuthEnabled()).isTrue();
- verify(callback).onFaceAuthEnabledChanged();
+ assertThat(mKeyguardStateController.isFaceEnrolled()).isTrue();
+ verify(callback).onFaceEnrolledChanged();
}
@Test