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

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

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

View File

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

View File

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

View File

@@ -524,11 +524,28 @@ public class AudioSystemAdapter implements AudioSystem.RoutingUpdateCallback {
* @param pw * @param pw
*/ */
public void dump(PrintWriter 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) { if (!ENABLE_GETDEVICES_STATS) {
// only stats in this dump // only stats in the rest of this dump
return; return;
} }
pw.println("\nAudioSystemAdapter:");
for (int i = 0; i < NB_MEASUREMENTS; i++) { for (int i = 0; i < NB_MEASUREMENTS; i++) {
pw.println(mMethodNames[i] pw.println(mMethodNames[i]
+ ": counter=" + mMethodCallCounter[i] + ": counter=" + mMethodCallCounter[i]