summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android')
-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 {