summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/volume
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-04-02 17:41:21 -0400
committerJohn Spurlock <jspurlock@google.com>2015-04-02 23:00:40 -0400
commit4f1163c83e79da52b2be7ff6b10163441895bc26 (patch)
tree240a0f0e5723e3187ac9cfa7b960f83de247517e /packages/SystemUI/src/com/android/systemui/volume
parent24d3dad8dd91af037e2f7cc2780efc1be643bbe3 (diff)
downloadframeworks_base-4f1163c83e79da52b2be7ff6b10163441895bc26.zip
frameworks_base-4f1163c83e79da52b2be7ff6b10163441895bc26.tar.gz
frameworks_base-4f1163c83e79da52b2be7ff6b10163441895bc26.tar.bz2
Zen: Add a new level: alarms-only.
Like no-interruptions, but allows alarms. Bug: 19260237 Change-Id: I36bf0a333362256c8e54cd83992cb46c3bcb7f69
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume')
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/Events.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java14
3 files changed, 17 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/Events.java b/packages/SystemUI/src/com/android/systemui/volume/Events.java
index b20e39c..12dca94 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/Events.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/Events.java
@@ -177,6 +177,7 @@ public class Events {
switch (zenMode) {
case Global.ZEN_MODE_OFF: return "off";
case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: return "important_interruptions";
+ case Global.ZEN_MODE_ALARMS: return "alarms";
case Global.ZEN_MODE_NO_INTERRUPTIONS: return "no_interruptions";
default: return "unknown";
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
index ba5b8d1..f99eb6d 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenFooter.java
@@ -139,13 +139,17 @@ public class ZenFooter extends LinearLayout {
}
public boolean isZen() {
- return isZenPriority() || isZenNone();
+ return isZenPriority() || isZenAlarms() || isZenNone();
}
private boolean isZenPriority() {
return mZen == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
}
+ private boolean isZenAlarms() {
+ return mZen == Global.ZEN_MODE_ALARMS;
+ }
+
private boolean isZenNone() {
return mZen == Global.ZEN_MODE_NO_INTERRUPTIONS;
}
@@ -188,6 +192,7 @@ public class ZenFooter extends LinearLayout {
mSwitchBarIcon.setAlpha(isZen ? 1 : mSecondaryAlpha);
final String line1 =
isZenPriority() ? mContext.getString(R.string.interruption_level_priority)
+ : isZenAlarms() ? mContext.getString(R.string.interruption_level_alarms)
: isZenNone() ? mContext.getString(R.string.interruption_level_none)
: null;
Util.setText(mSummaryLine1, line1);
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
index a7f6175..cb6c29f 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
@@ -155,7 +155,7 @@ public class ZenModePanel extends LinearLayout {
} else {
mZenButtonsContainer.setBackgroundResource(R.drawable.qs_background_secondary);
}
- mZenButtons.getChildAt(2).setVisibility(mEmbedded ? GONE : VISIBLE);
+ mZenButtons.getChildAt(3).setVisibility(mEmbedded ? GONE : VISIBLE);
mZenEmbeddedDivider.setVisibility(mEmbedded ? VISIBLE : GONE);
setExpanded(mEmbedded);
updateWidgets();
@@ -166,8 +166,11 @@ public class ZenModePanel extends LinearLayout {
super.onFinishInflate();
mZenButtons = (SegmentedButtons) findViewById(R.id.zen_buttons);
- mZenButtons.addButton(R.string.interruption_level_none, Global.ZEN_MODE_NO_INTERRUPTIONS);
- mZenButtons.addButton(R.string.interruption_level_priority,
+ mZenButtons.addButton(R.string.interruption_level_none_twoline,
+ Global.ZEN_MODE_NO_INTERRUPTIONS);
+ mZenButtons.addButton(R.string.interruption_level_alarms_twoline,
+ Global.ZEN_MODE_ALARMS);
+ mZenButtons.addButton(R.string.interruption_level_priority_twoline,
Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
mZenButtons.addButton(R.string.interruption_level_all, Global.ZEN_MODE_OFF);
mZenButtons.setCallback(mZenButtonsCallback);
@@ -718,7 +721,10 @@ public class ZenModePanel extends LinearLayout {
case Global.ZEN_MODE_NO_INTERRUPTIONS:
modeText = mContext.getString(R.string.zen_no_interruptions);
break;
- default:
+ case Global.ZEN_MODE_ALARMS:
+ modeText = mContext.getString(R.string.zen_alarms);
+ break;
+ default:
return;
}
announceForAccessibility(mContext.getString(R.string.zen_mode_and_condition, modeText,