Loading services/core/java/com/android/server/notification/NotificationHistoryManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class NotificationHistoryManager { for (int i = 0; i < pendingPackageRemovals.size(); i++) { userHistory.onPackageRemoved(pendingPackageRemovals.get(i)); } mUserPendingPackageRemovals.put(userId, null); mUserPendingPackageRemovals.remove(userId); } // delete history if it was disabled when the user was locked Loading @@ -133,7 +133,7 @@ public class NotificationHistoryManager { synchronized (mLock) { // Actual data deletion is handled by other parts of the system (the entire directory is // removed) - we just need clean up our internal state for GC mUserPendingPackageRemovals.put(userId, null); mUserPendingPackageRemovals.remove(userId); mHistoryEnabled.put(userId, false); mUserPendingHistoryDisables.put(userId, false); onUserStopped(userId); Loading services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,6 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase { assertThat(mHistoryManager.doesHistoryExistForUser(mProfileId)).isFalse(); verify(mDb, times(2)).disableHistory(); } @Test public void testAddProfile_historyEnabledInPrimary() { // create a history Loading Loading @@ -610,4 +609,14 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase { assertThat(mHistoryManager.isHistoryEnabled(USER_SYSTEM)).isFalse(); } @Test public void testDelayedPackageRemoval_userLocked() { String pkg = "pkg"; mHistoryManager.onPackageRemoved(USER_SYSTEM, pkg); mHistoryManager.onUserUnlocked(USER_SYSTEM); mHistoryManager.onUserStopped(USER_SYSTEM); mHistoryManager.onPackageRemoved(USER_SYSTEM, pkg); // no exception, yay } } Loading
services/core/java/com/android/server/notification/NotificationHistoryManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class NotificationHistoryManager { for (int i = 0; i < pendingPackageRemovals.size(); i++) { userHistory.onPackageRemoved(pendingPackageRemovals.get(i)); } mUserPendingPackageRemovals.put(userId, null); mUserPendingPackageRemovals.remove(userId); } // delete history if it was disabled when the user was locked Loading @@ -133,7 +133,7 @@ public class NotificationHistoryManager { synchronized (mLock) { // Actual data deletion is handled by other parts of the system (the entire directory is // removed) - we just need clean up our internal state for GC mUserPendingPackageRemovals.put(userId, null); mUserPendingPackageRemovals.remove(userId); mHistoryEnabled.put(userId, false); mUserPendingHistoryDisables.put(userId, false); onUserStopped(userId); Loading
services/tests/uiservicestests/src/com/android/server/notification/NotificationHistoryManagerTest.java +10 −1 Original line number Diff line number Diff line Loading @@ -183,7 +183,6 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase { assertThat(mHistoryManager.doesHistoryExistForUser(mProfileId)).isFalse(); verify(mDb, times(2)).disableHistory(); } @Test public void testAddProfile_historyEnabledInPrimary() { // create a history Loading Loading @@ -610,4 +609,14 @@ public class NotificationHistoryManagerTest extends UiServiceTestCase { assertThat(mHistoryManager.isHistoryEnabled(USER_SYSTEM)).isFalse(); } @Test public void testDelayedPackageRemoval_userLocked() { String pkg = "pkg"; mHistoryManager.onPackageRemoved(USER_SYSTEM, pkg); mHistoryManager.onUserUnlocked(USER_SYSTEM); mHistoryManager.onUserStopped(USER_SYSTEM); mHistoryManager.onPackageRemoved(USER_SYSTEM, pkg); // no exception, yay } }