diff options
author | fionaxu <fionaxu@google.com> | 2017-09-11 18:11:10 -0700 |
---|---|---|
committer | fionaxu <fionaxu@google.com> | 2017-09-12 09:42:20 -0700 |
commit | 81cb84b8fcc47ad060dcfbc701d82f34dba3008d (patch) | |
tree | eab384d22ae8a4e5536024095884b3726c2e0d53 | |
parent | 377cda6bd217b443c220b178a2f748a7bae0a59b (diff) | |
download | telephony-81cb84b8fcc47ad060dcfbc701d82f34dba3008d.tar.gz |
enable systemBlockable for roaming notification
Users living in border will be disturbed by this notificaiton
frequently. In MR1 we have already lowered the importance for this
notification, we should also allow users to block this system
notification.
Bug: 65540737
Test: Manaul adb shell setprop telephony.test.forceRoaming true
Change-Id: Ie10faa13774af763fb3f2edca31777ae2dbcab6a
-rw-r--r-- | src/java/com/android/internal/telephony/util/NotificationChannelController.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/java/com/android/internal/telephony/util/NotificationChannelController.java b/src/java/com/android/internal/telephony/util/NotificationChannelController.java index 9967b05dc0..54d7d1abd8 100644 --- a/src/java/com/android/internal/telephony/util/NotificationChannelController.java +++ b/src/java/com/android/internal/telephony/util/NotificationChannelController.java @@ -58,21 +58,26 @@ public class NotificationChannelController { alertChannel.setSound(Settings.System.DEFAULT_NOTIFICATION_URI, new AudioAttributes.Builder().setUsage(AudioAttributes.USAGE_NOTIFICATION).build()); + final NotificationChannel mobileDataStatusChannel = new NotificationChannel( + CHANNEL_ID_MOBILE_DATA_STATUS, + context.getText(R.string.notification_channel_mobile_data_status), + NotificationManager.IMPORTANCE_LOW); + // allow users to block notifications from system + mobileDataStatusChannel.setBlockableSystem(true); + context.getSystemService(NotificationManager.class) .createNotificationChannels(Arrays.asList( new NotificationChannel(CHANNEL_ID_CALL_FORWARD, context.getText(R.string.notification_channel_call_forward), NotificationManager.IMPORTANCE_LOW), - new NotificationChannel(CHANNEL_ID_MOBILE_DATA_STATUS, - context.getText(R.string.notification_channel_mobile_data_status), - NotificationManager.IMPORTANCE_LOW), new NotificationChannel(CHANNEL_ID_SMS, context.getText(R.string.notification_channel_sms), NotificationManager.IMPORTANCE_HIGH), new NotificationChannel(CHANNEL_ID_WFC, context.getText(R.string.notification_channel_wfc), NotificationManager.IMPORTANCE_LOW), - alertChannel)); + alertChannel, + mobileDataStatusChannel)); // only for update if (getChannel(CHANNEL_ID_VOICE_MAIL, context) != null) { migrateVoicemailNotificationSettings(context); |