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/EffectsFactoryHalHidl.cpp b/media/libaudiohal/EffectsFactoryHalHidl.cpp
index 4f2eef0..bacbe4e 100644
--- a/media/libaudiohal/EffectsFactoryHalHidl.cpp
+++ b/media/libaudiohal/EffectsFactoryHalHidl.cpp
@@ -20,6 +20,7 @@
 #include <cutils/native_handle.h>
 #include <media/EffectsFactoryApi.h>
 
+#include "ConversionHelperHidl.h"
 #include "EffectHalHidl.h"
 #include "EffectsFactoryHalHidl.h"
 #include "HidlUtils.h"
@@ -63,6 +64,7 @@
         return retval == Result::OK ? OK : NO_INIT;
     }
     mLastDescriptors.resize(0);
+    ConversionHelperHidl::crashIfHalIsDead(ret.getStatus());
     return ret.getStatus().transactionError();
 }
 
@@ -107,6 +109,7 @@
         else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND;
         else return NO_INIT;
     }
+    ConversionHelperHidl::crashIfHalIsDead(ret.getStatus());
     return ret.getStatus().transactionError();
 }
 
@@ -130,6 +133,7 @@
         else if (retval == Result::INVALID_ARGUMENTS) return NAME_NOT_FOUND;
         else return NO_INIT;
     }
+    ConversionHelperHidl::crashIfHalIsDead(ret.getStatus());
     return ret.getStatus().transactionError();
 }
 
@@ -139,6 +143,7 @@
     hidlHandle->data[0] = fd;
     Return<void> ret = mEffectsFactory->debugDump(hidlHandle);
     native_handle_delete(hidlHandle);
+    ConversionHelperHidl::crashIfHalIsDead(ret.getStatus());
     return ret.getStatus().transactionError();
 }