Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +6 −1 Original line number Diff line number Diff line Loading @@ -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); Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -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() { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +6 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -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() { Loading