Loading core/java/android/service/notification/ZenModeConfig.java +3 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ public class ZenModeConfig implements Parcelable { private static final int DAY_MINUTES = 24 * 60; private static final int ZERO_VALUE_MS = 10 * SECONDS_MS; // Default allow categories set in readXml() from default_zen_mode_config.xml, fallback values: // Default allow categories set in readXml() from default_zen_mode_config.xml, // fallback/upgrade values: private static final boolean DEFAULT_ALLOW_ALARMS = true; private static final boolean DEFAULT_ALLOW_MEDIA = true; private static final boolean DEFAULT_ALLOW_SYSTEM = false; Loading @@ -97,7 +98,7 @@ public class ZenModeConfig implements Parcelable { private static final int DEFAULT_SUPPRESSED_VISUAL_EFFECTS = Policy.getAllSuppressedVisualEffects(); public static final int XML_VERSION = 6; public static final int XML_VERSION = 7; public static final String ZEN_TAG = "zen"; private static final String ZEN_ATT_VERSION = "version"; private static final String ZEN_ATT_USER = "user"; Loading core/res/res/xml/default_zen_mode_config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ --> <!-- Default configuration for zen mode. See android.service.notification.ZenModeConfig. --> <zen version="6"> <zen version="7"> <allow alarms="true" media="true" system="false" calls="false" messages="false" reminders="false" events="false" /> <!-- all visual effects that exist as of P --> Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +16 −1 Original line number Diff line number Diff line Loading @@ -2935,7 +2935,7 @@ public class SettingsProvider extends ContentProvider { } private final class UpgradeController { private static final int SETTINGS_VERSION = 162; private static final int SETTINGS_VERSION = 163; private final int mUserId; Loading Loading @@ -3709,6 +3709,21 @@ public class SettingsProvider extends ContentProvider { currentVersion = 162; } if (currentVersion == 162) { // Version 162: 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; } // vXXX: Add new settings above this point. if (currentVersion != newVersion) { Loading packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java +35 −20 Original line number Diff line number Diff line Loading @@ -143,11 +143,25 @@ public class DndTile extends QSTileImpl<BooleanState> { public void showDetail(boolean show) { int zenDuration = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.ZEN_DURATION, 0); boolean showOnboarding = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; if (showOnboarding) { // don't show on-boarding again or notification ever Settings.Global.putInt(mContext.getContentResolver(), Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0); // turn on DND mController.setZen(Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, null, TAG); // show on-boarding screen Intent intent = new Intent(Settings.ZEN_MODE_ONBOARDING); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); Dependency.get(ActivityStarter.class).postStartActivityDismissingKeyguard(intent, 0); } else { switch (zenDuration) { case Settings.Global.ZEN_DURATION_PROMPT: mUiHandler.post(() -> { Dialog mDialog = new EnableZenModeDialog(mContext).createDialog(); mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); mDialog.getWindow().setType( WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); SystemUIDialog.setShowForAllUsers(mDialog, true); SystemUIDialog.registerDismissListener(mDialog); SystemUIDialog.setWindowOnTop(mDialog); Loading @@ -165,6 +179,7 @@ public class DndTile extends QSTileImpl<BooleanState> { conditionId, TAG); } } } @Override protected void handleSecondaryClick() { Loading Loading
core/java/android/service/notification/ZenModeConfig.java +3 −2 Original line number Diff line number Diff line Loading @@ -83,7 +83,8 @@ public class ZenModeConfig implements Parcelable { private static final int DAY_MINUTES = 24 * 60; private static final int ZERO_VALUE_MS = 10 * SECONDS_MS; // Default allow categories set in readXml() from default_zen_mode_config.xml, fallback values: // Default allow categories set in readXml() from default_zen_mode_config.xml, // fallback/upgrade values: private static final boolean DEFAULT_ALLOW_ALARMS = true; private static final boolean DEFAULT_ALLOW_MEDIA = true; private static final boolean DEFAULT_ALLOW_SYSTEM = false; Loading @@ -97,7 +98,7 @@ public class ZenModeConfig implements Parcelable { private static final int DEFAULT_SUPPRESSED_VISUAL_EFFECTS = Policy.getAllSuppressedVisualEffects(); public static final int XML_VERSION = 6; public static final int XML_VERSION = 7; public static final String ZEN_TAG = "zen"; private static final String ZEN_ATT_VERSION = "version"; private static final String ZEN_ATT_USER = "user"; Loading
core/res/res/xml/default_zen_mode_config.xml +1 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ --> <!-- Default configuration for zen mode. See android.service.notification.ZenModeConfig. --> <zen version="6"> <zen version="7"> <allow alarms="true" media="true" system="false" calls="false" messages="false" reminders="false" events="false" /> <!-- all visual effects that exist as of P --> Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +16 −1 Original line number Diff line number Diff line Loading @@ -2935,7 +2935,7 @@ public class SettingsProvider extends ContentProvider { } private final class UpgradeController { private static final int SETTINGS_VERSION = 162; private static final int SETTINGS_VERSION = 163; private final int mUserId; Loading Loading @@ -3709,6 +3709,21 @@ public class SettingsProvider extends ContentProvider { currentVersion = 162; } if (currentVersion == 162) { // Version 162: 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; } // vXXX: Add new settings above this point. if (currentVersion != newVersion) { Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java +35 −20 Original line number Diff line number Diff line Loading @@ -143,11 +143,25 @@ public class DndTile extends QSTileImpl<BooleanState> { public void showDetail(boolean show) { int zenDuration = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.ZEN_DURATION, 0); boolean showOnboarding = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; if (showOnboarding) { // don't show on-boarding again or notification ever Settings.Global.putInt(mContext.getContentResolver(), Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0); // turn on DND mController.setZen(Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS, null, TAG); // show on-boarding screen Intent intent = new Intent(Settings.ZEN_MODE_ONBOARDING); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); Dependency.get(ActivityStarter.class).postStartActivityDismissingKeyguard(intent, 0); } else { switch (zenDuration) { case Settings.Global.ZEN_DURATION_PROMPT: mUiHandler.post(() -> { Dialog mDialog = new EnableZenModeDialog(mContext).createDialog(); mDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); mDialog.getWindow().setType( WindowManager.LayoutParams.TYPE_KEYGUARD_DIALOG); SystemUIDialog.setShowForAllUsers(mDialog, true); SystemUIDialog.registerDismissListener(mDialog); SystemUIDialog.setWindowOnTop(mDialog); Loading @@ -165,6 +179,7 @@ public class DndTile extends QSTileImpl<BooleanState> { conditionId, TAG); } } } @Override protected void handleSecondaryClick() { Loading