Loading system/hci/src/hci_layer.cc +9 −4 Original line number Diff line number Diff line Loading @@ -224,10 +224,13 @@ static future_t* hci_module_shut_down() { LOG_INFO(LOG_TAG, "%s", __func__); // Free the timers { std::lock_guard<std::recursive_mutex> lock(commands_pending_response_mutex); alarm_free(command_response_timer); command_response_timer = NULL; alarm_free(startup_timer); startup_timer = NULL; } // Stop the thread to prevent Send() calls. if (thread) { Loading Loading @@ -533,6 +536,8 @@ static waiting_command_t* get_waiting_command(command_opcode_t opcode) { static void update_command_response_timer(void) { std::lock_guard<std::recursive_mutex> lock(commands_pending_response_mutex); if (command_response_timer == NULL) return; if (list_is_empty(commands_pending_response)) { alarm_cancel(command_response_timer); } else { Loading system/service/hal/bluetooth_interface.cc +2 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,8 @@ class BluetoothInterfaceImpl : public BluetoothInterface { const bt_interface_t* GetHALInterface() const override { return hal_iface_; } bt_callbacks_t* GetHALCallbacks() const override { return &bt_callbacks; } const bluetooth_device_t* GetHALAdapter() const override { return hal_adapter_; } Loading system/service/hal/bluetooth_interface.h +3 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ class BluetoothInterface { // us. The behavior is undefined if "init" is called directly by upper layers. virtual const bt_interface_t* GetHALInterface() const = 0; // Returns the HAL callbacks that have been initialized previously. virtual bt_callbacks_t* GetHALCallbacks() const = 0; // The HAL module pointer that represents the underlying Bluetooth adapter. // This is implemented in and provided by the shared Bluetooth library, so // this isn't owned by us. Loading system/service/hal/fake_bluetooth_interface.cc +4 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,10 @@ const bt_interface_t* FakeBluetoothInterface::GetHALInterface() const { return &fake_bt_iface; } bt_callbacks_t* FakeBluetoothInterface::GetHALCallbacks() const { return nullptr; } const bluetooth_device_t* FakeBluetoothInterface::GetHALAdapter() const { // TODO(armansito): Do something meaningful here to simulate test behavior. return nullptr; Loading system/service/hal/fake_bluetooth_interface.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class FakeBluetoothInterface : public BluetoothInterface { void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; const bt_interface_t* GetHALInterface() const override; bt_callbacks_t* GetHALCallbacks() const override; const bluetooth_device_t* GetHALAdapter() const override; private: Loading Loading
system/hci/src/hci_layer.cc +9 −4 Original line number Diff line number Diff line Loading @@ -224,10 +224,13 @@ static future_t* hci_module_shut_down() { LOG_INFO(LOG_TAG, "%s", __func__); // Free the timers { std::lock_guard<std::recursive_mutex> lock(commands_pending_response_mutex); alarm_free(command_response_timer); command_response_timer = NULL; alarm_free(startup_timer); startup_timer = NULL; } // Stop the thread to prevent Send() calls. if (thread) { Loading Loading @@ -533,6 +536,8 @@ static waiting_command_t* get_waiting_command(command_opcode_t opcode) { static void update_command_response_timer(void) { std::lock_guard<std::recursive_mutex> lock(commands_pending_response_mutex); if (command_response_timer == NULL) return; if (list_is_empty(commands_pending_response)) { alarm_cancel(command_response_timer); } else { Loading
system/service/hal/bluetooth_interface.cc +2 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,8 @@ class BluetoothInterfaceImpl : public BluetoothInterface { const bt_interface_t* GetHALInterface() const override { return hal_iface_; } bt_callbacks_t* GetHALCallbacks() const override { return &bt_callbacks; } const bluetooth_device_t* GetHALAdapter() const override { return hal_adapter_; } Loading
system/service/hal/bluetooth_interface.h +3 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,9 @@ class BluetoothInterface { // us. The behavior is undefined if "init" is called directly by upper layers. virtual const bt_interface_t* GetHALInterface() const = 0; // Returns the HAL callbacks that have been initialized previously. virtual bt_callbacks_t* GetHALCallbacks() const = 0; // The HAL module pointer that represents the underlying Bluetooth adapter. // This is implemented in and provided by the shared Bluetooth library, so // this isn't owned by us. Loading
system/service/hal/fake_bluetooth_interface.cc +4 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,10 @@ const bt_interface_t* FakeBluetoothInterface::GetHALInterface() const { return &fake_bt_iface; } bt_callbacks_t* FakeBluetoothInterface::GetHALCallbacks() const { return nullptr; } const bluetooth_device_t* FakeBluetoothInterface::GetHALAdapter() const { // TODO(armansito): Do something meaningful here to simulate test behavior. return nullptr; Loading
system/service/hal/fake_bluetooth_interface.h +1 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class FakeBluetoothInterface : public BluetoothInterface { void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; const bt_interface_t* GetHALInterface() const override; bt_callbacks_t* GetHALCallbacks() const override; const bluetooth_device_t* GetHALAdapter() const override; private: Loading