From 649924d030929a484053f9d432dce3931668a541 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Tue, 14 Feb 2017 14:28:54 +0100 Subject: [PATCH] AOD: Show High notifications on AOD Previously, it was only Urgent. Bug: 30876804 Test: Receive notification that is high, but does not peek (e.g. Gmail) while screen is off. Verify it shows on Ambient Display Change-Id: I9233a96abbc55a54dc5fab81ad79ee0980a0a035 --- .../src/com/android/systemui/statusbar/phone/StatusBar.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 365d991651214..a0dfd987a9743 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -6926,7 +6926,10 @@ public class StatusBar extends SystemUI implements DemoMode, return false; } - if (mNotificationData.getImportance(sbn.getKey()) < NotificationManager.IMPORTANCE_HIGH) { + // Allow peeking for DEFAULT notifications only if we're on Ambient Display. + int importanceLevel = isDozing() ? NotificationManager.IMPORTANCE_DEFAULT + : NotificationManager.IMPORTANCE_HIGH; + if (mNotificationData.getImportance(sbn.getKey()) < importanceLevel) { if (DEBUG) Log.d(TAG, "No peeking: unimportant notification: " + sbn.getKey()); return false; }