Merge "Change KeyguardIndicationController to use UserTracker instead of KeyguardUpdateMonitor to get the current user id." into udc-dev
This commit is contained in:
@@ -480,6 +480,11 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
sCurrentUser = currentUser;
|
sCurrentUser = currentUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated This can potentially return unexpected values in a multi user scenario
|
||||||
|
* as this state is managed by another component. Consider using {@link UserTracker}.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
public synchronized static int getCurrentUser() {
|
public synchronized static int getCurrentUser() {
|
||||||
return sCurrentUser;
|
return sCurrentUser;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ import static android.view.View.VISIBLE;
|
|||||||
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_AVAILABLE;
|
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_AVAILABLE;
|
||||||
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED;
|
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED;
|
||||||
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FINGERPRINT_NOT_RECOGNIZED;
|
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FINGERPRINT_NOT_RECOGNIZED;
|
||||||
import static com.android.keyguard.KeyguardUpdateMonitor.getCurrentUser;
|
|
||||||
import static com.android.systemui.DejankUtils.whitelistIpcs;
|
import static com.android.systemui.DejankUtils.whitelistIpcs;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.IMPORTANT_MSG_MIN_DURATION;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.IMPORTANT_MSG_MIN_DURATION;
|
||||||
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_ALIGNMENT;
|
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_ALIGNMENT;
|
||||||
@@ -99,6 +98,7 @@ import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteracto
|
|||||||
import com.android.systemui.plugins.FalsingManager;
|
import com.android.systemui.plugins.FalsingManager;
|
||||||
import com.android.systemui.plugins.log.LogLevel;
|
import com.android.systemui.plugins.log.LogLevel;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.settings.UserTracker;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
@@ -146,6 +146,7 @@ public class KeyguardIndicationController {
|
|||||||
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||||
private final AuthController mAuthController;
|
private final AuthController mAuthController;
|
||||||
private final KeyguardLogger mKeyguardLogger;
|
private final KeyguardLogger mKeyguardLogger;
|
||||||
|
private final UserTracker mUserTracker;
|
||||||
private ViewGroup mIndicationArea;
|
private ViewGroup mIndicationArea;
|
||||||
private KeyguardIndicationTextView mTopIndicationView;
|
private KeyguardIndicationTextView mTopIndicationView;
|
||||||
private KeyguardIndicationTextView mLockScreenIndicationView;
|
private KeyguardIndicationTextView mLockScreenIndicationView;
|
||||||
@@ -251,7 +252,8 @@ public class KeyguardIndicationController {
|
|||||||
FaceHelpMessageDeferral faceHelpMessageDeferral,
|
FaceHelpMessageDeferral faceHelpMessageDeferral,
|
||||||
KeyguardLogger keyguardLogger,
|
KeyguardLogger keyguardLogger,
|
||||||
AlternateBouncerInteractor alternateBouncerInteractor,
|
AlternateBouncerInteractor alternateBouncerInteractor,
|
||||||
AlarmManager alarmManager
|
AlarmManager alarmManager,
|
||||||
|
UserTracker userTracker
|
||||||
) {
|
) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mBroadcastDispatcher = broadcastDispatcher;
|
mBroadcastDispatcher = broadcastDispatcher;
|
||||||
@@ -275,6 +277,7 @@ public class KeyguardIndicationController {
|
|||||||
mKeyguardLogger = keyguardLogger;
|
mKeyguardLogger = keyguardLogger;
|
||||||
mScreenLifecycle.addObserver(mScreenObserver);
|
mScreenLifecycle.addObserver(mScreenObserver);
|
||||||
mAlternateBouncerInteractor = alternateBouncerInteractor;
|
mAlternateBouncerInteractor = alternateBouncerInteractor;
|
||||||
|
mUserTracker = userTracker;
|
||||||
|
|
||||||
mFaceAcquiredMessageDeferral = faceHelpMessageDeferral;
|
mFaceAcquiredMessageDeferral = faceHelpMessageDeferral;
|
||||||
mCoExFaceAcquisitionMsgIdsToShow = new HashSet<>();
|
mCoExFaceAcquisitionMsgIdsToShow = new HashSet<>();
|
||||||
@@ -475,6 +478,10 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getCurrentUser() {
|
||||||
|
return mUserTracker.getUserId();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateLockScreenOwnerInfo() {
|
private void updateLockScreenOwnerInfo() {
|
||||||
// Check device owner info on a bg thread.
|
// Check device owner info on a bg thread.
|
||||||
// It makes multiple IPCs that could block the thread it's run on.
|
// It makes multiple IPCs that could block the thread it's run on.
|
||||||
@@ -1166,8 +1173,7 @@ public class KeyguardIndicationController {
|
|||||||
mContext.getString(R.string.keyguard_unlock)
|
mContext.getString(R.string.keyguard_unlock)
|
||||||
);
|
);
|
||||||
} else if (fpAuthFailed
|
} else if (fpAuthFailed
|
||||||
&& mKeyguardUpdateMonitor.getUserHasTrust(
|
&& mKeyguardUpdateMonitor.getUserHasTrust(getCurrentUser())) {
|
||||||
KeyguardUpdateMonitor.getCurrentUser())) {
|
|
||||||
showBiometricMessage(
|
showBiometricMessage(
|
||||||
getTrustGrantedIndication(),
|
getTrustGrantedIndication(),
|
||||||
mContext.getString(R.string.keyguard_unlock)
|
mContext.getString(R.string.keyguard_unlock)
|
||||||
@@ -1421,7 +1427,7 @@ public class KeyguardIndicationController {
|
|||||||
|
|
||||||
private boolean canUnlockWithFingerprint() {
|
private boolean canUnlockWithFingerprint() {
|
||||||
return mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
return mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
KeyguardUpdateMonitor.getCurrentUser());
|
getCurrentUser());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showErrorMessageNowOrLater(String errString, @Nullable String followUpMsg) {
|
private void showErrorMessageNowOrLater(String errString, @Nullable String followUpMsg) {
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ import com.android.systemui.keyguard.ScreenLifecycle;
|
|||||||
import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteractor;
|
import com.android.systemui.keyguard.domain.interactor.AlternateBouncerInteractor;
|
||||||
import com.android.systemui.plugins.FalsingManager;
|
import com.android.systemui.plugins.FalsingManager;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.settings.UserTracker;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
import com.android.systemui.statusbar.phone.KeyguardBypassController;
|
||||||
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
import com.android.systemui.statusbar.phone.KeyguardIndicationTextView;
|
||||||
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
|
||||||
@@ -188,6 +189,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
private AuthController mAuthController;
|
private AuthController mAuthController;
|
||||||
@Mock
|
@Mock
|
||||||
private AlarmManager mAlarmManager;
|
private AlarmManager mAlarmManager;
|
||||||
|
@Mock
|
||||||
|
private UserTracker mUserTracker;
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<DockManager.AlignmentStateListener> mAlignmentListener;
|
private ArgumentCaptor<DockManager.AlignmentStateListener> mAlignmentListener;
|
||||||
@Captor
|
@Captor
|
||||||
@@ -209,6 +212,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
private BroadcastReceiver mBroadcastReceiver;
|
private BroadcastReceiver mBroadcastReceiver;
|
||||||
private FakeExecutor mExecutor = new FakeExecutor(new FakeSystemClock());
|
private FakeExecutor mExecutor = new FakeExecutor(new FakeSystemClock());
|
||||||
private TestableLooper mTestableLooper;
|
private TestableLooper mTestableLooper;
|
||||||
|
private final int mCurrentUserId = 1;
|
||||||
|
|
||||||
private KeyguardIndicationTextView mTextView; // AOD text
|
private KeyguardIndicationTextView mTextView; // AOD text
|
||||||
|
|
||||||
@@ -260,6 +264,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
.thenReturn(mDisclosureGeneric);
|
.thenReturn(mDisclosureGeneric);
|
||||||
when(mDevicePolicyResourcesManager.getString(anyString(), any(), anyString()))
|
when(mDevicePolicyResourcesManager.getString(anyString(), any(), anyString()))
|
||||||
.thenReturn(mDisclosureWithOrganization);
|
.thenReturn(mDisclosureWithOrganization);
|
||||||
|
when(mUserTracker.getUserId()).thenReturn(mCurrentUserId);
|
||||||
|
|
||||||
mWakeLock = new WakeLockFake();
|
mWakeLock = new WakeLockFake();
|
||||||
mWakeLockBuilder = new WakeLockFake.Builder(mContext);
|
mWakeLockBuilder = new WakeLockFake.Builder(mContext);
|
||||||
@@ -291,7 +296,8 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
mKeyguardBypassController, mAccessibilityManager,
|
mKeyguardBypassController, mAccessibilityManager,
|
||||||
mFaceHelpMessageDeferral, mock(KeyguardLogger.class),
|
mFaceHelpMessageDeferral, mock(KeyguardLogger.class),
|
||||||
mAlternateBouncerInteractor,
|
mAlternateBouncerInteractor,
|
||||||
mAlarmManager
|
mAlarmManager,
|
||||||
|
mUserTracker
|
||||||
);
|
);
|
||||||
mController.init();
|
mController.init();
|
||||||
mController.setIndicationArea(mIndicationArea);
|
mController.setIndicationArea(mIndicationArea);
|
||||||
@@ -813,7 +819,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() {
|
public void faceErrorTimeout_whenFingerprintEnrolled_doesNotShowMessage() {
|
||||||
createController();
|
createController();
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(true);
|
getCurrentUser())).thenReturn(true);
|
||||||
String message = "A message";
|
String message = "A message";
|
||||||
|
|
||||||
mController.setVisible(true);
|
mController.setVisible(true);
|
||||||
@@ -828,7 +834,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// GIVEN fingerprint enrolled
|
// GIVEN fingerprint enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(true);
|
getCurrentUser())).thenReturn(true);
|
||||||
|
|
||||||
// WHEN help messages received that are allowed to show
|
// WHEN help messages received that are allowed to show
|
||||||
final String helpString = "helpString";
|
final String helpString = "helpString";
|
||||||
@@ -855,7 +861,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// GIVEN fingerprint enrolled
|
// GIVEN fingerprint enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(true);
|
getCurrentUser())).thenReturn(true);
|
||||||
|
|
||||||
// WHEN help messages received that aren't supposed to show
|
// WHEN help messages received that aren't supposed to show
|
||||||
final String helpString = "helpString";
|
final String helpString = "helpString";
|
||||||
@@ -882,7 +888,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// GIVEN fingerprint NOT enrolled
|
// GIVEN fingerprint NOT enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(false);
|
getCurrentUser())).thenReturn(false);
|
||||||
|
|
||||||
// WHEN help messages received
|
// WHEN help messages received
|
||||||
final Set<CharSequence> helpStrings = new HashSet<>();
|
final Set<CharSequence> helpStrings = new HashSet<>();
|
||||||
@@ -913,7 +919,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// GIVEN fingerprint NOT enrolled
|
// GIVEN fingerprint NOT enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(false);
|
getCurrentUser())).thenReturn(false);
|
||||||
|
|
||||||
// WHEN help message received and deferred message is valid
|
// WHEN help message received and deferred message is valid
|
||||||
final String helpString = "helpMsg";
|
final String helpString = "helpMsg";
|
||||||
@@ -944,7 +950,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// GIVEN fingerprint enrolled
|
// GIVEN fingerprint enrolled
|
||||||
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
when(mKeyguardUpdateMonitor.getCachedIsUnlockWithFingerprintPossible(
|
||||||
0)).thenReturn(true);
|
getCurrentUser())).thenReturn(true);
|
||||||
|
|
||||||
// WHEN help message received and deferredMessage is valid
|
// WHEN help message received and deferredMessage is valid
|
||||||
final String helpString = "helpMsg";
|
final String helpString = "helpMsg";
|
||||||
@@ -1173,7 +1179,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// WHEN trust is granted
|
// WHEN trust is granted
|
||||||
when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(true);
|
when(mKeyguardUpdateMonitor.getUserHasTrust(anyInt())).thenReturn(true);
|
||||||
mKeyguardUpdateMonitorCallback.onTrustChanged(KeyguardUpdateMonitor.getCurrentUser());
|
mKeyguardUpdateMonitorCallback.onTrustChanged(getCurrentUser());
|
||||||
|
|
||||||
// THEN verify the trust granted message shows
|
// THEN verify the trust granted message shows
|
||||||
verifyIndicationMessage(
|
verifyIndicationMessage(
|
||||||
@@ -1238,7 +1244,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void coEx_faceSuccess_showsPressToOpen() {
|
public void coEx_faceSuccess_showsPressToOpen() {
|
||||||
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, no a11y enabled
|
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, no a11y enabled
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
when(mAccessibilityManager.isEnabled()).thenReturn(false);
|
when(mAccessibilityManager.isEnabled()).thenReturn(false);
|
||||||
@@ -1262,7 +1268,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void coEx_faceSuccess_touchExplorationEnabled_showsFaceUnlockedSwipeToOpen() {
|
public void coEx_faceSuccess_touchExplorationEnabled_showsFaceUnlockedSwipeToOpen() {
|
||||||
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y enabled
|
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y enabled
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
||||||
@@ -1286,7 +1292,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void coEx_faceSuccess_a11yEnabled_showsFaceUnlockedSwipeToOpen() {
|
public void coEx_faceSuccess_a11yEnabled_showsFaceUnlockedSwipeToOpen() {
|
||||||
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y is enabled
|
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y is enabled
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
||||||
@@ -1309,7 +1315,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void faceOnly_faceSuccess_showsFaceUnlockedSwipeToOpen() {
|
public void faceOnly_faceSuccess_showsFaceUnlockedSwipeToOpen() {
|
||||||
// GIVEN bouncer isn't showing, can skip bouncer, no udfps supported
|
// GIVEN bouncer isn't showing, can skip bouncer, no udfps supported
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(false);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(false);
|
||||||
createController();
|
createController();
|
||||||
@@ -1331,7 +1337,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void udfpsOnly_a11yEnabled_showsSwipeToOpen() {
|
public void udfpsOnly_a11yEnabled_showsSwipeToOpen() {
|
||||||
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y is enabled
|
// GIVEN bouncer isn't showing, can skip bouncer, udfps is supported, a11y is enabled
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
when(mAccessibilityManager.isEnabled()).thenReturn(true);
|
||||||
@@ -1351,7 +1357,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void udfpsOnly_showsPressToOpen() {
|
public void udfpsOnly_showsPressToOpen() {
|
||||||
// GIVEN bouncer isn't showing, udfps is supported, a11y is NOT enabled, can skip bouncer
|
// GIVEN bouncer isn't showing, udfps is supported, a11y is NOT enabled, can skip bouncer
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(true);
|
||||||
when(mAccessibilityManager.isEnabled()).thenReturn(false);
|
when(mAccessibilityManager.isEnabled()).thenReturn(false);
|
||||||
@@ -1372,7 +1378,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
// GIVEN bouncer isn't showing, can skip bouncer, no security (udfps isn't supported,
|
// GIVEN bouncer isn't showing, can skip bouncer, no security (udfps isn't supported,
|
||||||
// face wasn't authenticated)
|
// face wasn't authenticated)
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(true);
|
.thenReturn(true);
|
||||||
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(false);
|
when(mKeyguardUpdateMonitor.isUdfpsSupported()).thenReturn(false);
|
||||||
createController();
|
createController();
|
||||||
@@ -1390,7 +1396,7 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
public void cannotSkipBouncer_showSwipeToUnlockHint() {
|
public void cannotSkipBouncer_showSwipeToUnlockHint() {
|
||||||
// GIVEN bouncer isn't showing and cannot skip bouncer
|
// GIVEN bouncer isn't showing and cannot skip bouncer
|
||||||
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
when(mStatusBarKeyguardViewManager.isBouncerShowing()).thenReturn(false);
|
||||||
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(KeyguardUpdateMonitor.getCurrentUser()))
|
when(mKeyguardUpdateMonitor.getUserCanSkipBouncer(getCurrentUser()))
|
||||||
.thenReturn(false);
|
.thenReturn(false);
|
||||||
createController();
|
createController();
|
||||||
mController.setVisible(true);
|
mController.setVisible(true);
|
||||||
@@ -1746,10 +1752,14 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
private void setupFingerprintUnlockPossible(boolean possible) {
|
private void setupFingerprintUnlockPossible(boolean possible) {
|
||||||
when(mKeyguardUpdateMonitor
|
when(mKeyguardUpdateMonitor
|
||||||
.getCachedIsUnlockWithFingerprintPossible(KeyguardUpdateMonitor.getCurrentUser()))
|
.getCachedIsUnlockWithFingerprintPossible(getCurrentUser()))
|
||||||
.thenReturn(possible);
|
.thenReturn(possible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getCurrentUser() {
|
||||||
|
return mCurrentUserId;
|
||||||
|
}
|
||||||
|
|
||||||
private void onFaceLockoutError(String errMsg) {
|
private void onFaceLockoutError(String errMsg) {
|
||||||
mKeyguardUpdateMonitorCallback.onBiometricError(FACE_ERROR_LOCKOUT_PERMANENT,
|
mKeyguardUpdateMonitorCallback.onBiometricError(FACE_ERROR_LOCKOUT_PERMANENT,
|
||||||
errMsg,
|
errMsg,
|
||||||
|
|||||||
Reference in New Issue
Block a user