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

Commit a09ffc51 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Add null check and logging" into main

parents ce37a7f9 586ccacd
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() {