Crash audioserver if EPIPE (DEAD_OBJECT) is received from the HAL
audioflinger doesn't have a proper way to re-establish all
the opened streams if HAL crashes. The only valid way of dealing
with them is to restart the audioserver.
Although broadcastradio and sountrigger have cleaner protocols
for dealing with HAL failures and can handle HAL crash and restart,
since the audio side will anyway get broken, it makes sense
to also kill the audioserver when they detect HAL crash.
Change-Id: I5f8e8c1d0981042cdd435a3ddbb6526e9f226e6b
Test: kill audio-hal process, watch dmesg and logcat
diff --git a/media/libaudiohal/ConversionHelperHidl.h b/media/libaudiohal/ConversionHelperHidl.h
index 628913a..428daf2 100644
--- a/media/libaudiohal/ConversionHelperHidl.h
+++ b/media/libaudiohal/ConversionHelperHidl.h
@@ -30,6 +30,9 @@
namespace android {
class ConversionHelperHidl {
+ public:
+ static void crashIfHalIsDead(const Status& status);
+
protected:
static status_t keysFromHal(const String8& keys, hidl_vec<hidl_string> *hidlKeys);
static status_t parametersFromHal(const String8& kvPairs, hidl_vec<ParameterValue> *hidlParams);