am 70dcf487: Merge "Enhance audio service dumpsys." into lmp-dev
* commit '70dcf48700875d43b4ec845595c862a96a80f998': Enhance audio service dumpsys.
This commit is contained in:
@@ -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(", ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 "";
|
||||
|
||||
Reference in New Issue
Block a user