diff options
author | John Spurlock <jspurlock@google.com> | 2015-03-03 17:35:57 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-03-12 13:57:08 -0400 |
commit | a48d779dad4c48aa2f97ad021ae3a5649c058312 (patch) | |
tree | cb1bc381bdd1716ee4606aaadca4695af5a8c491 /packages/SystemUI | |
parent | 80c24d4a27573b90368e78a155abe90849db1b06 (diff) | |
download | frameworks_base-a48d779dad4c48aa2f97ad021ae3a5649c058312.zip frameworks_base-a48d779dad4c48aa2f97ad021ae3a5649c058312.tar.gz frameworks_base-a48d779dad4c48aa2f97ad021ae3a5649c058312.tar.bz2 |
Volume policy updates.
- Make volume policy settable by the volume UI instead
of hardcoded in AudioService.
- Add status bar icon for silent mode.
- Limit unmute-on-volume-adjust behavior to tvs.
- Ensure all changes to device volume are sent through
setIndex so no change events are missed.
Bug: 19260237
Change-Id: Iea070a7a6f90ff620e39629f2da3f33f87223d72
Diffstat (limited to 'packages/SystemUI')
3 files changed, 35 insertions, 1 deletions
diff --git a/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml b/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml new file mode 100644 index 0000000..36e6cef --- /dev/null +++ b/packages/SystemUI/res/drawable/stat_sys_ringer_silent.xml @@ -0,0 +1,27 @@ +<!-- +Copyright (C) 2015 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<inset xmlns:android="http://schemas.android.com/apk/res/android" + android:insetLeft="3dp" + android:insetRight="3dp"> + <vector android:width="18dp" + android:height="18dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M23.000000,44.000000c2.200000,0.000000 4.000000,-1.800000 4.000000,-4.000000l-8.000000,0.000000C19.000000,42.200001 20.799999,44.000000 23.000000,44.000000zM36.000000,21.000000c0.000000,-6.100000 -4.300000,-11.300000 -10.000000,-12.600000L26.000000,7.000000c0.000000,-1.700000 -1.300000,-3.000000 -3.000000,-3.000000c-1.700000,0.000000 -3.000000,1.300000 -3.000000,3.000000l0.000000,1.400000c-1.000000,0.200000 -2.000000,0.600000 -2.900000,1.100000L36.000000,28.400000L36.000000,21.000000zM35.500000,38.000000l4.000000,4.000000l2.500000,-2.500000L8.500000,6.000000L6.000000,8.500000l5.800000,5.800000C10.700000,16.299999 10.000000,18.600000 10.000000,21.000000l0.000000,11.000000l-4.000000,4.000000l0.000000,2.000000L35.500000,38.000000z"/> + </vector> +</inset> 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 5da8457..2236aae 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java @@ -213,7 +213,12 @@ public class PhoneStatusBarPolicy { zenDescription = mContext.getString(R.string.zen_important_interruptions); } - if (mZen != Global.ZEN_MODE_NO_INTERRUPTIONS && + if (DndTile.isVisible(mContext) + && audioManager.getRingerModeInternal() == AudioManager.RINGER_MODE_SILENT) { + volumeVisible = true; + volumeIconId = R.drawable.stat_sys_ringer_silent; + volumeDescription = mContext.getString(R.string.accessibility_ringer_silent); + } else if (mZen != Global.ZEN_MODE_NO_INTERRUPTIONS && audioManager.getRingerModeInternal() == AudioManager.RINGER_MODE_VIBRATE) { volumeVisible = true; volumeIconId = R.drawable.stat_sys_ringer_vibrate; diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java index 7603c7d..687452d 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java +++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeUI.java @@ -31,6 +31,7 @@ import android.content.res.Configuration; import android.media.AudioManager; import android.media.IRemoteVolumeController; import android.media.IVolumeController; +import android.media.VolumePolicy; import android.media.session.ISessionController; import android.media.session.MediaController; import android.media.session.MediaSessionManager; @@ -114,6 +115,7 @@ public class VolumeUI extends SystemUI { if (register) { if (LOGD) Log.d(TAG, "Registering default volume controller"); mAudioManager.setVolumeController(mVolumeController); + mAudioManager.setVolumePolicy(VolumePolicy.DEFAULT); mMediaSessionManager.setRemoteVolumeController(mRemoteVolumeController); DndTile.setVisible(mContext, false); } else { |