diff options
| author | 2014-08-03 20:12:28 +0200 | |
|---|---|---|
| committer | 2014-08-04 12:54:21 +0200 | |
| commit | ce2e23ff69427a069cbdcd6bf4fa6097cbf04b4d (patch) | |
| tree | 2ba00f50a9554dddffa378523d59ce568ec3c5b5 | |
| parent | e5aa75cabfb6bb4877e1bb20cb0dfe511002c3a4 (diff) | |
NoMan: Fix speedbump when no low-prio notifs
Bug: 16705179
Change-Id: I32329710c27052c35b64ba91759200341ed0b127
| -rw-r--r-- | core/java/android/service/notification/NotificationListenerService.java | 6 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index 1f01bc843b29..f807ad655ca5 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -609,8 +609,12 @@ public abstract class NotificationListenerService extends Service { } private boolean isAmbient(String key) { + int firstAmbientIndex = mRankingUpdate.getFirstAmbientIndex(); + if (firstAmbientIndex < 0) { + return false; + } int rank = getRank(key); - return rank >= 0 && rank >= mRankingUpdate.getFirstAmbientIndex(); + return rank >= 0 && rank >= firstAmbientIndex; } private boolean isIntercepted(String key) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 03508eaa4a80..15a92861688c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1422,8 +1422,7 @@ public abstract class BaseStatusBar extends SystemUI implements } private boolean shouldShowOnKeyguard(StatusBarNotification sbn) { - return mShowLockscreenNotifications && - sbn.getNotification().priority >= Notification.PRIORITY_LOW; + return mShowLockscreenNotifications && !mNotificationData.isAmbient(sbn.getKey()); } protected void setZenMode(int mode) { |