diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/rootcanal/hal/bluetooth_hci.cc | 18 | ||||
-rw-r--r-- | tools/rootcanal/hal/bluetooth_hci.h | 20 |
2 files changed, 20 insertions, 18 deletions
diff --git a/tools/rootcanal/hal/bluetooth_hci.cc b/tools/rootcanal/hal/bluetooth_hci.cc index b08d59995b..b36c18687d 100644 --- a/tools/rootcanal/hal/bluetooth_hci.cc +++ b/tools/rootcanal/hal/bluetooth_hci.cc @@ -53,24 +53,6 @@ bool BtTestConsoleEnabled() { } // namespace -class BluetoothDeathRecipient : public hidl_death_recipient { -public: - BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {} - - void serviceDied(uint64_t /* cookie */, - const wp<::android::hidl::base::V1_0::IBase>& /* who */) override { - ALOGE("BluetoothDeathRecipient::serviceDied - Bluetooth service died"); - has_died_ = true; - mHci->close(); - } - sp<IBluetoothHci> mHci; - bool getHasDied() const { return has_died_; } - void setHasDied(bool has_died) { has_died_ = has_died; } - -private: - bool has_died_{false}; -}; - BluetoothHci::BluetoothHci() : death_recipient_(new BluetoothDeathRecipient(this)) {} Return<void> BluetoothHci::initialize(const sp<V1_0::IBluetoothHciCallbacks>& cb) { diff --git a/tools/rootcanal/hal/bluetooth_hci.h b/tools/rootcanal/hal/bluetooth_hci.h index 95bda38957..95e3e45334 100644 --- a/tools/rootcanal/hal/bluetooth_hci.h +++ b/tools/rootcanal/hal/bluetooth_hci.h @@ -18,6 +18,7 @@ #include <android/hardware/bluetooth/1.1/IBluetoothHci.h> #include <hidl/MQDescriptor.h> +#include <log/log.h> #include "hci_packetizer.h" #include "model/controller/dual_mode_controller.h" @@ -44,6 +45,25 @@ using android::net::ConnectCallback; using rootcanal::Device; using rootcanal::Phy; +class BluetoothDeathRecipient : public hidl_death_recipient { +public: + BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {} + + void serviceDied(uint64_t /* cookie */, + const wp<::android::hidl::base::V1_0::IBase>& /* who */) override { + ALOGE("BluetoothDeathRecipient::serviceDied - Bluetooth service died"); + has_died_ = true; + mHci->close(); + } + + sp<IBluetoothHci> mHci; + bool getHasDied() const { return has_died_; } + void setHasDied(bool has_died) { has_died_ = has_died; } + +private: + bool has_died_{false}; +}; + class BluetoothHci : public IBluetoothHci { public: BluetoothHci(); |