diff options
author | John Spurlock <jspurlock@google.com> | 2014-11-28 15:29:21 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-11-28 15:29:21 -0500 |
commit | bcc1087af40a0e1bb35dbe8a39c830ecdea8280b (patch) | |
tree | cc9fe7f9a741efef1c7e450db6ff9930a0788530 /packages/SystemUI/src/com/android/systemui/volume | |
parent | c1de25d8ebaecff697c1d5dfaa445e18ee07fa2d (diff) | |
download | frameworks_base-bcc1087af40a0e1bb35dbe8a39c830ecdea8280b.zip frameworks_base-bcc1087af40a0e1bb35dbe8a39c830ecdea8280b.tar.gz frameworks_base-bcc1087af40a0e1bb35dbe8a39c830ecdea8280b.tar.bz2 |
Volume: Improve inline volume controls used in settings.
- Make the system internal ringer mode change signal available to
other system components via a standard intent, instead of a
volume-controller-only binder call.
- Update sysui to use new intent for icon policy.
- Add proper muting state to the volumizer, to look more like
the associated volume panel slider.
- Add basic ringer mode state tracking for the notification-ring
slider setting.
Bug: 17899613
Change-Id: Ie2df52edb070055ef59c74039162a0e785d2fdbb
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/volume')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java | 13 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java | 9 |
2 files changed, 7 insertions, 15 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java b/packages/SystemUI/src/com/android/systemui/volume/VolumePanel.java index 1fe4698..e79258e 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(); } |