Introduce zen mode.
- New global zen mode setting with three values:
ZEN_MODE_OFF, ZEN_MODE_LIMITED, ZEN_MODE_FULL
- Status bar icon (on lhs) when in _LIMITED / _FULL
- Rules are hardcoded for now:
_LIMITED = intercept all notifications except calls/alarms
_FULL = intercept everything
- UI affordance in shade to set mode
- Only one exit condition: "Until you delete this"
- Intercepted notifications:
- appear darker in the shade
- do not cause sound/vibration
- do not fire fullScreenIntents
- do not contribute an icon to the status bar
Change-Id: Ic36c95982b483432006bf9dab102a31370382aa9
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 18018e2..40bbbd4 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6082,6 +6082,24 @@
"lock_screen_show_notifications";
/**
+ * Defines global zen mode. One of ZEN_MODE_OFF, ZEN_MODE_LIMITED, ZEN_MODE_FULL.
+ *
+ * @hide
+ */
+ public static final String ZEN_MODE = "zen_mode";
+
+ /** @hide */ public static final int ZEN_MODE_OFF = 0;
+ /** @hide */ public static final int ZEN_MODE_LIMITED = 1;
+ /** @hide */ public static final int ZEN_MODE_FULL = 2;
+
+ /** @hide */ public static String zenModeToString(int mode) {
+ if (mode == ZEN_MODE_OFF) return "ZEN_MODE_OFF";
+ if (mode == ZEN_MODE_LIMITED) return "ZEN_MODE_LIMITED";
+ if (mode == ZEN_MODE_FULL) return "ZEN_MODE_FULL";
+ throw new IllegalArgumentException("Invalid zen mode: " + mode);
+ }
+
+ /**
* Settings to backup. This is here so that it's in the same place as the settings
* keys and easy to update.
*