summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-05-19 09:44:06 -0400
committerJohn Spurlock <jspurlock@google.com>2014-05-19 10:10:42 -0400
commitba2c6a084fc8496c4430b5df3598ed41dfcd744b (patch)
tree4830b64c5822e9ac7d91a3d91b6e27e801c0df50 /packages/SystemUI/src
parent1cd74ddecece721cebf63434f611ce372aafec8d (diff)
downloadframeworks_base-ba2c6a084fc8496c4430b5df3598ed41dfcd744b.zip
frameworks_base-ba2c6a084fc8496c4430b5df3598ed41dfcd744b.tar.gz
frameworks_base-ba2c6a084fc8496c4430b5df3598ed41dfcd744b.tar.bz2
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
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java16
3 files changed, 19 insertions, 9 deletions
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 @@ public class DemoStatusIcons extends LinearLayout implements DemoMode {
} 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 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
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 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
@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 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
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 @@ public class PhoneStatusBarPolicy {
// ringer volume
private boolean mVolumeVisible;
+ // zen mode
+ private boolean mZen;
+
// bluetooth device status
private boolean mBluetoothEnabled = false;
@@ -152,6 +155,11 @@ public class PhoneStatusBarPolicy {
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 @@ public class PhoneStatusBarPolicy {
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 {