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
4 files changed