diff options
author | John Spurlock <jspurlock@google.com> | 2015-02-17 11:01:51 -0500 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-02-17 11:01:51 -0500 |
commit | a9dfbe8b122d746cf8841fe1b13d31e7e0fc9c52 (patch) | |
tree | 02a0041ca2847398ba0c7d6c940b3ad182814834 | |
parent | b25334ca3c2c4f792254bf8e628788d0b7c4775a (diff) | |
download | frameworks_base-a9dfbe8b122d746cf8841fe1b13d31e7e0fc9c52.zip frameworks_base-a9dfbe8b122d746cf8841fe1b13d31e7e0fc9c52.tar.gz frameworks_base-a9dfbe8b122d746cf8841fe1b13d31e7e0fc9c52.tar.bz2 |
Volume: Allow dialog to query "muteable" streams.
Similar to the existing ability to query streams affected
by ringer mode.
Bug:19260237
Change-Id: I76eb5ab6b7c7e3a4d73ac1909289c560194d4fe8
-rw-r--r-- | media/java/android/media/AudioManager.java | 13 | ||||
-rw-r--r-- | media/java/android/media/IAudioService.aidl | 2 | ||||
-rw-r--r-- | services/core/java/com/android/server/audio/AudioService.java | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 7084eba..da89cf4 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -3334,6 +3334,19 @@ public class AudioManager { * Only useful for volume controllers. * @hide */ + public boolean isStreamAffectedByMute(int streamType) { + try { + return getService().isStreamAffectedByMute(streamType); + } catch (RemoteException e) { + Log.w(TAG, "Error calling isStreamAffectedByMute", e); + return false; + } + } + + /** + * Only useful for volume controllers. + * @hide + */ public void disableSafeMediaVolume() { try { getService().disableSafeMediaVolume(); diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl index dabd9c2..17f5b59 100644 --- a/media/java/android/media/IAudioService.aidl +++ b/media/java/android/media/IAudioService.aidl @@ -202,6 +202,8 @@ interface IAudioService { boolean isStreamAffectedByRingerMode(int streamType); + boolean isStreamAffectedByMute(int streamType); + void disableSafeMediaVolume(); int setHdmiSystemAudioSupported(boolean on); diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 4301427..201b1b7 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -3208,6 +3208,7 @@ public class AudioService extends IAudioService.Stub { return false; } + @Override public boolean isStreamAffectedByMute(int streamType) { return (mMuteAffectedStreams & (1 << streamType)) != 0; } |