diff options
| author | 2016-05-02 16:19:14 -0400 | |
|---|---|---|
| committer | 2016-05-02 16:21:24 -0400 | |
| commit | 8a1638f66a79dbf471e7e53294ba853b862434e6 (patch) | |
| tree | 7e4f83973bde167ecc4a9759f2180412c09178ed | |
| parent | dbe2dbae994f787ecffda5f81764b3daf7c45ba0 (diff) | |
copy auto-group decisions to updates
The rocket runs too late to affect auto-grouping for updates before
the UI reacts to the group change, so make sure it stays the same
until the rocket has an opportunity to reconsider.
Bug: 28517296
Change-Id: I16a0509cac06912c8b3139f06474f312207f9f8c
4 files changed, 17 insertions, 4 deletions
diff --git a/core/java/android/service/notification/StatusBarNotification.java b/core/java/android/service/notification/StatusBarNotification.java index 0221b66a8916..291312862780 100644 --- a/core/java/android/service/notification/StatusBarNotification.java +++ b/core/java/android/service/notification/StatusBarNotification.java @@ -143,8 +143,18 @@ public class StatusBarNotification implements Parcelable { * Returns true if this notification is part of a group. */ public boolean isGroup() { - if (overrideGroupKey != null || getNotification().getGroup() != null - || getNotification().getSortKey() != null) { + if (overrideGroupKey != null || isAppGroup()) { + return true; + } + return false; + } + + /** + * Returns true if application asked that this notification be part of a group. + * @hide + */ + public boolean isAppGroup() { + if (getNotification().getGroup() != null || getNotification().getSortKey() != null) { return true; } return false; diff --git a/packages/ExtServices/src/android/ext/services/notification/Ranker.java b/packages/ExtServices/src/android/ext/services/notification/Ranker.java index fefedf8fc487..f3ce35566cc0 100644 --- a/packages/ExtServices/src/android/ext/services/notification/Ranker.java +++ b/packages/ExtServices/src/android/ext/services/notification/Ranker.java @@ -59,7 +59,7 @@ public final class Ranker extends NotificationRankerService { if (DEBUG) Log.i(TAG, "POSTED " + sbn.getKey()); try { List<String> notificationsToBundle = new ArrayList<>(); - if (!sbn.isGroup()) { + if (!sbn.isAppGroup()) { // Not grouped by the app, add to the list of notifications for the app; // send bundling update if app exceeds the autobundling limit. synchronized (mUnbundledNotifications) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 6fc32de100e2..57c012b24e5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2948,7 +2948,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } public void topAppWindowChanged(boolean showMenu) { - if (DEBUG) { + if (SPEW) { Log.d(TAG, (showMenu?"showing":"hiding") + " the MENU button"); } if (mNavigationBarView != null) { diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index f29970cad181..1315bcbce278 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -176,6 +176,9 @@ public final class NotificationRecord { mRankingTimeMs = calculateRankingTimeMs(previous.getRankingTimeMs()); mCreationTimeMs = previous.mCreationTimeMs; mVisibleSinceMs = previous.mVisibleSinceMs; + if(previous.sbn.getOverrideGroupKey() != null) { + sbn.setOverrideGroupKey(previous.sbn.getOverrideGroupKey()); + } // Don't copy importance information or mGlobalSortKey, recompute them. } |