summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/notification
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2017-10-03 15:25:41 -0700
committerEric Erfanian <erfanian@google.com>2017-10-04 08:17:39 -0700
commit01a964d7fbba63c670062ffca9a0ebe30cdcb1ff (patch)
treef02220a25fa0c7171d6f9648f1856750982f3e7d /java/com/android/dialer/notification
parent69ff7c1717c363027a79a454da91e1ca59c1dd3e (diff)
Make incoming and ongoing call notification foreground and highest priority.
Use startForeground()/stopForeground() for posting notification instead of NotificationManager.notify()/cancel(). It makes incoming and ongoing notification foreground and not able to snooze. It also colorize ongoing call notification for Android O, since we already setColorized(). Use setPriority(Notification.PRIORITY_MAX) for pre-O, and NotificationManager.IMPORTANCE_MAX for O. It makes incoming and ongoing notification stay on the top. Test: StatusBarNotifierTest*2 PiperOrigin-RevId: 170924163 Change-Id: Iab1415b0161a4623a1ccf52d3948f32b6f93eeb2
Diffstat (limited to 'java/com/android/dialer/notification')
-rw-r--r--java/com/android/dialer/notification/NotificationChannelManager.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/java/com/android/dialer/notification/NotificationChannelManager.java b/java/com/android/dialer/notification/NotificationChannelManager.java
index 790aac36f..93caed503 100644
--- a/java/com/android/dialer/notification/NotificationChannelManager.java
+++ b/java/com/android/dialer/notification/NotificationChannelManager.java
@@ -133,7 +133,7 @@ public final class NotificationChannelManager {
new NotificationChannel(
NotificationChannelId.ONGOING_CALL,
context.getText(R.string.notification_channel_ongoing_call),
- NotificationManager.IMPORTANCE_DEFAULT);
+ NotificationManager.IMPORTANCE_MAX);
channel.setShowBadge(false);
channel.enableLights(false);
channel.enableVibration(false);