diff options
author | 2025-01-17 10:04:56 -0800 | |
---|---|---|
committer | 2025-01-17 10:04:56 -0800 | |
commit | a0004a5dd1a9e6ae8263a8bff995b82f8815c59c (patch) | |
tree | 4563893d904695fb0eb30ab2d13187ab60b8603d /tools/rootcanal | |
parent | 73b665b1660e8fd8ac685538a84a069bef54dfcc (diff) | |
parent | 4702097b062e8cd87074800a54363916a37c1ffd (diff) |
Merge "Resolve compilation error in android.hardware.bluetooth@1.1-service.sim" into main
Diffstat (limited to 'tools/rootcanal')
-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(); |