From 9e0b961c128e7fb5d7b16519bac61af934eec5cb Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Tue, 23 Aug 2022 15:30:46 -0400 Subject: [PATCH] Remove NotifGroupManagerLegacy usage from Bubbles Bug: 200269355 Test: atest SystemUITests Change-Id: If996315ae55f9f5b13159345b01bcea8f07a0ba4 --- .../wm/shell/bubbles/BubbleController.java | 4 --- .../com/android/wm/shell/bubbles/Bubbles.java | 4 --- .../systemui/dagger/SystemUIModule.java | 4 --- .../systemui/wmshell/BubblesManager.java | 31 +++---------------- .../android/systemui/wmshell/BubblesTest.java | 4 --- 5 files changed, 4 insertions(+), 43 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index dcbb272feab8c..d63c25d074855 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -1387,9 +1387,6 @@ public class BubbleController implements ConfigurationChangeListener { if (update.selectionChanged && mStackView != null) { mStackView.setSelectedBubble(update.selectedBubble); - if (update.selectedBubble != null) { - mSysuiProxy.updateNotificationSuppression(update.selectedBubble.getKey()); - } } // Expanding? Apply this last. @@ -1448,7 +1445,6 @@ public class BubbleController implements ConfigurationChangeListener { // in the shade, it is essentially removed. Bubble bubbleChild = mBubbleData.getAnyBubbleWithkey(child.getKey()); if (bubbleChild != null) { - mSysuiProxy.removeNotificationEntry(bubbleChild.getKey()); bubbleChild.setSuppressNotification(true); bubbleChild.setShowDot(false /* show */); } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java index 0e97e9e74114e..453b34eb445c4 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java @@ -278,12 +278,8 @@ public interface Bubbles { void notifyMaybeCancelSummary(String key); - void removeNotificationEntry(String key); - void updateNotificationBubbleButton(String key); - void updateNotificationSuppression(String key); - void onStackExpandChanged(boolean shouldExpand); void onManageMenuExpandChanged(boolean menuExpanded); diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java index e549a96079bd1..6399d9c44c7cb 100644 --- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java @@ -61,7 +61,6 @@ import com.android.systemui.statusbar.QsFrameTranslateModule; import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinder; import com.android.systemui.statusbar.notification.collection.inflation.NotificationRowBinderImpl; -import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; @@ -219,11 +218,9 @@ public abstract class SystemUIModule { NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, - NotificationGroupManagerLegacy groupManager, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, - DumpManager dumpManager, @Main Executor sysuiMainExecutor) { return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, @@ -237,7 +234,6 @@ public abstract class SystemUIModule { interruptionStateProvider, zenModeController, notifUserManager, - groupManager, notifCollection, notifPipeline, sysUiState, diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java index 199048ec7b2e0..ce9674175bd5c 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java @@ -62,7 +62,6 @@ import com.android.systemui.statusbar.notification.collection.NotifCollection; import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.coordinator.BubbleCoordinator; -import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.notifcollection.DismissedByUserStats; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; @@ -103,7 +102,6 @@ public class BubblesManager { private final NotificationVisibilityProvider mVisibilityProvider; private final NotificationInterruptStateProvider mNotificationInterruptStateProvider; private final NotificationLockscreenUserManager mNotifUserManager; - private final NotificationGroupManagerLegacy mNotificationGroupManager; private final CommonNotifCollection mCommonNotifCollection; private final NotifPipeline mNotifPipeline; private final Executor mSysuiMainExecutor; @@ -130,7 +128,6 @@ public class BubblesManager { NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, - NotificationGroupManagerLegacy groupManager, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, @@ -148,7 +145,6 @@ public class BubblesManager { interruptionStateProvider, zenModeController, notifUserManager, - groupManager, notifCollection, notifPipeline, sysUiState, @@ -171,7 +167,6 @@ public class BubblesManager { NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, - NotificationGroupManagerLegacy groupManager, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, @@ -185,7 +180,6 @@ public class BubblesManager { mVisibilityProvider = visibilityProvider; mNotificationInterruptStateProvider = interruptionStateProvider; mNotifUserManager = notifUserManager; - mNotificationGroupManager = groupManager; mCommonNotifCollection = notifCollection; mNotifPipeline = notifPipeline; mSysuiMainExecutor = sysuiMainExecutor; @@ -330,16 +324,6 @@ public class BubblesManager { }); } - @Override - public void removeNotificationEntry(String key) { - sysuiMainExecutor.execute(() -> { - final NotificationEntry entry = mCommonNotifCollection.getEntry(key); - if (entry != null) { - mNotificationGroupManager.onEntryRemoved(entry); - } - }); - } - @Override public void updateNotificationBubbleButton(String key) { sysuiMainExecutor.execute(() -> { @@ -350,16 +334,6 @@ public class BubblesManager { }); } - @Override - public void updateNotificationSuppression(String key) { - sysuiMainExecutor.execute(() -> { - final NotificationEntry entry = mCommonNotifCollection.getEntry(key); - if (entry != null) { - mNotificationGroupManager.updateSuppression(entry); - } - }); - } - @Override public void onStackExpandChanged(boolean shouldExpand) { sysuiMainExecutor.execute(() -> { @@ -532,7 +506,10 @@ public class BubblesManager { REASON_GROUP_SUMMARY_CANCELED); } } else { - mNotificationGroupManager.onEntryRemoved(entry); + for (NotifCallback cb : mCallbacks) { + cb.removeNotification(entry, getDismissedByUserStats(entry, true), + REASON_GROUP_SUMMARY_CANCELED); + } } }, mSysuiMainExecutor); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 5d63632725c22..09da52e7685c8 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -99,7 +99,6 @@ import com.android.systemui.statusbar.notification.NotifPipelineFlags; import com.android.systemui.statusbar.notification.collection.NotifPipeline; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; -import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy; import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection; import com.android.systemui.statusbar.notification.collection.notifcollection.NotifCollectionListener; import com.android.systemui.statusbar.notification.collection.render.NotificationVisibilityProvider; @@ -162,8 +161,6 @@ public class BubblesTest extends SysuiTestCase { @Mock private CommonNotifCollection mCommonNotifCollection; @Mock - private NotificationGroupManagerLegacy mNotificationGroupManager; - @Mock private BubblesManager.NotifCallback mNotifCallback; @Mock private WindowManager mWindowManager; @@ -389,7 +386,6 @@ public class BubblesTest extends SysuiTestCase { interruptionStateProvider, mZenModeController, mLockscreenUserManager, - mNotificationGroupManager, mCommonNotifCollection, mNotifPipeline, mSysUiState,