VolumeZen: Unify ringer + zen status bar icons.
- Remove zen mode indicator from LHS.
- Update ringer mode icons to latest design.
- Zen mode trumps ringer mode in slot if enabled (as it will in QS).
Change-Id: I48bd7e8fdb2a19333b0b6d24d34cc98aa142691f
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
index 869edff..0a3fdef 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
@@ -60,7 +60,8 @@
} else if (mDemoMode && command.equals(COMMAND_STATUS)) {
String volume = args.getString("volume");
if (volume != null) {
- int iconId = volume.equals("silent") ? R.drawable.stat_sys_ringer_silent
+ int iconId = volume.equals("zen") ? R.drawable.stat_sys_ringer_zen
+ : volume.equals("silent") ? R.drawable.stat_sys_ringer_silent
: volume.equals("vibrate") ? R.drawable.stat_sys_ringer_vibrate
: 0;
updateSlot("volume", null, iconId);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index a685073..a2bb385 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -223,8 +223,6 @@
IconMerger mNotificationIcons;
// [+>
View mMoreIcon;
- // mode indicator icon
- ImageView mModeIcon;
// expanded notifications
NotificationPanelView mNotificationPanel; // the sliding/resizing panel within the notification window
@@ -488,13 +486,14 @@
@Override
public void setZenMode(int mode) {
super.setZenMode(mode);
- if (mModeIcon == null) return;
if (!isDeviceProvisioned()) return;
final boolean zen = mode != Settings.Global.ZEN_MODE_OFF;
- mModeIcon.setVisibility(zen ? View.VISIBLE : View.GONE);
if (!zen) {
mIntercepted.releaseIntercepted();
}
+ if (mIconPolicy != null) {
+ mIconPolicy.setZenMode(zen);
+ }
}
@Override
@@ -618,8 +617,6 @@
mNotificationIcons = (IconMerger)mStatusBarView.findViewById(R.id.notificationIcons);
mMoreIcon = mStatusBarView.findViewById(R.id.moreIcon);
mNotificationIcons.setOverflowIndicator(mMoreIcon);
- mModeIcon = (ImageView)mStatusBarView.findViewById(R.id.modeIcon);
- mModeIcon.setImageResource(R.drawable.ic_qs_zen_on);
mStatusBarContents = (LinearLayout)mStatusBarView.findViewById(R.id.status_bar_contents);
mTickerView = mStatusBarView.findViewById(R.id.ticker);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 194774d..b6f5ae0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -63,6 +63,9 @@
// ringer volume
private boolean mVolumeVisible;
+ // zen mode
+ private boolean mZen;
+
// bluetooth device status
private boolean mBluetoothEnabled = false;
@@ -152,6 +155,11 @@
updateVolume();
}
+ public void setZenMode(boolean zen) {
+ mZen = zen;
+ updateVolume();
+ }
+
private final void updateAlarm(Intent intent) {
boolean alarmSet = intent.getBooleanExtra("alarmSet", false);
mService.setIconVisibility("alarm_clock", alarmSet);
@@ -195,11 +203,15 @@
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
final int ringerMode = audioManager.getRingerMode();
final boolean visible = ringerMode == AudioManager.RINGER_MODE_SILENT ||
- ringerMode == AudioManager.RINGER_MODE_VIBRATE;
+ ringerMode == AudioManager.RINGER_MODE_VIBRATE ||
+ mZen;
final int iconId;
String contentDescription = null;
- if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
+ if (mZen) {
+ iconId = R.drawable.stat_sys_ringer_zen;
+ contentDescription = mContext.getString(R.string.zen_mode_title);
+ } else if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
iconId = R.drawable.stat_sys_ringer_vibrate;
contentDescription = mContext.getString(R.string.accessibility_ringer_vibrate);
} else {