Loading core/java/com/android/internal/notification/SystemNotificationChannels.java +6 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class SystemNotificationChannels { public static String FOREGROUND_SERVICE = "FOREGROUND_SERVICE"; public static String HEAVY_WEIGHT_APP = "HEAVY_WEIGHT_APP"; public static String SYSTEM_CHANGES = "SYSTEM_CHANGES"; public static String DO_NOT_DISTURB = "DO_NOT_DISTURB"; public static void createAll(Context context) { final NotificationManager nm = context.getSystemService(NotificationManager.class); Loading Loading @@ -158,6 +159,11 @@ public class SystemNotificationChannels { NotificationManager.IMPORTANCE_LOW); channelsList.add(systemChanges); NotificationChannel dndChanges = new NotificationChannel(DO_NOT_DISTURB, context.getString(R.string.notification_channel_do_not_disturb), NotificationManager.IMPORTANCE_LOW); channelsList.add(dndChanges); nm.createNotificationChannels(channelsList); } Loading core/res/res/values/strings.xml +9 −3 Original line number Diff line number Diff line Loading @@ -4889,10 +4889,16 @@ <!-- Notification action for editing a screenshot (drawing on it, cropping it, etc) --> <string name="screenshot_edit">Edit</string> <!-- Title for the notification channel notifying user of settings system changes (i.e. Do Not Disturb has changed). [CHAR LIMIT=NONE] --> <!-- Title for the notification channel notifying user of settings system changes. [CHAR LIMIT=NONE] --> <string name="notification_channel_system_changes">System changes</string> <!-- Title for the notification channel notifying user of do not disturb system changes (i.e. Do Not Disturb has changed). [CHAR LIMIT=NONE] --> <string name="notification_channel_do_not_disturb">Do Not Disturb</string> <!-- Title of notification indicating do not disturb visual interruption settings have changed when upgrading to P --> <string name="zen_upgrade_notification_visd_title">Do Not Disturb is hiding notifications to help you focus</string> <!-- Content of notification indicating users can tap on the notification to go to dnd behavior settings --> <string name="zen_upgrade_notification_visd_content">This is new behavior. Tap to change.</string> <!-- Title of notification indicating do not disturb settings have changed when upgrading to P --> <string name="zen_upgrade_notification_title">Do Not Disturb is hiding notifications to help you focus</string> <string name="zen_upgrade_notification_title">Do Not Disturb has changed</string> <!-- Content of notification indicating users can tap on the notification to go to dnd behavior settings --> <string name="zen_upgrade_notification_content">This is a new feature from the latest system update. Tap to change.</string> <string name="zen_upgrade_notification_content">Tap to check what\'s blocked.</string> </resources> core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3128,6 +3128,7 @@ <java-symbol type="string" name="notification_channel_usb" /> <java-symbol type="string" name="notification_channel_heavy_weight_app" /> <java-symbol type="string" name="notification_channel_system_changes" /> <java-symbol type="string" name="notification_channel_do_not_disturb" /> <java-symbol type="string" name="config_defaultAutofillService" /> <java-symbol type="string" name="config_defaultTextClassifierPackage" /> Loading Loading @@ -3294,6 +3295,8 @@ <java-symbol type="string" name="zen_upgrade_notification_title" /> <java-symbol type="string" name="zen_upgrade_notification_content" /> <java-symbol type="string" name="zen_upgrade_notification_visd_title" /> <java-symbol type="string" name="zen_upgrade_notification_visd_content" /> <java-symbol type="string" name="config_managed_provisioning_package" /> Loading packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (mShowing) return; mShowing = true; initSettingsH(); mDialog.show(); Events.writeEvent(mContext, Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked()); mController.notifyVisible(true); Loading services/core/java/com/android/server/notification/ZenModeHelper.java +11 −5 Original line number Diff line number Diff line Loading @@ -1203,15 +1203,21 @@ public class ZenModeHelper { final Bundle extras = new Bundle(); extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME, mContext.getResources().getString(R.string.global_action_settings)); return new Notification.Builder(mContext, SystemNotificationChannels.SYSTEM_CHANGES) int title = R.string.zen_upgrade_notification_title; int content = R.string.zen_upgrade_notification_content; if (NotificationManager.Policy.areAllVisualEffectsSuppressed( getNotificationPolicy().suppressedVisualEffects)) { title = R.string.zen_upgrade_notification_visd_title; content = R.string.zen_upgrade_notification_visd_content; } return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) .setSmallIcon(R.drawable.ic_settings_24dp) .setContentTitle(mContext.getResources().getString( R.string.zen_upgrade_notification_title)) .setContentText(mContext.getResources().getString( R.string.zen_upgrade_notification_content)) .setContentTitle(mContext.getResources().getString(title)) .setContentText(mContext.getResources().getString(content)) .setAutoCancel(true) .setLocalOnly(true) .addExtras(extras) .setStyle(new Notification.BigTextStyle()) .setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0, null)) .build(); } Loading Loading
core/java/com/android/internal/notification/SystemNotificationChannels.java +6 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ public class SystemNotificationChannels { public static String FOREGROUND_SERVICE = "FOREGROUND_SERVICE"; public static String HEAVY_WEIGHT_APP = "HEAVY_WEIGHT_APP"; public static String SYSTEM_CHANGES = "SYSTEM_CHANGES"; public static String DO_NOT_DISTURB = "DO_NOT_DISTURB"; public static void createAll(Context context) { final NotificationManager nm = context.getSystemService(NotificationManager.class); Loading Loading @@ -158,6 +159,11 @@ public class SystemNotificationChannels { NotificationManager.IMPORTANCE_LOW); channelsList.add(systemChanges); NotificationChannel dndChanges = new NotificationChannel(DO_NOT_DISTURB, context.getString(R.string.notification_channel_do_not_disturb), NotificationManager.IMPORTANCE_LOW); channelsList.add(dndChanges); nm.createNotificationChannels(channelsList); } Loading
core/res/res/values/strings.xml +9 −3 Original line number Diff line number Diff line Loading @@ -4889,10 +4889,16 @@ <!-- Notification action for editing a screenshot (drawing on it, cropping it, etc) --> <string name="screenshot_edit">Edit</string> <!-- Title for the notification channel notifying user of settings system changes (i.e. Do Not Disturb has changed). [CHAR LIMIT=NONE] --> <!-- Title for the notification channel notifying user of settings system changes. [CHAR LIMIT=NONE] --> <string name="notification_channel_system_changes">System changes</string> <!-- Title for the notification channel notifying user of do not disturb system changes (i.e. Do Not Disturb has changed). [CHAR LIMIT=NONE] --> <string name="notification_channel_do_not_disturb">Do Not Disturb</string> <!-- Title of notification indicating do not disturb visual interruption settings have changed when upgrading to P --> <string name="zen_upgrade_notification_visd_title">Do Not Disturb is hiding notifications to help you focus</string> <!-- Content of notification indicating users can tap on the notification to go to dnd behavior settings --> <string name="zen_upgrade_notification_visd_content">This is new behavior. Tap to change.</string> <!-- Title of notification indicating do not disturb settings have changed when upgrading to P --> <string name="zen_upgrade_notification_title">Do Not Disturb is hiding notifications to help you focus</string> <string name="zen_upgrade_notification_title">Do Not Disturb has changed</string> <!-- Content of notification indicating users can tap on the notification to go to dnd behavior settings --> <string name="zen_upgrade_notification_content">This is a new feature from the latest system update. Tap to change.</string> <string name="zen_upgrade_notification_content">Tap to check what\'s blocked.</string> </resources>
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3128,6 +3128,7 @@ <java-symbol type="string" name="notification_channel_usb" /> <java-symbol type="string" name="notification_channel_heavy_weight_app" /> <java-symbol type="string" name="notification_channel_system_changes" /> <java-symbol type="string" name="notification_channel_do_not_disturb" /> <java-symbol type="string" name="config_defaultAutofillService" /> <java-symbol type="string" name="config_defaultTextClassifierPackage" /> Loading Loading @@ -3294,6 +3295,8 @@ <java-symbol type="string" name="zen_upgrade_notification_title" /> <java-symbol type="string" name="zen_upgrade_notification_content" /> <java-symbol type="string" name="zen_upgrade_notification_visd_title" /> <java-symbol type="string" name="zen_upgrade_notification_visd_content" /> <java-symbol type="string" name="config_managed_provisioning_package" /> Loading
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -479,6 +479,7 @@ public class VolumeDialogImpl implements VolumeDialog { if (mShowing) return; mShowing = true; initSettingsH(); mDialog.show(); Events.writeEvent(mContext, Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked()); mController.notifyVisible(true); Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +11 −5 Original line number Diff line number Diff line Loading @@ -1203,15 +1203,21 @@ public class ZenModeHelper { final Bundle extras = new Bundle(); extras.putString(Notification.EXTRA_SUBSTITUTE_APP_NAME, mContext.getResources().getString(R.string.global_action_settings)); return new Notification.Builder(mContext, SystemNotificationChannels.SYSTEM_CHANGES) int title = R.string.zen_upgrade_notification_title; int content = R.string.zen_upgrade_notification_content; if (NotificationManager.Policy.areAllVisualEffectsSuppressed( getNotificationPolicy().suppressedVisualEffects)) { title = R.string.zen_upgrade_notification_visd_title; content = R.string.zen_upgrade_notification_visd_content; } return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) .setSmallIcon(R.drawable.ic_settings_24dp) .setContentTitle(mContext.getResources().getString( R.string.zen_upgrade_notification_title)) .setContentText(mContext.getResources().getString( R.string.zen_upgrade_notification_content)) .setContentTitle(mContext.getResources().getString(title)) .setContentText(mContext.getResources().getString(content)) .setAutoCancel(true) .setLocalOnly(true) .addExtras(extras) .setStyle(new Notification.BigTextStyle()) .setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0, null)) .build(); } Loading