LE Audio Software offload: Handle death of client

Bug: 375485876
Flag: EXEMPT, enabled by vendor
Test: mmm .
Change-Id: I754eb1f8399c3a460ad07afcdd4c19432443a9c8
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index bcdb67e..f6d992d 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -97,6 +97,10 @@
         std::vector<uint8_t>(data, data + len));
   }
 
+  static void ClientDied(void* instance) {
+    static_cast<Hal*>(instance)->ClientDied();
+  }
+
  private:
   int getFdFromDevPath() {
     int fd = open(mDevPath.c_str(), O_RDWR);
@@ -322,6 +326,11 @@
     return true;
   }
 
+  void ClientDied() {
+    ALOGE("Bluetooth client has died");
+    Close();
+  }
+
   std::unique_ptr<struct hal_callbacks> mCallbacks;
   std::string mDevPath;
   int mFd{-1};
@@ -354,6 +363,7 @@
       .send_acl = &Hal::SendAcl,
       .send_sco = &Hal::SendSco,
       .send_iso = &Hal::SendIso,
+      .client_died = &Hal::ClientDied,
   };
 }
 }