Merge "Only noisy notifications can be bumped for intrusiveness." into nyc-dev

am: a87e9bc0b3

* commit 'a87e9bc0b34585e36175236893ae6720a0f69e4e':
  Only noisy notifications can be bumped for intrusiveness.
This commit is contained in:
Julia Reynolds
2016-03-03 22:21:48 +00:00
committed by android-build-merger

View File

@@ -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) {