Loading core/res/res/drawable/ic_dnd_block_notifications.xml 0 → 100644 +30 −0 Original line number Original line Diff line number Diff line <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="40dp" android:height="40dp" android:viewportWidth="40.0" android:viewportHeight="40.0"> <path android:pathData="M34,20H2c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2h32c1.1,0 2,0.9 2,2v12C36,19.1 35.1,20 34,20z" android:fillColor="#FBBC04"/> <path android:pathData="M4.63,10L4.63,10c-0.83,0 -1.5,-0.67 -1.5,-1.5v0C3.12,7.67 3.8,7 4.62,7h0c0.82,0 1.5,0.67 1.5,1.5v0C6.12,9.33 5.45,10 4.63,10z" android:fillColor="#FFFFFF"/> <path android:pathData="M8.62,7.5h9.5v2h-9.5z" android:fillColor="#FFFFFF"/> <path android:pathData="M3.12,15h24v2h-24z" android:fillColor="#FFFFFF"/> <path android:pathData="M3.12,12h17.5v2h-17.5z" android:fillColor="#FFFFFF"/> <path android:pathData="M33.59,6.41m-5.78,0a5.78,5.78 0,1 1,11.56 0a5.78,5.78 0,1 1,-11.56 0" android:fillColor="#FFFFFF"/> <path android:pathData="M33.5,0C29.91,0 27,2.91 27,6.5s2.91,6.5 6.5,6.5S40,10.09 40,6.5S37.09,0 33.5,0zM33.5,11.7c-2.87,0 -5.2,-2.33 -5.2,-5.2s2.33,-5.2 5.2,-5.2s5.2,2.33 5.2,5.2S36.37,11.7 33.5,11.7z" android:fillColor="#4285F4"/> <path android:pathData="M30.25,5.85h6.5v1.3h-6.5z" android:fillColor="#4285F4"/> </vector> core/res/res/values/symbols.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2555,6 +2555,7 @@ <java-symbol type="drawable" name="ic_storage_48dp" /> <java-symbol type="drawable" name="ic_storage_48dp" /> <java-symbol type="drawable" name="ic_usb_48dp" /> <java-symbol type="drawable" name="ic_usb_48dp" /> <java-symbol type="drawable" name="ic_zen_24dp" /> <java-symbol type="drawable" name="ic_zen_24dp" /> <java-symbol type="drawable" name="ic_dnd_block_notifications" /> <!-- Floating toolbar --> <!-- Floating toolbar --> <java-symbol type="id" name="floating_toolbar_menu_item_image" /> <java-symbol type="id" name="floating_toolbar_menu_item_image" /> Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +17 −12 Original line number Original line Diff line number Diff line Loading @@ -2935,7 +2935,7 @@ public class SettingsProvider extends ContentProvider { } } private final class UpgradeController { private final class UpgradeController { private static final int SETTINGS_VERSION = 164; private static final int SETTINGS_VERSION = 165; private final int mUserId; private final int mUserId; Loading Loading @@ -3710,17 +3710,7 @@ public class SettingsProvider extends ContentProvider { } } if (currentVersion == 162) { if (currentVersion == 162) { // Version 162: Add a gesture for silencing phones // Version 162: REMOVED: Add a gesture for silencing phones final SettingsState settings = getGlobalSettingsLocked(); final Setting currentSetting = settings.getSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION); if (!currentSetting.isNull() && TextUtils.equals("0", currentSetting.getValue())) { settings.insertSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 163; currentVersion = 163; } } Loading @@ -3742,6 +3732,21 @@ public class SettingsProvider extends ContentProvider { currentVersion = 164; currentVersion = 164; } } if (currentVersion == 164) { // Version 164: Add a gesture for silencing phones final SettingsState settings = getGlobalSettingsLocked(); final Setting currentSetting = settings.getSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION); if (!currentSetting.isNull() && TextUtils.equals("0", currentSetting.getValue())) { settings.insertSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 165; } // vXXX: Add new settings above this point. // vXXX: Add new settings above this point. if (currentVersion != newVersion) { if (currentVersion != newVersion) { Loading services/core/java/com/android/server/notification/ZenModeHelper.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1171,7 +1171,7 @@ public class ZenModeHelper { private void showZenUpgradeNotification(int zen) { private void showZenUpgradeNotification(int zen) { final boolean showNotification = mIsBootComplete final boolean showNotification = mIsBootComplete && zen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS && zen != Global.ZEN_MODE_OFF && Settings.Global.getInt(mContext.getContentResolver(), && Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; Loading @@ -1190,17 +1190,20 @@ public class ZenModeHelper { mContext.getResources().getString(R.string.global_action_settings)); mContext.getResources().getString(R.string.global_action_settings)); int title = R.string.zen_upgrade_notification_title; int title = R.string.zen_upgrade_notification_title; int content = R.string.zen_upgrade_notification_content; int content = R.string.zen_upgrade_notification_content; int drawable = R.drawable.ic_zen_24dp; if (NotificationManager.Policy.areAllVisualEffectsSuppressed( if (NotificationManager.Policy.areAllVisualEffectsSuppressed( getNotificationPolicy().suppressedVisualEffects)) { getNotificationPolicy().suppressedVisualEffects)) { title = R.string.zen_upgrade_notification_visd_title; title = R.string.zen_upgrade_notification_visd_title; content = R.string.zen_upgrade_notification_visd_content; content = R.string.zen_upgrade_notification_visd_content; drawable = R.drawable.ic_dnd_block_notifications; } } Intent onboardingIntent = new Intent(Settings.ZEN_MODE_ONBOARDING); Intent onboardingIntent = new Intent(Settings.ZEN_MODE_ONBOARDING); onboardingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); onboardingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) .setAutoCancel(true) .setAutoCancel(true) .setSmallIcon(R.drawable.ic_settings_24dp) .setSmallIcon(R.drawable.ic_settings_24dp) .setLargeIcon(Icon.createWithResource(mContext, R.drawable.ic_zen_24dp)) .setLargeIcon(Icon.createWithResource(mContext, drawable)) .setContentTitle(mContext.getResources().getString(title)) .setContentTitle(mContext.getResources().getString(title)) .setContentText(mContext.getResources().getString(content)) .setContentText(mContext.getResources().getString(content)) .setContentIntent(PendingIntent.getActivity(mContext, 0, onboardingIntent, .setContentIntent(PendingIntent.getActivity(mContext, 0, onboardingIntent, Loading Loading
core/res/res/drawable/ic_dnd_block_notifications.xml 0 → 100644 +30 −0 Original line number Original line Diff line number Diff line <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="40dp" android:height="40dp" android:viewportWidth="40.0" android:viewportHeight="40.0"> <path android:pathData="M34,20H2c-1.1,0 -2,-0.9 -2,-2V6c0,-1.1 0.9,-2 2,-2h32c1.1,0 2,0.9 2,2v12C36,19.1 35.1,20 34,20z" android:fillColor="#FBBC04"/> <path android:pathData="M4.63,10L4.63,10c-0.83,0 -1.5,-0.67 -1.5,-1.5v0C3.12,7.67 3.8,7 4.62,7h0c0.82,0 1.5,0.67 1.5,1.5v0C6.12,9.33 5.45,10 4.63,10z" android:fillColor="#FFFFFF"/> <path android:pathData="M8.62,7.5h9.5v2h-9.5z" android:fillColor="#FFFFFF"/> <path android:pathData="M3.12,15h24v2h-24z" android:fillColor="#FFFFFF"/> <path android:pathData="M3.12,12h17.5v2h-17.5z" android:fillColor="#FFFFFF"/> <path android:pathData="M33.59,6.41m-5.78,0a5.78,5.78 0,1 1,11.56 0a5.78,5.78 0,1 1,-11.56 0" android:fillColor="#FFFFFF"/> <path android:pathData="M33.5,0C29.91,0 27,2.91 27,6.5s2.91,6.5 6.5,6.5S40,10.09 40,6.5S37.09,0 33.5,0zM33.5,11.7c-2.87,0 -5.2,-2.33 -5.2,-5.2s2.33,-5.2 5.2,-5.2s5.2,2.33 5.2,5.2S36.37,11.7 33.5,11.7z" android:fillColor="#4285F4"/> <path android:pathData="M30.25,5.85h6.5v1.3h-6.5z" android:fillColor="#4285F4"/> </vector>
core/res/res/values/symbols.xml +1 −0 Original line number Original line Diff line number Diff line Loading @@ -2555,6 +2555,7 @@ <java-symbol type="drawable" name="ic_storage_48dp" /> <java-symbol type="drawable" name="ic_storage_48dp" /> <java-symbol type="drawable" name="ic_usb_48dp" /> <java-symbol type="drawable" name="ic_usb_48dp" /> <java-symbol type="drawable" name="ic_zen_24dp" /> <java-symbol type="drawable" name="ic_zen_24dp" /> <java-symbol type="drawable" name="ic_dnd_block_notifications" /> <!-- Floating toolbar --> <!-- Floating toolbar --> <java-symbol type="id" name="floating_toolbar_menu_item_image" /> <java-symbol type="id" name="floating_toolbar_menu_item_image" /> Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +17 −12 Original line number Original line Diff line number Diff line Loading @@ -2935,7 +2935,7 @@ public class SettingsProvider extends ContentProvider { } } private final class UpgradeController { private final class UpgradeController { private static final int SETTINGS_VERSION = 164; private static final int SETTINGS_VERSION = 165; private final int mUserId; private final int mUserId; Loading Loading @@ -3710,17 +3710,7 @@ public class SettingsProvider extends ContentProvider { } } if (currentVersion == 162) { if (currentVersion == 162) { // Version 162: Add a gesture for silencing phones // Version 162: REMOVED: Add a gesture for silencing phones final SettingsState settings = getGlobalSettingsLocked(); final Setting currentSetting = settings.getSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION); if (!currentSetting.isNull() && TextUtils.equals("0", currentSetting.getValue())) { settings.insertSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 163; currentVersion = 163; } } Loading @@ -3742,6 +3732,21 @@ public class SettingsProvider extends ContentProvider { currentVersion = 164; currentVersion = 164; } } if (currentVersion == 164) { // Version 164: Add a gesture for silencing phones final SettingsState settings = getGlobalSettingsLocked(); final Setting currentSetting = settings.getSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION); if (!currentSetting.isNull() && TextUtils.equals("0", currentSetting.getValue())) { settings.insertSettingLocked( Global.SHOW_ZEN_UPGRADE_NOTIFICATION, "1", null, true, SettingsState.SYSTEM_PACKAGE_NAME); } currentVersion = 165; } // vXXX: Add new settings above this point. // vXXX: Add new settings above this point. if (currentVersion != newVersion) { if (currentVersion != newVersion) { Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +5 −2 Original line number Original line Diff line number Diff line Loading @@ -1171,7 +1171,7 @@ public class ZenModeHelper { private void showZenUpgradeNotification(int zen) { private void showZenUpgradeNotification(int zen) { final boolean showNotification = mIsBootComplete final boolean showNotification = mIsBootComplete && zen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS && zen != Global.ZEN_MODE_OFF && Settings.Global.getInt(mContext.getContentResolver(), && Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; Loading @@ -1190,17 +1190,20 @@ public class ZenModeHelper { mContext.getResources().getString(R.string.global_action_settings)); mContext.getResources().getString(R.string.global_action_settings)); int title = R.string.zen_upgrade_notification_title; int title = R.string.zen_upgrade_notification_title; int content = R.string.zen_upgrade_notification_content; int content = R.string.zen_upgrade_notification_content; int drawable = R.drawable.ic_zen_24dp; if (NotificationManager.Policy.areAllVisualEffectsSuppressed( if (NotificationManager.Policy.areAllVisualEffectsSuppressed( getNotificationPolicy().suppressedVisualEffects)) { getNotificationPolicy().suppressedVisualEffects)) { title = R.string.zen_upgrade_notification_visd_title; title = R.string.zen_upgrade_notification_visd_title; content = R.string.zen_upgrade_notification_visd_content; content = R.string.zen_upgrade_notification_visd_content; drawable = R.drawable.ic_dnd_block_notifications; } } Intent onboardingIntent = new Intent(Settings.ZEN_MODE_ONBOARDING); Intent onboardingIntent = new Intent(Settings.ZEN_MODE_ONBOARDING); onboardingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); onboardingIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) return new Notification.Builder(mContext, SystemNotificationChannels.DO_NOT_DISTURB) .setAutoCancel(true) .setAutoCancel(true) .setSmallIcon(R.drawable.ic_settings_24dp) .setSmallIcon(R.drawable.ic_settings_24dp) .setLargeIcon(Icon.createWithResource(mContext, R.drawable.ic_zen_24dp)) .setLargeIcon(Icon.createWithResource(mContext, drawable)) .setContentTitle(mContext.getResources().getString(title)) .setContentTitle(mContext.getResources().getString(title)) .setContentText(mContext.getResources().getString(content)) .setContentText(mContext.getResources().getString(content)) .setContentIntent(PendingIntent.getActivity(mContext, 0, onboardingIntent, .setContentIntent(PendingIntent.getActivity(mContext, 0, onboardingIntent, Loading