summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-03-10 21:33:44 -0400
committerJohn Spurlock <jspurlock@google.com>2015-03-13 11:02:01 -0400
commitb6e19e3e0f0170d058636101e23f964196f6f4b2 (patch)
tree19f605a5db398b21c9260da6da69d0194908f97c /media
parent63b9e8200e96fd66eefc19bb48cfe7b7f084e4c5 (diff)
downloadframeworks_base-b6e19e3e0f0170d058636101e23f964196f6f4b2.zip
frameworks_base-b6e19e3e0f0170d058636101e23f964196f6f4b2.tar.gz
frameworks_base-b6e19e3e0f0170d058636101e23f964196f6f4b2.tar.bz2
AudioService: Define minimum levels for volume streams.
- Set a floor of 1 for voice call + bluetooth sco, otherwise 0. - All api calls validated to ensure a floor of the min level. - Volume UI updated to shift the seekbar by the min value. - Remove duplicate static max method in AudioService. - Ensure streams with a min level > 0 are not considered muteable. Bug: 19260237 Change-Id: I213180c9c277f51bd3897b7f777e5f88ed1db125
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioManager.java18
-rw-r--r--media/java/android/media/IAudioService.aidl2
2 files changed, 20 insertions, 0 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 4fdcfa4..8c1ba05 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -866,6 +866,24 @@ public class AudioManager {
}
/**
+ * Returns the minimum volume index for a particular stream.
+ *
+ * @param streamType The stream type whose minimum volume index is returned.
+ * @return The minimum valid volume index for the stream.
+ * @see #getStreamVolume(int)
+ * @hide
+ */
+ public int getStreamMinVolume(int streamType) {
+ IAudioService service = getService();
+ try {
+ return service.getStreamMinVolume(streamType);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Dead object in getStreamMinVolume", e);
+ return 0;
+ }
+ }
+
+ /**
* Returns the current volume index for a particular stream.
*
* @param streamType The stream type whose volume index is returned.
diff --git a/media/java/android/media/IAudioService.aidl b/media/java/android/media/IAudioService.aidl
index 827cb13..8e96218 100644
--- a/media/java/android/media/IAudioService.aidl
+++ b/media/java/android/media/IAudioService.aidl
@@ -59,6 +59,8 @@ interface IAudioService {
int getStreamVolume(int streamType);
+ int getStreamMinVolume(int streamType);
+
int getStreamMaxVolume(int streamType);
int getLastAudibleStreamVolume(int streamType);