Merge "Test to null-check NotificationEntryManager.performRemoveNotification()"
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
index cad1a96..79bc0a3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
@@ -521,6 +521,16 @@
verify(extender2).setShouldManageLifetime(mEntry, false);
}
+ /**
+ * Ensure that calling NotificationEntryManager.performRemoveNotification() doesn't crash when
+ * given a notification that has already been removed from NotificationData.
+ */
+ @Test
+ public void testPerformRemoveNotification_removedEntry() {
+ mEntryManager.getNotificationData().remove(mSbn.getKey(), null /* ranking */);
+ mEntryManager.performRemoveNotification(mSbn);
+ }
+
private Notification.Action createAction() {
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),