From 1ff1e6edf133158351e793dd842bd0655ef6c199 Mon Sep 17 00:00:00 2001 From: John Spurlock Date: Mon, 9 Mar 2015 14:21:20 -0400 Subject: AudioService: Fix device dump in dumpsys output. Bug: 19653026 Change-Id: Id09a502f1507477403c49be32ee0ed0f00ab288f --- services/core/java/com/android/server/audio/AudioService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'services') diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 5d386bd..61a7263 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -3620,7 +3620,9 @@ public class AudioService extends IAudioService.Stub { pw.print(" Devices: "); final int devices = AudioSystem.getDevicesForStream(mStreamType); int device, i = 0, n = 0; - while ((device = 1 << i) <= AudioSystem.DEVICE_OUT_DEFAULT) { + // iterate all devices from 1 to DEVICE_OUT_DEFAULT exclusive + // (the default device is not returned by getDevicesForStream) + while ((device = 1 << i) != AudioSystem.DEVICE_OUT_DEFAULT) { if ((devices & device) != 0) { if (n++ > 0) { pw.print(", "); -- cgit v1.1