Apply Zen Mode later, after we've found the old record.
Copy the extracted signales from the previous record to the new record. Do this before the signal extractors are called so that code can decide what to do with the information. Bug: 15383769 Change-Id: Ifa24fa0e4380f08979c2126b63d29794aa50a787
This commit is contained in:
@ -1486,6 +1486,11 @@ public class NotificationManagerService extends SystemService {
|
||||
pkg, opPkg, id, tag, callingUid, callingPid, score, notification,
|
||||
user);
|
||||
NotificationRecord r = new NotificationRecord(n);
|
||||
NotificationRecord old = mNotificationsByKey.get(n.getKey());
|
||||
if (old != null) {
|
||||
// Retain ranking information from previous record
|
||||
r.copyRankingInformation(old);
|
||||
}
|
||||
if (!mSignalExtractors.isEmpty()) {
|
||||
for (NotificationSignalExtractor extractor : mSignalExtractors) {
|
||||
try {
|
||||
@ -1514,15 +1519,6 @@ public class NotificationManagerService extends SystemService {
|
||||
}
|
||||
|
||||
synchronized (mNotificationList) {
|
||||
applyZenModeLocked(r);
|
||||
|
||||
// Should this notification make noise, vibe, or use the LED?
|
||||
final boolean canInterrupt = (score >= SCORE_INTERRUPTION_THRESHOLD) &&
|
||||
!r.isIntercepted();
|
||||
if (DBG || r.isIntercepted()) Slog.v(TAG,
|
||||
"pkg=" + pkg + " canInterrupt=" + canInterrupt +
|
||||
" intercept=" + r.isIntercepted());
|
||||
NotificationRecord old = null;
|
||||
int index = indexOfNotificationLocked(n.getKey());
|
||||
if (index < 0) {
|
||||
mNotificationList.add(r);
|
||||
@ -1534,12 +1530,18 @@ public class NotificationManagerService extends SystemService {
|
||||
// Make sure we don't lose the foreground service state.
|
||||
notification.flags |=
|
||||
old.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE;
|
||||
// Retain ranking information from previous record
|
||||
r.copyRankingInformation(old);
|
||||
mNotificationsByKey.remove(old.sbn.getKey());
|
||||
}
|
||||
mNotificationsByKey.put(n.getKey(), r);
|
||||
|
||||
applyZenModeLocked(r);
|
||||
// Should this notification make noise, vibe, or use the LED?
|
||||
final boolean canInterrupt = (score >= SCORE_INTERRUPTION_THRESHOLD) &&
|
||||
!r.isIntercepted();
|
||||
if (DBG || r.isIntercepted()) Slog.v(TAG,
|
||||
"pkg=" + pkg + " canInterrupt=" + canInterrupt +
|
||||
" intercept=" + r.isIntercepted());
|
||||
|
||||
Collections.sort(mNotificationList, mRankingComparator);
|
||||
|
||||
// Ensure if this is a foreground service that the proper additional
|
||||
|
Reference in New Issue
Block a user