summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-12-01 17:06:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-01 17:06:14 +0000
commit21d68f4808db02aa3252ba5dec8b0220d053cab3 (patch)
tree16841dc91979f54435ff9097fed2f0edcd51fb58 /packages/SystemUI/src/com/android/systemui
parent6cacf44e7ecfe50097adc99dab97c3fb9770a1af (diff)
parentbcc1087af40a0e1bb35dbe8a39c830ecdea8280b (diff)
downloadframeworks_base-21d68f4808db02aa3252ba5dec8b0220d053cab3.zip
frameworks_base-21d68f4808db02aa3252ba5dec8b0220d053cab3.tar.gz
frameworks_base-21d68f4808db02aa3252ba5dec8b0220d053cab3.tar.bz2
Merge "Volume: Improve inline volume controls used in settings." into lmp-mr1-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java9
4 files changed, 11 insertions, 23 deletions
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 6fecc0f..4fb505e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -1030,12 +1030,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
}
- public void onInternalRingerModeChanged() {
- if (mIconPolicy != null) {
- mIconPolicy.updateVolumeZen();
- }
- }
-
private void startKeyguard() {
KeyguardViewMediator keyguardViewMediator = getComponent(KeyguardViewMediator.class);
mStatusBarKeyguardViewManager = keyguardViewMediator.registerStatusBar(this,
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 94401d3..5c254a26 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -90,7 +90,8 @@ public class PhoneStatusBarPolicy {
action.equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
updateBluetooth();
}
- else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION)) {
+ else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
+ action.equals(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION)) {
updateVolumeZen();
}
else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
@@ -116,6 +117,7 @@ public class PhoneStatusBarPolicy {
filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
filter.addAction(Intent.ACTION_SYNC_STATE_CHANGED);
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
+ filter.addAction(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION);
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
@@ -208,7 +210,7 @@ public class PhoneStatusBarPolicy {
}
}
- public final void updateVolumeZen() {
+ private final void updateVolumeZen() {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
boolean zenVisible = false;
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
index 0aa3c1e..d3a8fc0 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java
@@ -546,6 +546,7 @@ public class VolumePanel extends Handler implements DemoMode {
private void registerReceiver() {
final IntentFilter filter = new IntentFilter();
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
+ filter.addAction(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION);
filter.addAction(Intent.ACTION_SCREEN_OFF);
mContext.registerReceiver(new BroadcastReceiver() {
@Override
@@ -554,7 +555,12 @@ public class VolumePanel extends Handler implements DemoMode {
if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
removeMessages(MSG_RINGER_MODE_CHANGED);
- sendMessage(obtainMessage(MSG_RINGER_MODE_CHANGED));
+ sendEmptyMessage(MSG_RINGER_MODE_CHANGED);
+ }
+
+ if (AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION.equals(action)) {
+ removeMessages(MSG_INTERNAL_RINGER_MODE_CHANGED);
+ sendEmptyMessage(MSG_INTERNAL_RINGER_MODE_CHANGED);
}
if (Intent.ACTION_SCREEN_OFF.equals(action)) {
@@ -991,11 +997,6 @@ public class VolumePanel extends Handler implements DemoMode {
obtainMessage(MSG_LAYOUT_DIRECTION, layoutDirection, 0).sendToTarget();
}
- public void postInternalRingerModeChanged(int mode) {
- removeMessages(MSG_INTERNAL_RINGER_MODE_CHANGED);
- obtainMessage(MSG_INTERNAL_RINGER_MODE_CHANGED, mode, 0).sendToTarget();
- }
-
private static String flagsToString(int flags) {
return flags == 0 ? "0" : (flags + "=" + AudioManager.flagsToString(flags));
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
index e452b22..7102c2a 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java
@@ -182,15 +182,6 @@ public class VolumeUI extends SystemUI {
}
@Override
- public void internalRingerModeChanged(int mode) throws RemoteException {
- mPanel.postInternalRingerModeChanged(mode);
- final PhoneStatusBar psb = getComponent(PhoneStatusBar.class);
- if (psb != null) {
- psb.onInternalRingerModeChanged();
- }
- }
-
- @Override
public ZenModeController getZenController() {
return mPanel.getZenController();
}