Loading services/audiopolicy/AudioPolicyManager.cpp +56 −0 Original line number Diff line number Diff line Loading @@ -1845,6 +1845,11 @@ status_t AudioPolicyManager::dump(int fd) mEffects.valueAt(i)->dump(fd); } snprintf(buffer, SIZE, "\nAudio Patches:\n"); write(fd, buffer, strlen(buffer)); for (size_t i = 0; i < mAudioPatches.size(); i++) { mAudioPatches[i]->dump(fd, 2, i); } return NO_ERROR; } Loading Loading @@ -5214,6 +5219,8 @@ status_t AudioPolicyManager::AudioOutputDescriptor::dump(int fd) char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, " ID: %d\n", mId); result.append(buffer); snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); result.append(buffer); snprintf(buffer, SIZE, " Format: %08x\n", mFormat); Loading Loading @@ -5297,6 +5304,8 @@ status_t AudioPolicyManager::AudioInputDescriptor::dump(int fd) char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, " ID: %d\n", mId); result.append(buffer); snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); result.append(buffer); snprintf(buffer, SIZE, " Format: %d\n", mFormat); Loading Loading @@ -6719,6 +6728,53 @@ status_t AudioPolicyManager::DeviceDescriptor::dump(int fd, int spaces, int inde return NO_ERROR; } status_t AudioPolicyManager::AudioPatch::dump(int fd, int spaces, int index) const { const size_t SIZE = 256; char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, "%*sAudio patch %d:\n", spaces, "", index+1); result.append(buffer); snprintf(buffer, SIZE, "%*s- handle: %2d\n", spaces, "", mHandle); result.append(buffer); snprintf(buffer, SIZE, "%*s- audio flinger handle: %2d\n", spaces, "", mAfPatchHandle); result.append(buffer); snprintf(buffer, SIZE, "%*s- owner uid: %2d\n", spaces, "", mUid); result.append(buffer); snprintf(buffer, SIZE, "%*s- %d sources:\n", spaces, "", mPatch.num_sources); result.append(buffer); for (size_t i = 0; i < mPatch.num_sources; i++) { if (mPatch.sources[i].type == AUDIO_PORT_TYPE_DEVICE) { snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "", mPatch.sources[i].id, enumToString(sDeviceNameToEnumTable, ARRAY_SIZE(sDeviceNameToEnumTable), mPatch.sources[i].ext.device.type)); } else { snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "", mPatch.sources[i].id, mPatch.sources[i].ext.mix.handle); } result.append(buffer); } snprintf(buffer, SIZE, "%*s- %d sinks:\n", spaces, "", mPatch.num_sinks); result.append(buffer); for (size_t i = 0; i < mPatch.num_sinks; i++) { if (mPatch.sinks[i].type == AUDIO_PORT_TYPE_DEVICE) { snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "", mPatch.sinks[i].id, enumToString(sDeviceNameToEnumTable, ARRAY_SIZE(sDeviceNameToEnumTable), mPatch.sinks[i].ext.device.type)); } else { snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "", mPatch.sinks[i].id, mPatch.sinks[i].ext.mix.handle); } result.append(buffer); } write(fd, result.string(), result.size()); return NO_ERROR; } // --- audio_policy.conf file parsing Loading services/audiopolicy/AudioPolicyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,8 @@ protected: const struct audio_patch *patch, uid_t uid) : mHandle(handle), mPatch(*patch), mUid(uid), mAfPatchHandle(0) {} status_t dump(int fd, int spaces, int index) const; audio_patch_handle_t mHandle; struct audio_patch mPatch; uid_t mUid; Loading Loading
services/audiopolicy/AudioPolicyManager.cpp +56 −0 Original line number Diff line number Diff line Loading @@ -1845,6 +1845,11 @@ status_t AudioPolicyManager::dump(int fd) mEffects.valueAt(i)->dump(fd); } snprintf(buffer, SIZE, "\nAudio Patches:\n"); write(fd, buffer, strlen(buffer)); for (size_t i = 0; i < mAudioPatches.size(); i++) { mAudioPatches[i]->dump(fd, 2, i); } return NO_ERROR; } Loading Loading @@ -5214,6 +5219,8 @@ status_t AudioPolicyManager::AudioOutputDescriptor::dump(int fd) char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, " ID: %d\n", mId); result.append(buffer); snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); result.append(buffer); snprintf(buffer, SIZE, " Format: %08x\n", mFormat); Loading Loading @@ -5297,6 +5304,8 @@ status_t AudioPolicyManager::AudioInputDescriptor::dump(int fd) char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, " ID: %d\n", mId); result.append(buffer); snprintf(buffer, SIZE, " Sampling rate: %d\n", mSamplingRate); result.append(buffer); snprintf(buffer, SIZE, " Format: %d\n", mFormat); Loading Loading @@ -6719,6 +6728,53 @@ status_t AudioPolicyManager::DeviceDescriptor::dump(int fd, int spaces, int inde return NO_ERROR; } status_t AudioPolicyManager::AudioPatch::dump(int fd, int spaces, int index) const { const size_t SIZE = 256; char buffer[SIZE]; String8 result; snprintf(buffer, SIZE, "%*sAudio patch %d:\n", spaces, "", index+1); result.append(buffer); snprintf(buffer, SIZE, "%*s- handle: %2d\n", spaces, "", mHandle); result.append(buffer); snprintf(buffer, SIZE, "%*s- audio flinger handle: %2d\n", spaces, "", mAfPatchHandle); result.append(buffer); snprintf(buffer, SIZE, "%*s- owner uid: %2d\n", spaces, "", mUid); result.append(buffer); snprintf(buffer, SIZE, "%*s- %d sources:\n", spaces, "", mPatch.num_sources); result.append(buffer); for (size_t i = 0; i < mPatch.num_sources; i++) { if (mPatch.sources[i].type == AUDIO_PORT_TYPE_DEVICE) { snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "", mPatch.sources[i].id, enumToString(sDeviceNameToEnumTable, ARRAY_SIZE(sDeviceNameToEnumTable), mPatch.sources[i].ext.device.type)); } else { snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "", mPatch.sources[i].id, mPatch.sources[i].ext.mix.handle); } result.append(buffer); } snprintf(buffer, SIZE, "%*s- %d sinks:\n", spaces, "", mPatch.num_sinks); result.append(buffer); for (size_t i = 0; i < mPatch.num_sinks; i++) { if (mPatch.sinks[i].type == AUDIO_PORT_TYPE_DEVICE) { snprintf(buffer, SIZE, "%*s- Device ID %d %s\n", spaces + 2, "", mPatch.sinks[i].id, enumToString(sDeviceNameToEnumTable, ARRAY_SIZE(sDeviceNameToEnumTable), mPatch.sinks[i].ext.device.type)); } else { snprintf(buffer, SIZE, "%*s- Mix ID %d I/O handle %d\n", spaces + 2, "", mPatch.sinks[i].id, mPatch.sinks[i].ext.mix.handle); } result.append(buffer); } write(fd, result.string(), result.size()); return NO_ERROR; } // --- audio_policy.conf file parsing Loading
services/audiopolicy/AudioPolicyManager.h +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,8 @@ protected: const struct audio_patch *patch, uid_t uid) : mHandle(handle), mPatch(*patch), mUid(uid), mAfPatchHandle(0) {} status_t dump(int fd, int spaces, int index) const; audio_patch_handle_t mHandle; struct audio_patch mPatch; uid_t mUid; Loading