media utils: dump audio HAL service before restarting audioserver
Add request to create tombstones of audio HAL servers before restarting
audioserver process when the watchdog triggers.
Add audio device factory HAL interface API to retrieve HAL process pids when
possible (on debug builds).
Add AudioFlinger service API to set audio HAL process pids from
JAVA AudioService.
Bug: 141528385
Test: Force watchdog and verify tombstone creation
Change-Id: I68c1e8fb4db23e5952ad0c93d7d0b9d121b8ec18
diff --git a/media/libaudioclient/AudioSystem.cpp b/media/libaudioclient/AudioSystem.cpp
index 20ca35c..54184e0 100644
--- a/media/libaudioclient/AudioSystem.cpp
+++ b/media/libaudioclient/AudioSystem.cpp
@@ -1392,6 +1392,12 @@
return af->getMicrophones(microphones);
}
+status_t AudioSystem::setAudioHalPids(const std::vector<pid_t>& pids) {
+ const sp<IAudioFlinger>& af = AudioSystem::get_audio_flinger();
+ if (af == nullptr) return PERMISSION_DENIED;
+ return af->setAudioHalPids(pids);
+}
+
status_t AudioSystem::getSurroundFormats(unsigned int *numSurroundFormats,
audio_format_t *surroundFormats,
bool *surroundFormatsEnabled,