Merge "AudioService: dump routing cache in AudioSystemAdapter" into sc-v2-dev am: 2969fc57f9 am: 984591b424

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16591745

Change-Id: I1fabe56ebad353f53fb73f10707128a063c68412
This commit is contained in:
Eric Laurent
2022-01-11 10:05:43 +00:00
committed by Automerger Merge Worker
3 changed files with 22 additions and 5 deletions

View File

@@ -1357,7 +1357,7 @@ public class AudioSystem
return DEVICE_OUT_BLE_SPEAKER_NAME;
case DEVICE_OUT_DEFAULT:
default:
return Integer.toString(device);
return "0x" + Integer.toHexString(device);
}
}

View File

@@ -9319,8 +9319,6 @@ public class AudioService extends IAudioService.Stub
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
mAudioSystem.dump(pw);
sLifecycleLogger.dump(pw);
if (mAudioHandler != null) {
pw.println("\nMessage handler (watch for unhandled messages):");
@@ -9400,6 +9398,8 @@ public class AudioService extends IAudioService.Stub
pw.println("mHasSpatializerEffect:" + mHasSpatializerEffect);
pw.println("isSpatializerEnabled:" + isSpatializerEnabled());
pw.println("isSpatialAudioEnabled:" + isSpatialAudioEnabled());
mAudioSystem.dump(pw);
}
private void dumpSupportedSystemUsage(PrintWriter pw) {

View File

@@ -524,11 +524,28 @@ public class AudioSystemAdapter implements AudioSystem.RoutingUpdateCallback {
* @param pw
*/
public void dump(PrintWriter pw) {
pw.println("\nAudioSystemAdapter:");
pw.println(" mDevicesForStreamCache:");
if (mDevicesForStreamCache != null) {
for (Integer stream : mDevicesForStreamCache.keySet()) {
pw.println("\t stream:" + stream + " device:"
+ AudioSystem.getOutputDeviceName(mDevicesForStreamCache.get(stream)));
}
}
pw.println(" mDevicesForAttrCache:");
if (mDevicesForAttrCache != null) {
for (AudioAttributes attr : mDevicesForAttrCache.keySet()) {
pw.println("\t" + attr);
for (AudioDeviceAttributes devAttr : mDevicesForAttrCache.get(attr)) {
pw.println("\t\t" + devAttr);
}
}
}
if (!ENABLE_GETDEVICES_STATS) {
// only stats in this dump
// only stats in the rest of this dump
return;
}
pw.println("\nAudioSystemAdapter:");
for (int i = 0; i < NB_MEASUREMENTS; i++) {
pw.println(mMethodNames[i]
+ ": counter=" + mMethodCallCounter[i]