From 01a964d7fbba63c670062ffca9a0ebe30cdcb1ff Mon Sep 17 00:00:00 2001 From: yueg Date: Tue, 3 Oct 2017 15:25:41 -0700 Subject: 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 --- java/com/android/dialer/notification/NotificationChannelManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'java/com/android/dialer/notification/NotificationChannelManager.java') 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); -- cgit v1.2.3