Bluetooth: Do not die quietly on binder death
Log if the Bluetooth service has died.
Also check the return status for Bluetooth service binder callbacks to
avoid DEAD_OBJECT exception when com.android.bluetooth crashes.
Bug: 36026072
Test: unit tests; Bluetooth off/on/off; kill -6 com.android.bluetooth
Change-Id: Ia28e6777ee7b78f06db8d5214324e696441d00f7
diff --git a/bluetooth/1.0/default/bluetooth_hci.h b/bluetooth/1.0/default/bluetooth_hci.h
index 67d6c37..4f92231 100644
--- a/bluetooth/1.0/default/bluetooth_hci.h
+++ b/bluetooth/1.0/default/bluetooth_hci.h
@@ -30,16 +30,7 @@
using ::android::hardware::Return;
using ::android::hardware::hidl_vec;
-struct BluetoothDeathRecipient : hidl_death_recipient {
- BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {}
-
- virtual void serviceDied(
- uint64_t /*cookie*/,
- const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
- mHci->close();
- }
- sp<IBluetoothHci> mHci;
-};
+class BluetoothDeathRecipient;
class BluetoothHci : public IBluetoothHci {
public: