summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Reynolds <juliacr@google.com> 2016-03-03 22:08:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-03-03 22:08:54 +0000
commita87e9bc0b34585e36175236893ae6720a0f69e4e (patch)
tree283265dfa804e7a33245c5a84d4f1b7cf543b941
parent139bc62117f01d228a6beb18d98755c2fcf60bbf (diff)
parent0dbb7310088fdf2845861d2dc0e271812083e273 (diff)
Merge "Only noisy notifications can be bumped for intrusiveness." into nyc-dev
-rw-r--r--services/core/java/com/android/server/notification/NotificationIntrusivenessExtractor.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationIntrusivenessExtractor.java b/services/core/java/com/android/server/notification/NotificationIntrusivenessExtractor.java
index b57cc75ebf13..bcdeb666987f 100644
--- a/services/core/java/com/android/server/notification/NotificationIntrusivenessExtractor.java
+++ b/services/core/java/com/android/server/notification/NotificationIntrusivenessExtractor.java
@@ -23,7 +23,7 @@ import android.util.Log;
import android.util.Slog;
/**
- * This {@link com.android.server.notification.NotificationSignalExtractor} noticies noisy
+ * This {@link com.android.server.notification.NotificationSignalExtractor} notices noisy
* notifications and marks them to get a temporary ranking bump.
*/
public class NotificationIntrusivenessExtractor implements NotificationSignalExtractor {
@@ -44,9 +44,15 @@ public class NotificationIntrusivenessExtractor implements NotificationSignalExt
return null;
}
- final Notification notification = record.getNotification();
- if (record.getImportance() > NotificationListenerService.Ranking.IMPORTANCE_DEFAULT) {
- record.setRecentlyIntrusive(true);
+ if (record.getImportance() >= NotificationListenerService.Ranking.IMPORTANCE_DEFAULT) {
+ final Notification notification = record.getNotification();
+ if ((notification.defaults & Notification.DEFAULT_VIBRATE) != 0 ||
+ notification.vibrate != null ||
+ (notification.defaults & Notification.DEFAULT_SOUND) != 0 ||
+ notification.sound != null ||
+ notification.fullScreenIntent != null) {
+ record.setRecentlyIntrusive(true);
+ }
}
return new RankingReconsideration(record.getKey(), HANG_TIME_MS) {