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

Commit 3fc73871 authored by Hidehiko Abe's avatar Hidehiko Abe Committed by Jakub Pawlowski
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.

Test: Build.
Change-Id: I4c904a9e8b76f1ee72e14d62740cb0d88963b270
Merged-In: I0cc2cf8521caf5f6f69346bb3ce3dc1c59b95cc6
parent 560d6913
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <base/bind.h>

#include "base/location.h"
#include "btif/include/btif_profile_queue.h"
#include "stack_manager.h"
#include "types/raw_address.h"
+2 −1
Original line number Diff line number Diff line
@@ -651,7 +651,8 @@ static void callback_dispatch(UNUSED_ATTR void* context) {
      }

      alarm->closure.i.Reset(Bind(alarm_ready_mloop, alarm));
      get_message_loop()->PostTask(FROM_HERE, alarm->closure.i.callback());
      get_message_loop()->task_runner()->PostTask(FROM_HERE,
                                                  alarm->closure.i.callback());
    } else {
      fixed_queue_enqueue(alarm->queue, alarm);
    }
+2 −1
Original line number Diff line number Diff line
@@ -347,7 +347,8 @@ TEST_F(AlarmTest, test_callback_ordering_on_mloop) {

  for (int i = 0; i < 100; i++) alarm_free(alarms[i]);

  message_loop_->PostTask(FROM_HERE, run_loop_->QuitWhenIdleClosure());
  message_loop_->task_runner()->PostTask(FROM_HERE,
                                         run_loop_->QuitWhenIdleClosure());
  thread_free(message_loop_thread_);
  EXPECT_FALSE(WakeLockHeld());
}
+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(); }

Loading