Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3f8232f0 authored by Andreas Miko's avatar Andreas Miko
Browse files

Refactor getCurrentUser out of KeyguardViewMediator

KeyguardUpdateMonitor.getCurrentUser() is now removed after all
references were refactored. setCurrentUser() is not used therefore and
just `notifyTrustedChangedLocked()` had to be moved to `onUserSwitching`
 instead. Ideally these calls would listen to a flow of
 getSelectedUserId() such that any change to the user would be reacted
 to instead of relying on `onUserSwitching` callbacks.

Test: Refactored tests
Bug: b/303808405
Bug: b/297839820
Flag: b/305984787 - REFACTOR_GETCURRENTUSER (added in ag/25089323)
Change-Id: I7b1ca0d30f56ad512a5e454e738e8c07ac906e38
parent 61bd8de7
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -535,21 +535,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    @VisibleForTesting
    SparseArray<BiometricAuthenticated> mUserFaceAuthenticated = new SparseArray<>();

    private static int sCurrentUser;

    public synchronized static void setCurrentUser(int 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 SelectedUserInteractor}.
     */
    @Deprecated
    public synchronized static int getCurrentUser() {
        return sCurrentUser;
    }

    @Override
    public void onTrustChanged(boolean enabled, boolean newlyUnlocked, int userId, int flags,
            List<String> trustGrantedMessages) {
+7 −3
Original line number Diff line number Diff line
@@ -76,13 +76,13 @@ import com.android.systemui.SystemUIApplication;
import com.android.systemui.dagger.qualifiers.Application;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.power.shared.model.ScreenPowerState;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindParamsApplier;
import com.android.systemui.keyguard.ui.binder.KeyguardSurfaceBehindViewBinder;
import com.android.systemui.keyguard.ui.binder.WindowManagerLockscreenVisibilityViewBinder;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel;
import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel;
import com.android.systemui.power.domain.interactor.PowerInteractor;
import com.android.systemui.power.shared.model.ScreenPowerState;
import com.android.systemui.settings.DisplayTracker;
import com.android.wm.shell.transition.ShellTransitions;
import com.android.wm.shell.transition.Transitions;
@@ -599,11 +599,15 @@ public class KeyguardService extends Service {
            mKeyguardViewMediator.setSwitchingUser(switching);
        }

        /**
         * @deprecated This binder call is not listened to anymore. Instead the current user is
         * tracked in SelectedUserInteractor.getSelectedUserId()
         */
        @Override // Binder interface
        @Deprecated
        public void setCurrentUser(int userId) {
            trace("setCurrentUser userId=" + userId);
            trace("Deprecated/NOT USED: setCurrentUser userId=" + userId);
            checkPermission();
            mKeyguardViewMediator.setCurrentUser(userId);
        }

        @Override // Binder interface
+37 −42
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.kotlin.JavaAdapter;
import com.android.systemui.util.settings.SecureSettings;
@@ -617,6 +618,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        public void onUserSwitching(int userId) {
            if (DEBUG) Log.d(TAG, String.format("onUserSwitching %d", userId));
            synchronized (KeyguardViewMediator.this) {
                notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(userId));
                resetKeyguardDonePendingLocked();
                dismiss(null /* callback */, null /* message */);
                adjustStatusBarLocked();
@@ -742,7 +744,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        @Override
        public void onBiometricAuthFailed(BiometricSourceType biometricSourceType) {
            final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
            final int currentUser = mSelectedUserInteractor.getSelectedUserId();
            if (mLockPatternUtils.isSecure(currentUser)) {
                mLockPatternUtils.getDevicePolicyManager().reportFailedBiometricAttempt(
                        currentUser);
@@ -760,7 +762,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        @Override
        public void onTrustChanged(int userId) {
            if (userId == KeyguardUpdateMonitor.getCurrentUser()) {
            if (userId == mSelectedUserInteractor.getSelectedUserId()) {
                synchronized (KeyguardViewMediator.this) {
                    notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(userId));
                }
@@ -769,7 +771,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        @Override
        public void onStrongAuthStateChanged(int userId) {
            if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
            if (mLockPatternUtils.isUserInLockdown(mSelectedUserInteractor.getSelectedUserId())) {
                doKeyguardLocked(null);
            }
        }
@@ -784,7 +786,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        @Override
        public void keyguardDone(int targetUserId) {
            if (targetUserId != KeyguardUpdateMonitor.getCurrentUser()) {
            if (targetUserId != mSelectedUserInteractor.getSelectedUserId()) {
                return;
            }
            if (DEBUG) Log.d(TAG, "keyguardDone");
@@ -807,7 +809,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        public void keyguardDonePending(int targetUserId) {
            Trace.beginSection("KeyguardViewMediator.mViewMediatorCallback#keyguardDonePending");
            if (DEBUG) Log.d(TAG, "keyguardDonePending");
            if (targetUserId != KeyguardUpdateMonitor.getCurrentUser()) {
            if (targetUserId != mSelectedUserInteractor.getSelectedUserId()) {
                Trace.endSection();
                return;
            }
@@ -888,7 +890,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        @Override
        public int getBouncerPromptReason() {
            int currentUser = KeyguardUpdateMonitor.getCurrentUser();
            int currentUser = mSelectedUserInteractor.getSelectedUserId();
            boolean trustAgentsEnabled = mUpdateMonitor.isTrustUsuallyManaged(currentUser);
            boolean biometricsEnrolled =
                    mUpdateMonitor.isUnlockingWithBiometricsPossible(currentUser);
@@ -1316,6 +1318,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

    private DeviceConfigProxy mDeviceConfig;
    private DozeParameters mDozeParameters;
    private SelectedUserInteractor mSelectedUserInteractor;

    private final KeyguardStateController mKeyguardStateController;
    private final KeyguardStateController.Callback mKeyguardStateControllerCallback =
@@ -1396,7 +1399,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            @Main CoroutineDispatcher mainDispatcher,
            Lazy<DreamingToLockscreenTransitionViewModel> dreamingToLockscreenTransitionViewModel,
            SystemPropertiesHelper systemPropertiesHelper,
            Lazy<WindowManagerLockscreenVisibilityManager> wmLockscreenVisibilityManager) {
            Lazy<WindowManagerLockscreenVisibilityManager> wmLockscreenVisibilityManager,
            SelectedUserInteractor selectedUserInteractor) {
        mContext = context;
        mUserTracker = userTracker;
        mFalsingCollector = falsingCollector;
@@ -1436,6 +1440,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
                    mInGestureNavigationMode = QuickStepContract.isGesturalMode(mode);
                }));
        mDozeParameters = dozeParameters;
        mSelectedUserInteractor = selectedUserInteractor;

        mStatusBarStateController = statusBarStateController;
        statusBarStateController.addCallback(this);
@@ -1493,14 +1498,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        mAlarmManager = (AlarmManager) mContext.getSystemService(Context.ALARM_SERVICE);

        KeyguardUpdateMonitor.setCurrentUser(mUserTracker.getUserId());

        // Assume keyguard is showing (unless it's disabled) until we know for sure, unless Keyguard
        // is disabled.
        if (isKeyguardServiceEnabled()) {
            setShowingLocked(!shouldWaitForProvisioning()
                    && !mLockPatternUtils.isLockScreenDisabled(
                            KeyguardUpdateMonitor.getCurrentUser()), true /* forceCallbacks */);
                            mSelectedUserInteractor.getSelectedUserId()),
                    true /* forceCallbacks */);
        } else {
            // The system's keyguard is disabled or missing.
            setShowingLocked(false /* showing */, true /* forceCallbacks */);
@@ -1622,11 +1626,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            // Lock immediately based on setting if secure (user has a pin/pattern/password).
            // This also "locks" the device when not secure to provide easy access to the
            // camera while preventing unwanted input.
            int currentUser = KeyguardUpdateMonitor.getCurrentUser();
            int currentUser = mSelectedUserInteractor.getSelectedUserId();
            final boolean lockImmediately =
                    mLockPatternUtils.getPowerButtonInstantlyLocks(currentUser)
                            || !mLockPatternUtils.isSecure(currentUser);
            long timeout = getLockTimeout(KeyguardUpdateMonitor.getCurrentUser());
            long timeout = getLockTimeout(mSelectedUserInteractor.getSelectedUserId());
            mLockLater = false;
            if (mShowing && !mKeyguardStateController.isKeyguardGoingAway()) {
                // If we are going to sleep but the keyguard is showing (and will continue to be
@@ -1807,7 +1811,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    }

    private void doKeyguardLaterLocked() {
        long timeout = getLockTimeout(KeyguardUpdateMonitor.getCurrentUser());
        long timeout = getLockTimeout(mSelectedUserInteractor.getSelectedUserId());
        if (timeout == 0) {
            doKeyguardLocked(null);
        } else {
@@ -1916,7 +1920,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

    private void maybeSendUserPresentBroadcast() {
        if (mSystemReady && mLockPatternUtils.isLockScreenDisabled(
                KeyguardUpdateMonitor.getCurrentUser())) {
                mSelectedUserInteractor.getSelectedUserId())) {
            // Lock screen is disabled because the user has set the preference to "None".
            // In this case, send out ACTION_USER_PRESENT here instead of in
            // handleKeyguardDone()
@@ -1925,7 +1929,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            // Skipping the lockscreen because we're not yet provisioned, but we still need to
            // notify the StrongAuthTracker that it's now safe to run trust agents, in case the
            // user sets a credential later.
            mLockPatternUtils.userPresent(KeyguardUpdateMonitor.getCurrentUser());
            mLockPatternUtils.userPresent(mSelectedUserInteractor.getSelectedUserId());
        }
    }

@@ -1966,7 +1970,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mExternallyEnabled = enabled;

            if (!enabled && mShowing) {
                if (mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
                if (mLockPatternUtils.isUserInLockdown(
                        mSelectedUserInteractor.getSelectedUserId())) {
                    Log.d(TAG, "keyguardEnabled(false) overridden by user lockdown");
                    return;
                }
@@ -2197,7 +2202,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    private void doKeyguardLocked(Bundle options) {
        // if another app is disabling us, don't show
        if (!mExternallyEnabled
                && !mLockPatternUtils.isUserInLockdown(KeyguardUpdateMonitor.getCurrentUser())) {
                && !mLockPatternUtils.isUserInLockdown(
                        mSelectedUserInteractor.getSelectedUserId())) {
            if (DEBUG) Log.d(TAG, "doKeyguard: not showing because externally disabled");

            mNeedToReshowWhenReenabled = true;
@@ -2253,7 +2259,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        }

        boolean forceShow = options != null && options.getBoolean(OPTION_FORCE_SHOW, false);
        if (mLockPatternUtils.isLockScreenDisabled(KeyguardUpdateMonitor.getCurrentUser())
        if (mLockPatternUtils.isLockScreenDisabled(mSelectedUserInteractor.getSelectedUserId())
                && !lockedOrMissing && !forceShow) {
            if (DEBUG) Log.d(TAG, "doKeyguard: not showing because lockscreen is off");
            return;
@@ -2384,7 +2390,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    }

    public boolean isSecure() {
        return isSecure(KeyguardUpdateMonitor.getCurrentUser());
        return isSecure(mSelectedUserInteractor.getSelectedUserId());
    }

    public boolean isSecure(int userId) {
@@ -2411,19 +2417,6 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
        mUpdateMonitor.setSwitchingUser(switching);
    }

    /**
     * Update the newUserId. Call while holding WindowManagerService lock.
     * NOTE: Should only be called by KeyguardViewMediator in response to the user id changing.
     *
     * @param newUserId The id of the incoming user.
     */
    public void setCurrentUser(int newUserId) {
        KeyguardUpdateMonitor.setCurrentUser(newUserId);
        synchronized (this) {
            notifyTrustedChangedLocked(mUpdateMonitor.getUserHasTrust(newUserId));
        }
    }

    /**
     * This broadcast receiver should be registered with the SystemUI permission.
     */
@@ -2605,7 +2598,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     */
    private void handleKeyguardDone() {
        Trace.beginSection("KeyguardViewMediator#handleKeyguardDone");
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        final int currentUser = mSelectedUserInteractor.getSelectedUserId();
        mUiBgExecutor.execute(() -> {
            if (mLockPatternUtils.isSecure(currentUser)) {
                mLockPatternUtils.getDevicePolicyManager().reportKeyguardDismissed(currentUser);
@@ -2631,7 +2624,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    private void sendUserPresentBroadcast() {
        synchronized (this) {
            if (mBootCompleted) {
                int currentUserId = KeyguardUpdateMonitor.getCurrentUser();
                int currentUserId = mSelectedUserInteractor.getSelectedUserId();
                final UserHandle currentUser = new UserHandle(currentUserId);
                final UserManager um = (UserManager) mContext.getSystemService(
                        Context.USER_SERVICE);
@@ -2679,7 +2672,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
    private void playSound(int soundId) {
        if (soundId == 0) return;
        int lockscreenSoundsEnabled = mSystemSettings.getIntForUser(LOCKSCREEN_SOUNDS_ENABLED, 1,
                KeyguardUpdateMonitor.getCurrentUser());
                mSelectedUserInteractor.getSelectedUserId());
        if (lockscreenSoundsEnabled == 1) {

            mLockSounds.stop(mLockSoundStreamId);
@@ -2732,7 +2725,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     */
    private void handleShow(Bundle options) {
        Trace.beginSection("KeyguardViewMediator#handleShow");
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        final int currentUser = mSelectedUserInteractor.getSelectedUserId();
        if (mLockPatternUtils.isSecure(currentUser)) {
            mLockPatternUtils.getDevicePolicyManager().reportKeyguardSecured(currentUser);
        }
@@ -2787,7 +2780,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     * Schedule 4-hour idle timeout for non-strong biometrics when the device is locked
     */
    private void scheduleNonStrongBiometricIdleTimeout() {
        final int currentUser = KeyguardUpdateMonitor.getCurrentUser();
        final int currentUser = mSelectedUserInteractor.getSelectedUserId();
        // If unlocking with non-strong (i.e. weak or convenience) biometrics is possible, schedule
        // 4hr idle timeout after which non-strong biometrics can't be used to unlock device until
        // unlocking with strong biometric or primary auth (i.e. PIN/pattern/password)
@@ -3378,7 +3371,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            if (forceClearFlags) {
                try {
                    mStatusBarService.disableForUser(flags, mStatusBarDisableToken,
                            mContext.getPackageName(), mUserTracker.getUserId());
                            mContext.getPackageName(), mSelectedUserInteractor.getSelectedUserId());
                } catch (RemoteException e) {
                    Log.d(TAG, "Failed to force clear flags", e);
                }
@@ -3405,7 +3398,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

            try {
                mStatusBarService.disableForUser(flags, mStatusBarDisableToken,
                        mContext.getPackageName(), mUserTracker.getUserId());
                        mContext.getPackageName(), mSelectedUserInteractor.getSelectedUserId());
            } catch (RemoteException e) {
                Log.d(TAG, "Failed to set disable flags: " + flags, e);
            }
@@ -3728,7 +3721,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            for (int i = size - 1; i >= 0; i--) {
                IKeyguardStateCallback callback = mKeyguardStateCallbacks.get(i);
                try {
                    callback.onShowingStateChanged(showing, KeyguardUpdateMonitor.getCurrentUser());
                    callback.onShowingStateChanged(showing,
                            mSelectedUserInteractor.getSelectedUserId());
                } catch (RemoteException e) {
                    Slog.w(TAG, "Failed to call onShowingStateChanged", e);
                    if (e instanceof DeadObjectException) {
@@ -3771,10 +3765,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
            mKeyguardStateCallbacks.add(callback);
            try {
                callback.onSimSecureStateChanged(mUpdateMonitor.isSimPinSecure());
                callback.onShowingStateChanged(mShowing, KeyguardUpdateMonitor.getCurrentUser());
                callback.onShowingStateChanged(mShowing,
                        mSelectedUserInteractor.getSelectedUserId());
                callback.onInputRestrictedStateChanged(mInputRestricted);
                callback.onTrustedChanged(mUpdateMonitor.getUserHasTrust(
                        KeyguardUpdateMonitor.getCurrentUser()));
                        mSelectedUserInteractor.getSelectedUserId()));
            } catch (RemoteException e) {
                Slog.w(TAG, "Failed to call to IKeyguardStateCallback", e);
            }
+5 −2
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
import com.android.systemui.statusbar.phone.ScrimController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
import com.android.systemui.user.domain.interactor.SelectedUserInteractor;
import com.android.systemui.util.DeviceConfigProxy;
import com.android.systemui.util.kotlin.JavaAdapter;
import com.android.systemui.util.settings.SecureSettings;
@@ -150,7 +151,8 @@ public class KeyguardModule {
            @Main CoroutineDispatcher mainDispatcher,
            Lazy<DreamingToLockscreenTransitionViewModel> dreamingToLockscreenTransitionViewModel,
            SystemPropertiesHelper systemPropertiesHelper,
            Lazy<WindowManagerLockscreenVisibilityManager> wmLockscreenVisibilityManager) {
            Lazy<WindowManagerLockscreenVisibilityManager> wmLockscreenVisibilityManager,
            SelectedUserInteractor selectedUserInteractor) {
        return new KeyguardViewMediator(
                context,
                uiEventLogger,
@@ -194,7 +196,8 @@ public class KeyguardModule {
                mainDispatcher,
                dreamingToLockscreenTransitionViewModel,
                systemPropertiesHelper,
                wmLockscreenVisibilityManager);
                wmLockscreenVisibilityManager,
                selectedUserInteractor);
    }

    /** */
+10 −14
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
    private @Mock SystemPropertiesHelper mSystemPropertiesHelper;

    private FakeFeatureFlags mFeatureFlags;
    private int mInitialUserId;
    private final int mDefaultUserId = 100;

    @Before
    public void setUp() throws Exception {
@@ -269,12 +269,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        }).when(mKeyguardStateController).notifyKeyguardGoingAway(anyBoolean());

        createAndStartViewMediator();
        mInitialUserId = KeyguardUpdateMonitor.getCurrentUser();
    }

    @After
    public void teardown() {
        KeyguardUpdateMonitor.setCurrentUser(mInitialUserId);
        when(mSelectedUserInteractor.getSelectedUserId()).thenReturn(mDefaultUserId);
    }

    /**
@@ -454,7 +449,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        mViewMediator.setKeyguardEnabled(false);
        TestableLooper.get(this).processAllMessages();

        mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mDefaultUserId);
        mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
        final ArgumentCaptor<Runnable> animationRunnableCaptor =
                ArgumentCaptor.forClass(Runnable.class);
@@ -620,8 +615,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
    public void lockAfterScreenTimeoutUsesValueFromSettings() {
        int currentUserId = 99;
        int userSpecificTimeout = 5999;
        KeyguardUpdateMonitor.setCurrentUser(currentUserId);

        when(mSelectedUserInteractor.getSelectedUserId()).thenReturn(currentUserId);
        when(mKeyguardStateController.isKeyguardGoingAway()).thenReturn(false);
        when(mDevicePolicyManager.getMaximumTimeToLock(null, currentUserId)).thenReturn(0L);
        when(mSecureSettings.getIntForUser(LOCK_SCREEN_LOCK_AFTER_TIMEOUT,
@@ -721,7 +716,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        startMockKeyguardExitAnimation();
        assertTrue(mViewMediator.isAnimatingBetweenKeyguardAndSurfaceBehind());

        mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mDefaultUserId);
        mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
        TestableLooper.get(this).processAllMessages();
        verify(mKeyguardUnlockAnimationController).notifyFinishedKeyguardExitAnimation(false);
@@ -785,7 +780,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {

        // Verify keyguard told of authentication
        verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mDefaultUserId);
        mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
        final ArgumentCaptor<Runnable> animationRunnableCaptor =
                ArgumentCaptor.forClass(Runnable.class);
@@ -817,7 +812,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        // Verify keyguard told of authentication
        verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
        clearInvocations(mStatusBarKeyguardViewManager);
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mDefaultUserId);
        mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
        final ArgumentCaptor<Runnable> animationRunnableCaptor =
                ArgumentCaptor.forClass(Runnable.class);
@@ -847,7 +842,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {

        // Verify keyguard told of authentication
        verify(mStatusBarKeyguardViewManager).notifyKeyguardAuthenticated(anyBoolean());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mUpdateMonitor.getCurrentUser());
        mViewMediator.mViewMediatorCallback.keyguardDonePending(mDefaultUserId);
        mViewMediator.mViewMediatorCallback.readyForKeyguardDone();
        final ArgumentCaptor<Runnable> animationRunnableCaptor =
                ArgumentCaptor.forClass(Runnable.class);
@@ -1114,7 +1109,8 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
                mDispatcher,
                () -> mDreamingToLockscreenTransitionViewModel,
                mSystemPropertiesHelper,
                () -> mock(WindowManagerLockscreenVisibilityManager.class));
                () -> mock(WindowManagerLockscreenVisibilityManager.class),
                mSelectedUserInteractor);
        mViewMediator.start();

        mViewMediator.registerCentralSurfaces(mCentralSurfaces, null, null, null, null, null);