Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 371b8d3d authored by Jay Civelli's avatar Jay Civelli
Browse files

bt: Update libchrome APIS to r456626.

The new libchrome has been ported from Chromium and some APIs
have changed. Make necessary changes at call sites.

Change-Id: If5ea3659905f485fd0513c75e9d4f7c99b390c16
parent 812bbc86
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -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.
@@ -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:
+2 −1
Original line number Diff line number Diff line
@@ -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"
@@ -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(); }

+1 −1
Original line number Diff line number Diff line
@@ -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;
+3 −6
Original line number Diff line number Diff line
@@ -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 {                                                                 \
+1 −1
Original line number Diff line number Diff line
@@ -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