Clear mIdToBundleEntry in setBundler

Bug: 396301289
Test: adb
Flag: com.android.systemui.notification_bundle_ui
Change-Id: Ie18d5f992871b8dda3803286dd4e98882cb7baae
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
index 59fe428..21dcbfe 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/ShadeListBuilder.java
@@ -282,16 +282,14 @@
         Assert.isMainThread();
         mPipelineState.requireState(STATE_IDLE);
 
-        // TODO(b/396301289) throw exception when setting more than once?
         mNotifBundler = bundler;
+        if (mNotifBundler == null) {
+            throw new IllegalStateException(TAG + ".setBundler: null");
+        }
 
-        if (mIdToBundleEntry.isEmpty()) {
-            if (mNotifBundler == null) {
-                throw new IllegalStateException("NotifBundler not attached.");
-            }
-            for (String id: mNotifBundler.getBundleIds()) {
-                mIdToBundleEntry.put(id, new BundleEntry(id));
-            }
+        mIdToBundleEntry.clear();
+        for (String id: mNotifBundler.getBundleIds()) {
+            mIdToBundleEntry.put(id, new BundleEntry(id));
         }
     }