diff options
| author | 2024-02-02 14:39:33 -0800 | |
|---|---|---|
| committer | 2024-02-02 14:41:00 -0800 | |
| commit | 56ca197ce920fa266dca976ad3a2f2a075d83c0c (patch) | |
| tree | f06c1cae9a9d41248323d974d1aca39516d7d5d3 | |
| parent | 3459cd0e5728c0f29d5c492f4e75a8592d35a8cc (diff) | |
Only notify bubbles if the notification panel expansion has changed
This callback is triggered for a couple of other changes, not just
for the notification panel expansion changing. This CL saves the
previous panel state and only triggers the bubble's callback if the
state was different.
Flag: None
Test: manual - observe logs that we're only notified when it actually
changes
Bug: 323592544
Change-Id: Ic715e8d4774f8c0025cd1d943ed0bf3de129a129
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java index 2acd4b92c5a2..139d190ae63c 100644 --- a/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +++ b/packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java @@ -111,6 +111,7 @@ public class BubblesManager { // TODO (b/145659174): allow for multiple callbacks to support the "shadow" new notif pipeline private final List<NotifCallback> mCallbacks = new ArrayList<>(); private final StatusBarWindowCallback mStatusBarWindowCallback; + private boolean mPanelExpanded; /** * Creates {@link BubblesManager}, returns {@code null} if Optional {@link Bubbles} not present @@ -242,8 +243,12 @@ public class BubblesManager { // Store callback in a field so it won't get GC'd mStatusBarWindowCallback = (keyguardShowing, keyguardOccluded, keyguardGoingAway, bouncerShowing, isDozing, - panelExpanded, isDreaming) -> + panelExpanded, isDreaming) -> { + if (panelExpanded != mPanelExpanded) { + mPanelExpanded = panelExpanded; mBubbles.onNotificationPanelExpandedChanged(panelExpanded); + } + }; notificationShadeWindowController.registerCallback(mStatusBarWindowCallback); mSysuiProxy = new Bubbles.SysuiProxy() { |