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

Commit 586ccacd authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Add null check and logging

Test: NotificationLockscreenUserManagerTest
Fixes: 318474841
Change-Id: If37a957097940adafdb0c61894ef18268adab5a0
parent d4d7ee5d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -275,7 +275,12 @@ public class NotificationLockscreenUserManagerImpl implements

                    updateLockscreenNotificationSetting();
                    updatePublicMode();
                    if (mPresenter != null) {
                        mPresenter.onUserSwitched(mCurrentUserId);
                    } else {
                        Log.w(TAG, "user switch before setup with presenter",
                                new Exception());
                    }

                    for (UserChangedListener listener : mListeners) {
                        listener.onUserChanged(mCurrentUserId);
+11 −0
Original line number Diff line number Diff line
@@ -596,6 +596,17 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase {
        verify(mDevicePolicyManager, atMost(1)).getKeyguardDisabledFeatures(any(), anyInt());
    }

    @Test
    @EnableFlags(FLAG_KEYGUARD_PRIVATE_NOTIFICATIONS)
    public void testEarlyUserSwitch() {
        mLockscreenUserManager =
                new TestNotificationLockscreenUserManager(mContext);
        mBackgroundExecutor.runAllReady();
        mLockscreenUserManager.mUserChangedCallback.onUserChanging(
                mCurrentUser.id, mContext);
        // no crash!
    }

    @Test
    @EnableFlags(FLAG_KEYGUARD_PRIVATE_NOTIFICATIONS)
    public void testKeyguardManager_noPrivateNotifications() {