From 92d75db863c6ed6801dfa76cec3b298c50e4957a Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Wed, 31 Aug 2022 13:36:07 -0400 Subject: [PATCH 1/2] Remove unused BubblesManager#maybeCancelSummary() Bug: 145659174 Test: atest SystemUITests Change-Id: Ibeee6718452e2c0fbff3a5dd611c535ff90f59d2 --- .../wm/shell/bubbles/BubbleController.java | 12 ---------- .../com/android/wm/shell/bubbles/Bubbles.java | 2 -- .../coordinator/BubbleCoordinator.java | 5 ----- .../systemui/wmshell/BubblesManager.java | 22 ------------------- 4 files changed, 41 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 d63c25d074855..525026aad023f 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 @@ -1336,19 +1336,7 @@ public class BubbleController implements ConfigurationChangeListener { } mSysuiProxy.updateNotificationBubbleButton(bubble.getKey()); } - } - mSysuiProxy.getPendingOrActiveEntry(bubble.getKey(), (entry) -> { - mMainExecutor.execute(() -> { - if (entry != null) { - final String groupKey = entry.getStatusBarNotification().getGroupKey(); - if (getBubblesInGroup(groupKey).isEmpty()) { - // Time to potentially remove the summary - mSysuiProxy.notifyMaybeCancelSummary(bubble.getKey()); - } - } - }); - }); } mDataRepository.removeBubbles(mCurrentUserId, bubblesToBeRemovedFromRepository); 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 453b34eb445c4..b3104b5184402 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 @@ -276,8 +276,6 @@ public interface Bubbles { void notifyInvalidateNotifications(String reason); - void notifyMaybeCancelSummary(String key); - void updateNotificationBubbleButton(String key); void onStackExpandChanged(boolean shouldExpand); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java index 3627b4084ec74..52f4c1cd054b7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/BubbleCoordinator.java @@ -144,11 +144,6 @@ public class BubbleCoordinator implements Coordinator { public void invalidateNotifications(String reason) { mNotifFilter.invalidateList(reason); } - - @Override - public void maybeCancelSummary(NotificationEntry entry) { - // no-op - } }; private boolean isInterceptingDismissal(NotificationEntry entry) { diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java index 8c41374fd058e..4e77514645645 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java @@ -310,18 +310,6 @@ public class BubblesManager { }); } - @Override - public void notifyMaybeCancelSummary(String key) { - sysuiMainExecutor.execute(() -> { - final NotificationEntry entry = mCommonNotifCollection.getEntry(key); - if (entry != null) { - for (NotifCallback cb : mCallbacks) { - cb.maybeCancelSummary(entry); - } - } - }); - } - @Override public void updateNotificationBubbleButton(String key) { sysuiMainExecutor.execute(() -> { @@ -646,15 +634,5 @@ public class BubblesManager { * filtered from the shade. */ void invalidateNotifications(@NonNull String reason); - - /** - * Called on a bubbled entry that has been removed when there are no longer - * bubbled entries in its group. - * - * Checks whether its group has any other (non-bubbled) children. If it doesn't, - * removes all remnants of the group's summary from the notification pipeline. - * TODO: (b/145659174) Only old pipeline needs this - delete post-migration. - */ - void maybeCancelSummary(@NonNull NotificationEntry entry); } } From 9410a384a4354162dd406cbc898e58a665c8b05d Mon Sep 17 00:00:00 2001 From: Steve Elliott Date: Wed, 31 Aug 2022 13:39:24 -0400 Subject: [PATCH 2/2] Remove NSSL#isChildInInvisibleGroup This method has been made irrelevant with the new pipeline; Notification that would return "true" here are now pruned from the NSSL entirely by the ShadeListBuilder, so this method will always return false. Bug: 145659174 Test: atest SystemUITests Change-Id: I65d67bf90084e704b41774404c83e40200b0331a --- .../stack/NotificationStackScrollLayout.java | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 1fb265fea0b11..8b322fcdb8782 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -2794,10 +2794,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (mDebugRemoveAnimation) { Log.d(TAG, "generateRemove " + key + "\nmIsExpanded " + mIsExpanded - + "\nmAnimationsEnabled " + mAnimationsEnabled - + "\n!invisible group " + !isChildInInvisibleGroup(child)); + + "\nmAnimationsEnabled " + mAnimationsEnabled); } - if (mIsExpanded && mAnimationsEnabled && !isChildInInvisibleGroup(child)) { + if (mIsExpanded && mAnimationsEnabled) { if (!mChildrenToAddAnimated.contains(child)) { if (mDebugRemoveAnimation) { Log.d(TAG, "needsAnimation = true " + key); @@ -2845,26 +2844,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable return hasAddEvent && mAddedHeadsUpChildren.contains(child); } - // TODO (b/162832756): remove since this won't happen in new pipeline (we prune groups in - // ShadeListBuilder) - /** - * @param child the child to query - * @return whether a view is not a top level child but a child notification and that group is - * not expanded - */ - @ShadeViewRefactor(RefactorComponent.ADAPTER) - private boolean isChildInInvisibleGroup(View child) { - if (child instanceof ExpandableNotificationRow) { - ExpandableNotificationRow row = (ExpandableNotificationRow) child; - NotificationEntry groupSummary = - mGroupMembershipManager.getGroupSummary(row.getEntry()); - if (groupSummary != null && groupSummary.getRow() != row) { - return row.getVisibility() == View.INVISIBLE; - } - } - return false; - } - /** * Updates the scroll position when a child was removed *