diff options
author | John Spurlock <jspurlock@google.com> | 2014-08-26 16:40:35 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-08-28 12:20:05 -0400 |
commit | 2b29bc4c1cef64abdf3a68b60bdcf7207193e980 (patch) | |
tree | 5cae526c5aea83c24c904747517e8133684b5acf /media | |
parent | 1a08a8f52f263fb8431b54dce89d333660ac3b1f (diff) | |
download | frameworks_base-2b29bc4c1cef64abdf3a68b60bdcf7207193e980.zip frameworks_base-2b29bc4c1cef64abdf3a68b60bdcf7207193e980.tar.gz frameworks_base-2b29bc4c1cef64abdf3a68b60bdcf7207193e980.tar.bz2 |
Enhance audio service dumpsys.
- Add device name for keys
- Add max volume for streams
- Add missing stream name constant
Bug:16964015
Change-Id: I92facbd8ae49ba299c27bcb10bcf6668fed0d302
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/AudioService.java | 19 | ||||
-rw-r--r-- | media/java/android/media/AudioSystem.java | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index bce4074..3fea688 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -3486,13 +3486,28 @@ public class AudioService extends IAudioService.Stub { private void dump(PrintWriter pw) { pw.print(" Mute count: "); pw.println(muteCount()); + pw.print(" Max: "); + pw.println((mIndexMax + 5) / 10); pw.print(" Current: "); Set set = mIndex.entrySet(); Iterator i = set.iterator(); while (i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); - pw.print(Integer.toHexString(((Integer)entry.getKey()).intValue()) - + ": " + ((((Integer)entry.getValue()).intValue() + 5) / 10)+", "); + final int device = (Integer) entry.getKey(); + pw.print(Integer.toHexString(device)); + final String deviceName = device == AudioSystem.DEVICE_OUT_DEFAULT ? "default" + : AudioSystem.getOutputDeviceName(device); + if (!deviceName.isEmpty()) { + pw.print(" ("); + pw.print(deviceName); + pw.print(")"); + } + pw.print(": "); + final int index = (((Integer) entry.getValue()) + 5) / 10; + pw.print(index); + if (i.hasNext()) { + pw.print(", "); + } } } } diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java index e11aab1..9a76f94 100644 --- a/media/java/android/media/AudioSystem.java +++ b/media/java/android/media/AudioSystem.java @@ -371,6 +371,7 @@ public class AudioSystem public static final String DEVICE_OUT_HDMI_ARC_NAME = "hmdi_arc"; public static final String DEVICE_OUT_SPDIF_NAME = "spdif"; public static final String DEVICE_OUT_FM_NAME = "fm_transmitter"; + public static final String DEVICE_OUT_AUX_LINE_NAME = "aux_line"; public static String getOutputDeviceName(int device) { @@ -417,6 +418,8 @@ public class AudioSystem return DEVICE_OUT_SPDIF_NAME; case DEVICE_OUT_FM: return DEVICE_OUT_FM_NAME; + case DEVICE_OUT_AUX_LINE: + return DEVICE_OUT_AUX_LINE_NAME; case DEVICE_OUT_DEFAULT: default: return ""; |