Loading system/service/adapter.cc +6 −5 Original line number Diff line number Diff line Loading @@ -330,9 +330,9 @@ class AdapterImpl : public Adapter, public hal::BluetoothInterface::Observer { } lock_guard<mutex> lock(observers_lock_); FOR_EACH_OBSERVER( Adapter::Observer, observers_, OnDeviceConnectionStateChanged(this, device_address, connected)); for (auto& observer : observers_) { observer.OnDeviceConnectionStateChanged(this, device_address, connected); } } // Sends a request to set the given HAL adapter property type and value. Loading Loading @@ -362,8 +362,9 @@ class AdapterImpl : public Adapter, public hal::BluetoothInterface::Observer { if (prev_state == new_state) return; lock_guard<mutex> lock(observers_lock_); FOR_EACH_OBSERVER(Adapter::Observer, observers_, OnAdapterStateChanged(this, prev_state, new_state)); for (auto& observer : observers_) { observer.OnAdapterStateChanged(this, prev_state, new_state); } } private: Loading system/service/daemon.cc +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <memory> #include <base/logging.h> #include <base/run_loop.h> #include "service/adapter.h" #include "service/hal/bluetooth_gatt_interface.h" Loading @@ -44,7 +45,7 @@ class DaemonImpl : public Daemon, public ipc::IPCManager::Delegate { CleanUpBluetoothStack(); } void StartMainLoop() override { message_loop_->Run(); } void StartMainLoop() override { base::RunLoop().Run(); } Settings* GetSettings() const override { return settings_.get(); } Loading system/service/example/heart_rate/server_main.cc +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) { // received in dedicated threads set up by the ProcessState::startThreadPool // call above but we use this main loop for sending out heart rate // notifications. main_loop.Run(); base::RunLoop().Run(); LOG(INFO) << "Exiting"; return EXIT_SUCCESS; Loading system/service/hal/bluetooth_gatt_interface.cc +3 −6 Original line number Diff line number Diff line Loading @@ -59,16 +59,13 @@ base::ObserverList<BluetoothGattInterface::ServerObserver>* GetServerObservers(); #define FOR_EACH_SCANNER_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ScannerObserver, \ *GetScannerObservers(), func) for (auto& observer : *GetScannerObservers()) { observer.func; } #define FOR_EACH_CLIENT_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ClientObserver, \ *GetClientObservers(), func) for (auto& observer : *GetClientObservers()) { observer.func; } #define FOR_EACH_SERVER_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ServerObserver, \ *GetServerObservers(), func) for (auto& observer : *GetServerObservers()) { observer.func; } #define VERIFY_INTERFACE_OR_RETURN() \ do { \ Loading system/service/hal/bluetooth_interface.cc +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ shared_mutex_impl g_instance_lock; base::ObserverList<BluetoothInterface::Observer>* GetObservers(); #define FOR_EACH_BLUETOOTH_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothInterface::Observer, *GetObservers(), func) for (auto& observer : *GetObservers()) { observer.func; } #define VERIFY_INTERFACE_OR_RETURN() \ do { \ Loading Loading
system/service/adapter.cc +6 −5 Original line number Diff line number Diff line Loading @@ -330,9 +330,9 @@ class AdapterImpl : public Adapter, public hal::BluetoothInterface::Observer { } lock_guard<mutex> lock(observers_lock_); FOR_EACH_OBSERVER( Adapter::Observer, observers_, OnDeviceConnectionStateChanged(this, device_address, connected)); for (auto& observer : observers_) { observer.OnDeviceConnectionStateChanged(this, device_address, connected); } } // Sends a request to set the given HAL adapter property type and value. Loading Loading @@ -362,8 +362,9 @@ class AdapterImpl : public Adapter, public hal::BluetoothInterface::Observer { if (prev_state == new_state) return; lock_guard<mutex> lock(observers_lock_); FOR_EACH_OBSERVER(Adapter::Observer, observers_, OnAdapterStateChanged(this, prev_state, new_state)); for (auto& observer : observers_) { observer.OnAdapterStateChanged(this, prev_state, new_state); } } private: Loading
system/service/daemon.cc +2 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <memory> #include <base/logging.h> #include <base/run_loop.h> #include "service/adapter.h" #include "service/hal/bluetooth_gatt_interface.h" Loading @@ -44,7 +45,7 @@ class DaemonImpl : public Daemon, public ipc::IPCManager::Delegate { CleanUpBluetoothStack(); } void StartMainLoop() override { message_loop_->Run(); } void StartMainLoop() override { base::RunLoop().Run(); } Settings* GetSettings() const override { return settings_.get(); } Loading
system/service/example/heart_rate/server_main.cc +1 −1 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) { // received in dedicated threads set up by the ProcessState::startThreadPool // call above but we use this main loop for sending out heart rate // notifications. main_loop.Run(); base::RunLoop().Run(); LOG(INFO) << "Exiting"; return EXIT_SUCCESS; Loading
system/service/hal/bluetooth_gatt_interface.cc +3 −6 Original line number Diff line number Diff line Loading @@ -59,16 +59,13 @@ base::ObserverList<BluetoothGattInterface::ServerObserver>* GetServerObservers(); #define FOR_EACH_SCANNER_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ScannerObserver, \ *GetScannerObservers(), func) for (auto& observer : *GetScannerObservers()) { observer.func; } #define FOR_EACH_CLIENT_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ClientObserver, \ *GetClientObservers(), func) for (auto& observer : *GetClientObservers()) { observer.func; } #define FOR_EACH_SERVER_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothGattInterface::ServerObserver, \ *GetServerObservers(), func) for (auto& observer : *GetServerObservers()) { observer.func; } #define VERIFY_INTERFACE_OR_RETURN() \ do { \ Loading
system/service/hal/bluetooth_interface.cc +1 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,7 @@ shared_mutex_impl g_instance_lock; base::ObserverList<BluetoothInterface::Observer>* GetObservers(); #define FOR_EACH_BLUETOOTH_OBSERVER(func) \ FOR_EACH_OBSERVER(BluetoothInterface::Observer, *GetObservers(), func) for (auto& observer : *GetObservers()) { observer.func; } #define VERIFY_INTERFACE_OR_RETURN() \ do { \ Loading