Loading res/values/strings.xml +0 −6 Original line number Diff line number Diff line Loading @@ -1051,10 +1051,4 @@ --> <string name="alarm_is_snoozed"><xliff:g id="alarm_time" example="14:20">%s</xliff:g> alarm snoozed for 10 minutes</string> <!-- The user visible name of the stopwatch channel. --> <string name="stopwatch_channel_name">Stopwatch</string> <!-- The user visible name of the timers channel. --> <string name="timer_channel_name">Timers</string> <!-- The user visible name of the alarms channel. --> <string name="alarm_channel_name">Alarms</string> </resources> src/com/android/deskclock/Utils.java +1 −41 Original line number Diff line number Diff line Loading @@ -20,9 +20,6 @@ import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlarmManager; import android.app.AlarmManager.AlarmClockInfo; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.content.ContentResolver; Loading Loading @@ -628,41 +625,4 @@ public class Utils { AccessibilityActionCompat.ACTION_CLICK.getId(), mLabel)); } } public static void createNotificationChannel(Context context, String id, String name, int importance) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { return; } NotificationManager manager = ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)); NotificationChannel channel = new NotificationChannel(id, name, importance); manager.createNotificationChannel(channel); } static boolean areNotificationChannelsCreated = false; public static final String STOPWATCH_CHANNEL = "stopwatch_notification_channel"; public static final String TIMER_CHANNEL = "timer_notification_channel"; public static final String ALARM_CHANNEL = "alarm_notification_channel"; public static void createNotificationChannelsIfNeeded(Context context) { if (areNotificationChannelsCreated) { return; } areNotificationChannelsCreated = true; createNotificationChannel(context, STOPWATCH_CHANNEL, context.getString(R.string.stopwatch_channel_name), NotificationManager.IMPORTANCE_HIGH); createNotificationChannel(context, TIMER_CHANNEL, context.getString(R.string.timer_channel_name), NotificationManager.IMPORTANCE_HIGH); createNotificationChannel(context, ALARM_CHANNEL, context.getString(R.string.alarm_channel_name), NotificationManager.IMPORTANCE_HIGH); } } No newline at end of file src/com/android/deskclock/alarms/AlarmNotifications.java +14 −30 Original line number Diff line number Diff line Loading @@ -86,10 +86,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying low priority notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString( R.string.alarm_alert_predismiss_title)) Loading @@ -98,6 +95,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -137,10 +135,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying high priority notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString(R.string.alarm_alert_predismiss_title)) .setContentText(AlarmUtils.getAlarmText(context, instance, true /* includeLabel */)) Loading @@ -148,6 +143,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -247,16 +243,14 @@ final class AlarmNotifications { Notification summary = getActiveGroupSummaryNotification(context, UPCOMING_GROUP_KEY); if (summary == null || !Objects.equals(summary.contentIntent, firstUpcoming.contentIntent)) { Utils.createNotificationChannelsIfNeeded(context); summary = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) summary = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentIntent(firstUpcoming.contentIntent) .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSmallIcon(R.drawable.stat_notify_alarm) .setGroup(UPCOMING_GROUP_KEY) .setGroupSummary(true) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true) Loading @@ -283,16 +277,14 @@ final class AlarmNotifications { Notification summary = getActiveGroupSummaryNotification(context, MISSED_GROUP_KEY); if (summary == null || !Objects.equals(summary.contentIntent, firstMissed.contentIntent)) { Utils.createNotificationChannelsIfNeeded(context); summary = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) summary = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentIntent(firstMissed.contentIntent) .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSmallIcon(R.drawable.stat_notify_alarm) .setGroup(MISSED_GROUP_KEY) .setGroupSummary(true) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true) Loading @@ -305,10 +297,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying snoozed notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(instance.getLabelOrDefault(context)) .setContentText(context.getString(R.string.alarm_alert_snooze_until, Loading @@ -317,6 +306,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_MAX) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -351,11 +341,7 @@ final class AlarmNotifications { String label = instance.mLabel; String alarmTime = AlarmUtils.getFormattedTime(context, instance.getAlarmTime()); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString(R.string.alarm_missed_title)) .setContentText(instance.mLabel.isEmpty() ? alarmTime : Loading @@ -363,6 +349,7 @@ final class AlarmNotifications { .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSortKey(createSortKey(instance)) .setSmallIcon(R.drawable.stat_notify_alarm) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -397,11 +384,7 @@ final class AlarmNotifications { LogUtils.v("Displaying alarm notification for alarm instance: " + instance.mId); Resources resources = service.getResources(); Utils.createNotificationChannelsIfNeeded(service); NotificationCompat.Builder notification = new NotificationCompat.Builder(service, Utils.ALARM_CHANNEL) NotificationCompat.Builder notification = new NotificationCompat.Builder(service) .setContentTitle(instance.getLabelOrDefault(service)) .setContentText(AlarmUtils.getFormattedTime(service, instance.getAlarmTime())) .setColor(ContextCompat.getColor(service, R.color.default_background)) Loading Loading @@ -449,6 +432,7 @@ final class AlarmNotifications { notification.setFullScreenIntent(PendingIntent.getActivity(service, ALARM_FIRING_NOTIFICATION_ID, fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT), true); notification.setPriority(NotificationCompat.PRIORITY_MAX); clearNotification(service, instance); service.startForeground(ALARM_FIRING_NOTIFICATION_ID, notification.build()); Loading src/com/android/deskclock/data/StopwatchNotificationBuilder.java +2 −5 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.support.annotation.StringRes; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat.Action; import android.support.v4.app.NotificationCompat.Builder; import android.support.v4.app.NotificationCompat; import android.support.v4.content.ContextCompat; import android.widget.RemoteViews; Loading Loading @@ -128,15 +127,13 @@ class StopwatchNotificationBuilder { content.setViewVisibility(R.id.state, VISIBLE); } Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.STOPWATCH_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setLocalOnly(true) .setOngoing(running) .setCustomContentView(content) .setContentIntent(pendingShowApp) .setAutoCancel(stopwatch.isPaused()) .setPriority(Notification.PRIORITY_MAX) .setSmallIcon(R.drawable.stat_notify_stopwatch) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setColor(ContextCompat.getColor(context, R.color.default_background)); Loading src/com/android/deskclock/data/TimerNotificationBuilder.java +6 −12 Original line number Diff line number Diff line Loading @@ -148,15 +148,13 @@ class TimerNotificationBuilder { PendingIntent.getService(context, REQUEST_CODE_UPCOMING, showApp, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setOngoing(true) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(pendingShowApp) .setPriority(Notification.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setSmallIcon(R.drawable.stat_notify_timer) .setSortKey(nm.getTimerNotificationSortKey()) Loading Loading @@ -263,15 +261,13 @@ class TimerNotificationBuilder { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION); final PendingIntent pendingFullScreen = Utils.pendingActivityIntent(context, fullScreen); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setOngoing(true) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(contentIntent) .setPriority(Notification.PRIORITY_MAX) .setDefaults(Notification.DEFAULT_LIGHTS) .setSmallIcon(R.drawable.stat_notify_timer) .setFullScreenIntent(pendingFullScreen, true) Loading Loading @@ -348,14 +344,12 @@ class TimerNotificationBuilder { PendingIntent.getService(context, REQUEST_CODE_MISSING, showApp, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(pendingShowApp) .setPriority(Notification.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setSmallIcon(R.drawable.stat_notify_timer) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) Loading Loading
res/values/strings.xml +0 −6 Original line number Diff line number Diff line Loading @@ -1051,10 +1051,4 @@ --> <string name="alarm_is_snoozed"><xliff:g id="alarm_time" example="14:20">%s</xliff:g> alarm snoozed for 10 minutes</string> <!-- The user visible name of the stopwatch channel. --> <string name="stopwatch_channel_name">Stopwatch</string> <!-- The user visible name of the timers channel. --> <string name="timer_channel_name">Timers</string> <!-- The user visible name of the alarms channel. --> <string name="alarm_channel_name">Alarms</string> </resources>
src/com/android/deskclock/Utils.java +1 −41 Original line number Diff line number Diff line Loading @@ -20,9 +20,6 @@ import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlarmManager; import android.app.AlarmManager.AlarmClockInfo; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.content.ContentResolver; Loading Loading @@ -628,41 +625,4 @@ public class Utils { AccessibilityActionCompat.ACTION_CLICK.getId(), mLabel)); } } public static void createNotificationChannel(Context context, String id, String name, int importance) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { return; } NotificationManager manager = ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)); NotificationChannel channel = new NotificationChannel(id, name, importance); manager.createNotificationChannel(channel); } static boolean areNotificationChannelsCreated = false; public static final String STOPWATCH_CHANNEL = "stopwatch_notification_channel"; public static final String TIMER_CHANNEL = "timer_notification_channel"; public static final String ALARM_CHANNEL = "alarm_notification_channel"; public static void createNotificationChannelsIfNeeded(Context context) { if (areNotificationChannelsCreated) { return; } areNotificationChannelsCreated = true; createNotificationChannel(context, STOPWATCH_CHANNEL, context.getString(R.string.stopwatch_channel_name), NotificationManager.IMPORTANCE_HIGH); createNotificationChannel(context, TIMER_CHANNEL, context.getString(R.string.timer_channel_name), NotificationManager.IMPORTANCE_HIGH); createNotificationChannel(context, ALARM_CHANNEL, context.getString(R.string.alarm_channel_name), NotificationManager.IMPORTANCE_HIGH); } } No newline at end of file
src/com/android/deskclock/alarms/AlarmNotifications.java +14 −30 Original line number Diff line number Diff line Loading @@ -86,10 +86,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying low priority notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString( R.string.alarm_alert_predismiss_title)) Loading @@ -98,6 +95,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_DEFAULT) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -137,10 +135,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying high priority notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString(R.string.alarm_alert_predismiss_title)) .setContentText(AlarmUtils.getAlarmText(context, instance, true /* includeLabel */)) Loading @@ -148,6 +143,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -247,16 +243,14 @@ final class AlarmNotifications { Notification summary = getActiveGroupSummaryNotification(context, UPCOMING_GROUP_KEY); if (summary == null || !Objects.equals(summary.contentIntent, firstUpcoming.contentIntent)) { Utils.createNotificationChannelsIfNeeded(context); summary = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) summary = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentIntent(firstUpcoming.contentIntent) .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSmallIcon(R.drawable.stat_notify_alarm) .setGroup(UPCOMING_GROUP_KEY) .setGroupSummary(true) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true) Loading @@ -283,16 +277,14 @@ final class AlarmNotifications { Notification summary = getActiveGroupSummaryNotification(context, MISSED_GROUP_KEY); if (summary == null || !Objects.equals(summary.contentIntent, firstMissed.contentIntent)) { Utils.createNotificationChannelsIfNeeded(context); summary = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) summary = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentIntent(firstMissed.contentIntent) .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSmallIcon(R.drawable.stat_notify_alarm) .setGroup(MISSED_GROUP_KEY) .setGroupSummary(true) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true) Loading @@ -305,10 +297,7 @@ final class AlarmNotifications { AlarmInstance instance) { LogUtils.v("Displaying snoozed notification for alarm instance: " + instance.mId); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(instance.getLabelOrDefault(context)) .setContentText(context.getString(R.string.alarm_alert_snooze_until, Loading @@ -317,6 +306,7 @@ final class AlarmNotifications { .setSmallIcon(R.drawable.stat_notify_alarm) .setAutoCancel(false) .setSortKey(createSortKey(instance)) .setPriority(NotificationCompat.PRIORITY_MAX) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -351,11 +341,7 @@ final class AlarmNotifications { String label = instance.mLabel; String alarmTime = AlarmUtils.getFormattedTime(context, instance.getAlarmTime()); Utils.createNotificationChannelsIfNeeded(context); NotificationCompat.Builder builder = new NotificationCompat.Builder(context, Utils.ALARM_CHANNEL) NotificationCompat.Builder builder = new NotificationCompat.Builder(context) .setShowWhen(false) .setContentTitle(context.getString(R.string.alarm_missed_title)) .setContentText(instance.mLabel.isEmpty() ? alarmTime : Loading @@ -363,6 +349,7 @@ final class AlarmNotifications { .setColor(ContextCompat.getColor(context, R.color.default_background)) .setSortKey(createSortKey(instance)) .setSmallIcon(R.drawable.stat_notify_alarm) .setPriority(NotificationCompat.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setLocalOnly(true); Loading Loading @@ -397,11 +384,7 @@ final class AlarmNotifications { LogUtils.v("Displaying alarm notification for alarm instance: " + instance.mId); Resources resources = service.getResources(); Utils.createNotificationChannelsIfNeeded(service); NotificationCompat.Builder notification = new NotificationCompat.Builder(service, Utils.ALARM_CHANNEL) NotificationCompat.Builder notification = new NotificationCompat.Builder(service) .setContentTitle(instance.getLabelOrDefault(service)) .setContentText(AlarmUtils.getFormattedTime(service, instance.getAlarmTime())) .setColor(ContextCompat.getColor(service, R.color.default_background)) Loading Loading @@ -449,6 +432,7 @@ final class AlarmNotifications { notification.setFullScreenIntent(PendingIntent.getActivity(service, ALARM_FIRING_NOTIFICATION_ID, fullScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT), true); notification.setPriority(NotificationCompat.PRIORITY_MAX); clearNotification(service, instance); service.startForeground(ALARM_FIRING_NOTIFICATION_ID, notification.build()); Loading
src/com/android/deskclock/data/StopwatchNotificationBuilder.java +2 −5 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.support.annotation.StringRes; import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat.Action; import android.support.v4.app.NotificationCompat.Builder; import android.support.v4.app.NotificationCompat; import android.support.v4.content.ContextCompat; import android.widget.RemoteViews; Loading Loading @@ -128,15 +127,13 @@ class StopwatchNotificationBuilder { content.setViewVisibility(R.id.state, VISIBLE); } Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.STOPWATCH_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setLocalOnly(true) .setOngoing(running) .setCustomContentView(content) .setContentIntent(pendingShowApp) .setAutoCancel(stopwatch.isPaused()) .setPriority(Notification.PRIORITY_MAX) .setSmallIcon(R.drawable.stat_notify_stopwatch) .setStyle(new NotificationCompat.DecoratedCustomViewStyle()) .setColor(ContextCompat.getColor(context, R.color.default_background)); Loading
src/com/android/deskclock/data/TimerNotificationBuilder.java +6 −12 Original line number Diff line number Diff line Loading @@ -148,15 +148,13 @@ class TimerNotificationBuilder { PendingIntent.getService(context, REQUEST_CODE_UPCOMING, showApp, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setOngoing(true) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(pendingShowApp) .setPriority(Notification.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setSmallIcon(R.drawable.stat_notify_timer) .setSortKey(nm.getTimerNotificationSortKey()) Loading Loading @@ -263,15 +261,13 @@ class TimerNotificationBuilder { .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION); final PendingIntent pendingFullScreen = Utils.pendingActivityIntent(context, fullScreen); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setOngoing(true) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(contentIntent) .setPriority(Notification.PRIORITY_MAX) .setDefaults(Notification.DEFAULT_LIGHTS) .setSmallIcon(R.drawable.stat_notify_timer) .setFullScreenIntent(pendingFullScreen, true) Loading Loading @@ -348,14 +344,12 @@ class TimerNotificationBuilder { PendingIntent.getService(context, REQUEST_CODE_MISSING, showApp, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_UPDATE_CURRENT); Utils.createNotificationChannelsIfNeeded(context); final Builder notification = new NotificationCompat.Builder(context, Utils.TIMER_CHANNEL) final Builder notification = new NotificationCompat.Builder(context) .setLocalOnly(true) .setShowWhen(false) .setAutoCancel(false) .setContentIntent(pendingShowApp) .setPriority(Notification.PRIORITY_HIGH) .setCategory(NotificationCompat.CATEGORY_ALARM) .setSmallIcon(R.drawable.stat_notify_timer) .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) Loading