From c23a2e67ac63b16b1e26b1befe5863eac7dd40e5 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Thu, 17 Aug 2017 13:34:27 -0400 Subject: [PATCH] Let the foreground service channel be blocked And update the channel name Change-Id: Ic4b909d31b38b9e1ee05f9b3e4e5c91efc6752b1 Fixes: 36891897 Test: manual --- .../notification/SystemNotificationChannels.java | 6 ++++-- core/res/res/values/strings.xml | 13 +++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/java/com/android/internal/notification/SystemNotificationChannels.java b/core/java/com/android/internal/notification/SystemNotificationChannels.java index d327180c6e9dd..d64c9a1d813be 100644 --- a/core/java/com/android/internal/notification/SystemNotificationChannels.java +++ b/core/java/com/android/internal/notification/SystemNotificationChannels.java @@ -132,10 +132,12 @@ public class SystemNotificationChannels { context.getString(R.string.notification_channel_usb), NotificationManager.IMPORTANCE_MIN)); - channelsList.add(new NotificationChannel( + NotificationChannel foregroundChannel = new NotificationChannel( FOREGROUND_SERVICE, context.getString(R.string.notification_channel_foreground_service), - NotificationManager.IMPORTANCE_LOW)); + NotificationManager.IMPORTANCE_LOW); + foregroundChannel.setBlockableSystem(true); + channelsList.add(foregroundChannel); nm.createNotificationChannels(channelsList); } diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index c738637634be5..61d2108780d27 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -641,17 +641,18 @@ - Apps running in background + [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=6665375982962336520] --> + Apps consuming battery - + %1$s is - running in the background + using battery + [CHAR LIMIT=NONE BACKUP_MESSAGE_ID=7150914856893450380] --> %1$d apps - are running in the background + are using battery