diff options
| author | 2016-08-15 19:39:55 -0700 | |
|---|---|---|
| committer | 2016-08-16 17:19:14 +0000 | |
| commit | 80c44dd800d2ef03446152495b7ef3c486f1be90 (patch) | |
| tree | 296d096beb0a54a0cb45274fc0ae6f9e67070bae | |
| parent | 60ab8d072af5947d8ebaaa8c8d0f2ad6b82bd34c (diff) | |
Fixed a bug where the summary could become visible even if it was suppressed
Because the updating of the suppression was prohibited, some groups could loose
their suppression state when they were heads upped. This would lead to duplicate
notifications. We're now still allowing the state to be properly modified instead
but don't notify listeners anymore since that was only an internal update.
Change-Id: I6ae96ea8cfab00ef6bdb1ef047f8b77ea88e8206
Fixes: 30608517
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java index 1755cc68bee2..2c8339a1dc22 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationGroupManager.java @@ -42,7 +42,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged private int mBarState = -1; private HashMap<String, StatusBarNotification> mIsolatedEntries = new HashMap<>(); private HeadsUpManager mHeadsUpManager; - private boolean mUpdatingSuppressionBlocked; + private boolean mIsUpdatingUnchangedGroup; public void setOnGroupChangeListener(OnGroupChangeListener listener) { mListener = listener; @@ -141,7 +141,7 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged } private void updateSuppression(NotificationGroup group) { - if (group == null || mUpdatingSuppressionBlocked) { + if (group == null) { return; } boolean prevSuppressed = group.suppressed; @@ -154,7 +154,9 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged if (group.suppressed) { handleSuppressedSummaryHeadsUpped(group.summary); } - mListener.onGroupsChanged(); + if (!mIsUpdatingUnchangedGroup) { + mListener.onGroupsChanged(); + } } } @@ -188,12 +190,12 @@ public class NotificationGroupManager implements HeadsUpManager.OnHeadsUpChanged boolean groupKeysChanged = !oldKey.equals(newKey); boolean wasGroupChild = isGroupChild(oldNotification); boolean isGroupChild = isGroupChild(entry.notification); - mUpdatingSuppressionBlocked = !groupKeysChanged && wasGroupChild == isGroupChild; + mIsUpdatingUnchangedGroup = !groupKeysChanged && wasGroupChild == isGroupChild; if (mGroupMap.get(getGroupKey(oldNotification)) != null) { onEntryRemovedInternal(entry, oldNotification); } onEntryAdded(entry); - mUpdatingSuppressionBlocked = false; + mIsUpdatingUnchangedGroup = false; if (isIsolated(entry.notification)) { mIsolatedEntries.put(entry.key, entry.notification); if (groupKeysChanged) { |