From 400dada21f8e49122769e448896477407103317f Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Thu, 7 Sep 2017 17:46:39 -0500 Subject: [PATCH] Fix timer notifications --- app/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java | 4 ++-- .../java/org/tasks/notifications/NotificationManager.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java b/app/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java index 02a37e036..7de9af982 100644 --- a/app/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java +++ b/app/src/main/java/com/todoroo/astrid/timers/TimerPlugin.java @@ -10,7 +10,7 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.res.Resources; -import android.support.v7.app.NotificationCompat; +import android.support.v4.app.NotificationCompat; import com.todoroo.andlib.sql.Query; import com.todoroo.andlib.utility.DateUtilities; @@ -106,7 +106,7 @@ public class TimerPlugin { String appName = r.getString(R.string.app_name); String text = r.getString(R.string.TPl_notification, r.getQuantityString(R.plurals.Ntasks, count, count)); - Notification notification = new NotificationCompat.Builder(context) + Notification notification = new NotificationCompat.Builder(context, NotificationManager.NOTIFICATION_CHANNEL_TIMERS) .setContentIntent(pendingIntent) .setContentTitle(appName) .setContentText(text) diff --git a/app/src/main/java/org/tasks/notifications/NotificationManager.java b/app/src/main/java/org/tasks/notifications/NotificationManager.java index f66de805b..f3e6e0fee 100644 --- a/app/src/main/java/org/tasks/notifications/NotificationManager.java +++ b/app/src/main/java/org/tasks/notifications/NotificationManager.java @@ -43,6 +43,7 @@ public class NotificationManager { public static final String NOTIFICATION_CHANNEL_DEFAULT = "notifications"; public static final String NOTIFICATION_CHANNEL_TASKER = "notifications_tasker"; public static final String NOTIFICATION_CHANNEL_CALLS = "notifications_calls"; + public static final String NOTIFICATION_CHANNEL_TIMERS = "notifications_timers"; public static final String GROUP_KEY = "tasks"; private static final int SUMMARY_NOTIFICATION_ID = 0; static final String EXTRA_NOTIFICATION_ID = "extra_notification_id"; @@ -66,6 +67,7 @@ public class NotificationManager { notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_DEFAULT, R.string.notifications)); notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_CALLS, R.string.missed_calls)); notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_TASKER, R.string.tasker_locale)); + notificationManager.createNotificationChannel(createNotificationChannel(NOTIFICATION_CHANNEL_TIMERS, R.string.TEA_timer_controls)); } }