#include <stdlib.h>
#include <base/bind.h>
+#include <base/location.h>
#include <base/message_loop/message_loop.h>
-#include <base/tracked_objects.h>
#include <hardware/bluetooth.h>
#include "bt_types.h"
******************************************************************************/
extern bt_status_t do_in_jni_thread(base::OnceClosure task);
-extern bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
+extern bt_status_t do_in_jni_thread(const base::Location& from_here,
base::OnceClosure task);
extern bool is_on_jni_thread();
extern base::MessageLoop* get_jni_message_loop();
* thread
*/
template <typename R, typename... Args>
-base::Callback<R(Args...)> jni_thread_wrapper(
- const tracked_objects::Location& from_here, base::Callback<R(Args...)> cb) {
+base::Callback<R(Args...)> jni_thread_wrapper(const base::Location& from_here,
+ base::Callback<R(Args...)> cb) {
return base::Bind(
- [](const tracked_objects::Location& from_here,
- base::Callback<R(Args...)> cb, Args... args) {
+ [](const base::Location& from_here, base::Callback<R(Args...)> cb,
+ Args... args) {
do_in_jni_thread(from_here,
base::Bind(cb, std::forward<Args>(args)...));
},
* This function posts a task into the btif message loop, that executes it in
* the JNI message loop.
**/
-bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
+bt_status_t do_in_jni_thread(const base::Location& from_here,
base::OnceClosure task) {
if (!jni_thread.DoInThread(from_here, std::move(task))) {
LOG(ERROR) << __func__ << ": Post task to task runner failed!";
// template specialization
template <>
-base::Callback<void()> jni_thread_wrapper(
- const tracked_objects::Location& from_here, base::Callback<void()> cb) {
+base::Callback<void()> jni_thread_wrapper(const base::Location& from_here,
+ base::Callback<void()> cb) {
return base::Bind(
- [](const tracked_objects::Location& from_here,
- base::Callback<void()> cb) { do_in_jni_thread(from_here, cb); },
+ [](const base::Location& from_here, base::Callback<void()> cb) {
+ do_in_jni_thread(from_here, cb);
+ },
from_here, std::move(cb));
}
#include "btif_profile_queue.h"
#include <base/bind.h>
+#include <base/callback.h>
#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <string.h>
* limitations under the License.
*
******************************************************************************/
+#include "btif/include/btif_profile_queue.h"
+
#include <gtest/gtest.h>
#include <base/bind.h>
+#include <base/callback.h>
+#include <base/location.h>
-#include "base/location.h"
-#include "btif/include/btif_profile_queue.h"
#include "stack_manager.h"
#include "types/raw_address.h"
static stack_manager_t sStackManager = {nullptr, nullptr, nullptr, nullptr,
get_stack_is_running};
const stack_manager_t* stack_manager_get_interface() { return &sStackManager; }
-bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
+bt_status_t do_in_jni_thread(const base::Location& from_here,
base::OnceClosure task) {
std::move(task).Run();
return BT_STATUS_SUCCESS;
"base/trace_event/trace_event_synthetic_delay.cc",
"base/trace_event/trace_log.cc",
"base/trace_event/trace_log_constants.cc",
- "base/tracked_objects.cc",
+ "base/base.cc",
"base/tracking_info.cc",
"base/values.cc",
"base/vlog.cc",
* limitations under the License.
*/
+#include "message_loop_thread.h"
+
#include <sys/syscall.h>
#include <unistd.h>
#include <thread>
#include <base/strings/stringprintf.h>
-#include "message_loop_thread.h"
-
namespace bluetooth {
namespace common {
start_up_future.wait();
}
-bool MessageLoopThread::DoInThread(const tracked_objects::Location& from_here,
+bool MessageLoopThread::DoInThread(const base::Location& from_here,
base::OnceClosure task) {
return DoInThreadDelayed(from_here, std::move(task), base::TimeDelta());
}
-bool MessageLoopThread::DoInThreadDelayed(
- const tracked_objects::Location& from_here, base::OnceClosure task,
- const base::TimeDelta& delay) {
+bool MessageLoopThread::DoInThreadDelayed(const base::Location& from_here,
+ base::OnceClosure task,
+ const base::TimeDelta& delay) {
std::lock_guard<std::recursive_mutex> api_lock(api_mutex_);
if (message_loop_ == nullptr) {
LOG(ERROR) << __func__ << ": message loop is null for thread " << *this
#include <thread>
#include <base/bind.h>
+#include <base/location.h>
#include <base/message_loop/message_loop.h>
#include <base/run_loop.h>
#include <base/threading/platform_thread.h>
-#include <base/tracked_objects.h>
namespace bluetooth {
* @return true if task is successfully scheduled, false if task cannot be
* scheduled
*/
- bool DoInThread(const tracked_objects::Location& from_here,
- base::OnceClosure task);
+ bool DoInThread(const base::Location& from_here, base::OnceClosure task);
/**
* Shutdown the current thread as if it is never started. IsRunning() and
* @return true if task is successfully scheduled, false if task cannot be
* scheduled
*/
- bool DoInThreadDelayed(const tracked_objects::Location& from_here,
+ bool DoInThreadDelayed(const base::Location& from_here,
base::OnceClosure task, const base::TimeDelta& delay);
friend class Timer; // allow Timer to use DoInThreadDelayed()
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "message_loop_thread.h"
#include <condition_variable>
#include <memory>
#include <base/bind.h>
#include <base/threading/platform_thread.h>
-#include <base/tracked_objects.h>
#include <sys/capability.h>
#include <syscall.h>
-#include "message_loop_thread.h"
-
using bluetooth::common::MessageLoopThread;
/**
// This runs on user thread
bool Timer::Schedule(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here,
- base::Closure task, base::TimeDelta delay) {
+ const base::Location& from_here, base::Closure task,
+ base::TimeDelta delay) {
return ScheduleTaskHelper(thread, from_here, std::move(task), delay, false);
}
// This runs on user thread
bool Timer::SchedulePeriodic(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here,
+ const base::Location& from_here,
base::Closure task, base::TimeDelta period) {
if (period < kMinimumPeriod) {
LOG(ERROR) << __func__ << ": period must be at least " << kMinimumPeriod;
// This runs on user thread
bool Timer::ScheduleTaskHelper(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here,
+ const base::Location& from_here,
base::Closure task, base::TimeDelta delay,
bool is_periodic) {
uint64_t time_now_us = time_get_os_boottime_us();
#include <base/bind.h>
#include <base/cancelable_callback.h>
-#include <base/tracked_objects.h>
+#include <base/location.h>
#include <future>
namespace bluetooth {
* @return true iff task is scheduled successfully
*/
bool Schedule(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here, base::Closure task,
+ const base::Location& from_here, base::Closure task,
base::TimeDelta delay);
/**
* @return true iff task is scheduled successfully
*/
bool SchedulePeriodic(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here,
- base::Closure task, base::TimeDelta period);
+ const base::Location& from_here, base::Closure task,
+ base::TimeDelta period);
/**
* Post an event which cancels the current task asynchronously
uint64_t expected_time_next_task_us_; // Using clock boot time in time_util.h
mutable std::recursive_mutex api_mutex_;
bool ScheduleTaskHelper(const base::WeakPtr<MessageLoopThread>& thread,
- const tracked_objects::Location& from_here,
- base::Closure task, base::TimeDelta delay,
- bool is_periodic);
+ const base::Location& from_here, base::Closure task,
+ base::TimeDelta delay, bool is_periodic);
void CancelHelper(std::promise<void> promise);
void CancelClosure(std::promise<void> promise);
#pragma once
-#include <base/bind.h>
-#include <base/tracked_objects.h>
+#include <base/callback.h>
+#include <base/location.h>
#include <stdbool.h>
#include "bt_types.h"
typedef struct hci_t {
// Set the callback that the HCI layer uses to send data upwards
void (*set_data_cb)(
- base::Callback<void(const tracked_objects::Location&, BT_HDR*)>
- send_data_cb);
+ base::Callback<void(const base::Location&, BT_HDR*)> send_data_cb);
// Send a command through the HCI layer
void (*transmit_command)(BT_HDR* command,
const btsnoop_t* btsnoop_interface,
const packet_fragmenter_t* packet_fragmenter_interface);
-void post_to_main_message_loop(const tracked_objects::Location& from_here,
- BT_HDR* p_msg);
+void post_to_main_message_loop(const base::Location& from_here, BT_HDR* p_msg);
void hci_layer_cleanup_interface();
static alarm_t* hci_timeout_abort_timer;
// The hand-off point for data going to a higher layer, set by the higher layer
-static base::Callback<void(const tracked_objects::Location&, BT_HDR*)>
- send_data_upwards;
+static base::Callback<void(const base::Location&, BT_HDR*)> send_data_upwards;
static bool filter_incoming_event(BT_HDR* packet);
static waiting_command_t* get_waiting_command(command_opcode_t opcode);
hci_thread.DoInThread(FROM_HERE, base::Bind(&event_finish_startup, nullptr));
}
-void hci_event_received(const tracked_objects::Location& from_here,
- BT_HDR* packet) {
+void hci_event_received(const base::Location& from_here, BT_HDR* packet) {
btsnoop->capture(packet, true);
if (!filter_incoming_event(packet)) {
// Interface functions
static void set_data_cb(
- base::Callback<void(const tracked_objects::Location&, BT_HDR*)>
- send_data_cb) {
+ base::Callback<void(const base::Location&, BT_HDR*)> send_data_cb) {
send_data_upwards = std::move(send_data_cb);
}
using ::android::hardware::hidl_vec;
extern void initialization_complete();
-extern void hci_event_received(const tracked_objects::Location& from_here,
- BT_HDR* packet);
+extern void hci_event_received(const base::Location& from_here, BT_HDR* packet);
extern void acl_event_received(BT_HDR* packet);
extern void sco_data_received(BT_HDR* packet);
};
extern void initialization_complete();
-extern void hci_event_received(const tracked_objects::Location& from_here,
- BT_HDR* packet);
+extern void hci_event_received(const base::Location& from_here, BT_HDR* packet);
extern void acl_event_received(BT_HDR* packet);
extern void sco_data_received(BT_HDR* packet);
* Returns None
*
*****************************************************************************/
-void post_to_main_message_loop(const tracked_objects::Location& from_here,
- BT_HDR* p_msg) {
+void post_to_main_message_loop(const base::Location& from_here, BT_HDR* p_msg) {
if (do_in_main_thread(from_here, base::Bind(&btu_hci_msg_process, p_msg)) !=
BT_STATUS_SUCCESS) {
LOG(ERROR) << __func__ << ": do_in_main_thread failed from "
"libbluetooth-types",
"libosi",
],
+ shared_libs: [
+ "libchrome",
+ ],
}
cc_test {
"libbtdevice",
"avrcp-target-service",
],
+ shared_libs: [
+ "libchrome",
+ ],
sanitize: {
cfi: false,
},
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "device.h"
#include <base/message_loop/message_loop.h>
#include "connection_handler.h"
-#include "device.h"
-#include "stack_config.h"
-
#include "packet/avrcp/avrcp_reject_packet.h"
#include "packet/avrcp/general_reject_packet.h"
#include "packet/avrcp/get_play_status_packet.h"
#include "packet/avrcp/pass_through_packet.h"
#include "packet/avrcp/set_absolute_volume.h"
#include "packet/avrcp/set_addressed_player.h"
+#include "stack_config.h"
namespace bluetooth {
namespace avrcp {
],
shared_libs: [
+ "libchrome",
"libbinder",
"libcutils",
"liblog",
"libbluetooth-types",
"libutils",
],
+ shared_libs: [
+ "libchrome",
+ ],
+
host_supported: true,
target: {
// This includes Binder related tests that can only be run
std::string kServiceName = "bluetooth-service";
void QuitMessageLoop() {
- // I don't know why both of these calls are necessary but the message loop
- // doesn't stop unless I call both. Bug in base::MessageLoop?
base::RunLoop().Quit();
- base::MessageLoop::current()->QuitNow();
}
// Handles the case where the Bluetooth process dies.
}
LOG(ERROR) << "Starting Heart Rate server failed asynchronously";
- main_loop.QuitWhenIdle();
+ base::RunLoop().QuitWhenIdle();
};
bool advertise =
#include <unistd.h>
#include <base/bind.h>
+#include <base/bind_helpers.h>
+#include <base/callback.h>
#include <algorithm>
#include <array>
#include <condition_variable>
} // namespace
-void DoNothing(uint8_t p) {}
-
namespace bluetooth {
namespace gatt {
// Setup our advertisement. This has no callback.
g_internal->gatt->advertiser->SetData(0 /* std_inst */, false,
{/*TODO: put inverval 2,2 here*/},
- base::Bind(&DoNothing));
+ base::DoNothing());
g_internal->gatt->advertiser->Enable(
0 /* std_inst */, true, base::Bind(&EnableAdvertisingCallback),
- 0 /* no duration */, 0 /* no maxExtAdvEvent*/, base::Bind(&DoNothing));
+ 0 /* no duration */, 0 /* no maxExtAdvEvent*/, base::DoNothing());
}
void ServiceStoppedCallback(int status, int server_if, int srvc_handle) {
// Setup our advertisement. This has no callback.
internal_->gatt->advertiser->SetData(0, false, /* beacon, not scan response */
- {}, base::Bind(&DoNothing));
+ {}, base::DoNothing());
// transmit_name, /* name */
// 2, 2, interval
// mutable_manufacturer_data,
// Setup our advertisement. This has no callback.
internal_->gatt->advertiser->SetData(0, true, /* scan response */
- {}, base::Bind(&DoNothing));
+ {}, base::DoNothing());
// transmit_name, /* name */
// false, /* no txpower */
// 2, 2, interval
std::unique_lock<shared_mutex_impl> lock(g_instance_lock);
CHECK(!g_interface);
- auto impl = base::MakeUnique<BluetoothAvInterfaceImpl>();
+ auto impl = std::make_unique<BluetoothAvInterfaceImpl>();
if (!impl->Initialize()) {
LOG(ERROR) << "Failed to initialize BluetoothAvInterface";
return false;
#pragma once
#include <atomic>
-
#include <base/files/file_path.h>
#include <base/files/scoped_file.h>
#include <base/macros.h>
#include "service/low_energy_advertiser.h"
-#include <base/bind.h>
-#include <base/logging.h>
-
#include "service/adapter.h"
#include "service/logging_helpers.h"
#include "stack/include/bt_types.h"
#include "stack/include/hcidefs.h"
+#include <base/bind.h>
+#include <base/bind_helpers.h>
+#include <base/callback.h>
+#include <base/logging.h>
+
using std::lock_guard;
using std::mutex;
out_params->scan_request_notification_enable = 0;
}
-void DoNothing(uint8_t status) {}
-
} // namespace
// LowEnergyAdvertiser implementation
// Stop advertising and ignore the result.
hal::BluetoothGattInterface::Get()->GetAdvertiserHALInterface()->Enable(
- advertiser_id_, false, base::Bind(&DoNothing), 0, 0,
- base::Bind(&DoNothing));
+ advertiser_id_, false, base::DoNothing(), 0, 0, base::DoNothing());
hal::BluetoothGattInterface::Get()->GetAdvertiserHALInterface()->Unregister(
advertiser_id_);
}
#include "service/low_energy_scanner.h"
-#include <base/bind.h>
-#include <base/logging.h>
-
#include "service/adapter.h"
#include "service/logging_helpers.h"
#include "stack/include/bt_types.h"
#include "stack/include/hcidefs.h"
+#include <base/bind.h>
+#include <base/callback.h>
+#include <base/logging.h>
+
using std::lock_guard;
using std::mutex;
******************************************************************************/
#include "ble_advertiser_hci_interface.h"
-#include <base/callback.h>
-#include <base/location.h>
-#include <base/logging.h>
-#include <queue>
-#include <utility>
#include "btm_api.h"
#include "btm_ble_api.h"
#include "btm_int_types.h"
#include "device/include/controller.h"
#include "hcidefs.h"
+#include <queue>
+#include <utility>
+
+#include <base/bind.h>
+#include <base/callback.h>
+#include <base/location.h>
+#include <base/logging.h>
+
#define BTM_BLE_MULTI_ADV_SET_RANDOM_ADDR_LEN 8
#define BTM_BLE_MULTI_ADV_ENB_LEN 3
#define BTM_BLE_MULTI_ADV_SET_PARAM_LEN 24
using hci_cmd_cb = base::Callback<void(uint8_t* /* return_parameters */,
uint16_t /* return_parameters_length*/)>;
-extern void btu_hcif_send_cmd_with_cb(
- const tracked_objects::Location& posted_from, uint16_t opcode,
- uint8_t* params, uint8_t params_len, hci_cmd_cb cb);
+extern void btu_hcif_send_cmd_with_cb(const base::Location& posted_from,
+ uint16_t opcode, uint8_t* params,
+ uint8_t params_len, hci_cmd_cb cb);
namespace {
BleAdvertiserHciInterface* instance = nullptr;
}
class BleAdvertiserVscHciInterfaceImpl : public BleAdvertiserHciInterface {
- void SendAdvCmd(const tracked_objects::Location& posted_from,
- uint8_t param_len, uint8_t* param_buf,
- status_cb command_complete) {
+ void SendAdvCmd(const base::Location& posted_from, uint8_t param_len,
+ uint8_t* param_buf, status_cb command_complete) {
btu_hcif_send_cmd_with_cb(posted_from, HCI_BLE_MULTI_ADV_OCF, param_buf,
param_len,
base::Bind(&btm_ble_multi_adv_vsc_cmpl_cback,
}
class BleAdvertiserLegacyHciInterfaceImpl : public BleAdvertiserHciInterface {
- void SendAdvCmd(const tracked_objects::Location& posted_from, uint16_t opcode,
+ void SendAdvCmd(const base::Location& posted_from, uint16_t opcode,
uint8_t* param_buf, uint8_t param_buf_len,
status_cb command_complete) {
btu_hcif_send_cmd_with_cb(
};
class BleAdvertiserHciExtendedImpl : public BleAdvertiserHciInterface {
- void SendAdvCmd(const tracked_objects::Location& posted_from, uint16_t opcode,
+ void SendAdvCmd(const base::Location& posted_from, uint16_t opcode,
uint8_t* param_buf, uint8_t param_buf_len,
status_cb command_complete) {
btu_hcif_send_cmd_with_cb(
#ifndef BLE_ADVERTISER_HCI_INTERFACE_H
#define BLE_ADVERTISER_HCI_INTERFACE_H
-#include <base/bind.h>
#include <vector>
#include "stack/include/bt_types.h"
+#include <base/callback.h>
+
/* This class is an abstraction of HCI commands used for managing
* advertisements. Please see VSC HCI SPEC at
* https://static.googleusercontent.com/media/source.android.com/en//devices/Android-6.0-Bluetooth-HCI-Reqs.pdf
#define LOG_TAG "bt_btm_ble"
-#include <base/bind.h>
-#include <string.h>
-#include <algorithm>
-#include <vector>
-
#include "bt_target.h"
#include "bt_types.h"
#include "hcidefs.h"
#include "hcimsgs.h"
+#include <string.h>
+#include <algorithm>
+#include <vector>
+
+#include <base/bind.h>
+#include <base/bind_helpers.h>
+
using base::Bind;
using bluetooth::Uuid;
memset(&btm_ble_adv_filt_cb.cur_filter_target, 0, sizeof(tBLE_BD_ADDR));
}
-void DoNothing(uint8_t a, uint8_t b, uint8_t c) {}
-
void BTM_LE_PF_set(tBTM_BLE_PF_FILT_INDEX filt_index,
std::vector<ApcfCommand> commands,
tBTM_BLE_PF_CFG_CBACK cb) {
target_addr.bda = cmd.address;
target_addr.type = cmd.addr_type;
- BTM_LE_PF_addr_filter(action, filt_index, target_addr, Bind(DoNothing));
+ BTM_LE_PF_addr_filter(action, filt_index, target_addr,
+ base::DoNothing());
break;
}
case BTM_BLE_PF_SRVC_SOL_UUID: {
BTM_LE_PF_uuid_filter(action, filt_index, cmd.type, cmd.uuid,
BTM_BLE_PF_LOGIC_AND, cmd.uuid_mask,
- Bind(DoNothing));
+ base::DoNothing());
break;
}
case BTM_BLE_PF_LOCAL_NAME: {
- BTM_LE_PF_local_name(action, filt_index, cmd.name, Bind(DoNothing));
+ BTM_LE_PF_local_name(action, filt_index, cmd.name, base::DoNothing());
break;
}
case BTM_BLE_PF_MANU_DATA: {
BTM_LE_PF_manu_data(action, filt_index, cmd.company, cmd.company_mask,
- cmd.data, cmd.data_mask, Bind(DoNothing));
+ cmd.data, cmd.data_mask, base::DoNothing());
break;
}
case BTM_BLE_PF_SRVC_DATA_PATTERN: {
BTM_LE_PF_srvc_data_pattern(action, filt_index, cmd.data, cmd.data_mask,
- Bind(DoNothing));
+ base::DoNothing());
break;
}
*
******************************************************************************/
-#include <base/bind.h>
-#include <base/location.h>
-#include <base/logging.h>
-#include <base/memory/weak_ptr.h>
-#include <base/strings/string_number_conversions.h>
-#include <base/time/time.h>
-#include <string.h>
-#include <queue>
-#include <vector>
-
#include "bt_target.h"
#include "device/include/controller.h"
#include "osi/include/alarm.h"
#include "ble_advertiser_hci_interface.h"
#include "btm_int_types.h"
+#include <string.h>
+#include <queue>
+#include <vector>
+
+#include <base/bind.h>
+#include <base/bind_helpers.h>
+#include <base/location.h>
+#include <base/logging.h>
+#include <base/memory/weak_ptr.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/time/time.h>
+
using base::Bind;
using base::TimeDelta;
using base::TimeTicks;
void btm_ble_adv_raddr_timer_timeout(void* data);
-void DoNothing(uint8_t) {}
-void DoNothing2(uint8_t, uint8_t) {}
-
struct closure_data {
base::Closure user_task;
- tracked_objects::Location posted_from;
+ base::Location posted_from;
};
static void alarm_closure_cb(void* p) {
}
// Periodic alarms are not supported, because we clean up data in callback
-void alarm_set_closure(const tracked_objects::Location& posted_from,
- alarm_t* alarm, uint64_t interval_ms,
- base::Closure user_task) {
+void alarm_set_closure(const base::Location& posted_from, alarm_t* alarm,
+ uint64_t interval_ms, base::Closure user_task) {
closure_data* data = new closure_data;
data->posted_from = posted_from;
data->user_task = std::move(user_task);
if (restart) {
p_inst->enable_status = false;
hci_interface->Enable(false, p_inst->inst_id, 0x00, 0x00,
- Bind(DoNothing));
+ base::DoNothing());
}
/* set it to controller */
if (restart) {
p_inst->enable_status = true;
hci_interface->Enable(true, p_inst->inst_id, 0x00, 0x00,
- Bind(DoNothing));
+ base::DoNothing());
}
},
p_inst, std::move(configuredCb)));
base::Closure cb = Bind(
&BleAdvertisingManagerImpl::Enable, weak_factory_.GetWeakPtr(), inst_id,
- 0 /* disable */, std::move(timeout_cb), 0, 0, base::Bind(DoNothing));
+ 0 /* disable */, std::move(timeout_cb), 0, 0, base::DoNothing());
// schedule disable when the timeout passes
alarm_set_closure(FROM_HERE, p_inst->timeout_timer, duration * 10,
// TODO: disable only if was enabled, currently no use scenario needs
// that,
// we always set parameters before enabling
- // GetHciInterface()->Enable(false, inst_id, Bind(DoNothing));
+ // GetHciInterface()->Enable(false, inst_id, base::DoNothing());
p_inst->advertising_event_properties =
p_params->advertising_event_properties;
p_inst->tx_power = p_params->tx_power;
if (adv_inst[inst_id].IsEnabled()) {
p_inst->enable_status = false;
- GetHciInterface()->Enable(false, inst_id, 0x00, 0x00, Bind(DoNothing));
+ GetHciInterface()->Enable(false, inst_id, 0x00, 0x00, base::DoNothing());
}
if (p_inst->periodic_enabled) {
p_inst->periodic_enabled = false;
GetHciInterface()->SetPeriodicAdvertisingEnable(false, inst_id,
- Bind(DoNothing));
+ base::DoNothing());
}
alarm_cancel(p_inst->adv_raddr_timer);
p_inst->in_use = false;
- GetHciInterface()->RemoveAdvertisingSet(inst_id, Bind(DoNothing));
+ GetHciInterface()->RemoveAdvertisingSet(inst_id, base::DoNothing());
p_inst->address_update_required = false;
}
sets.emplace_back(SetEnableData{.handle = inst.inst_id});
}
- if (!sets.empty()) GetHciInterface()->Enable(false, sets, Bind(DoNothing));
+ if (!sets.empty())
+ GetHciInterface()->Enable(false, sets, base::DoNothing());
}
void Resume() override {
}
}
- if (!sets.empty()) GetHciInterface()->Enable(true, sets, Bind(DoNothing));
+ if (!sets.empty()) GetHciInterface()->Enable(true, sets, base::DoNothing());
}
void OnAdvertisingSetTerminated(
RecomputeTimeout(p_inst, TimeTicks::Now());
if (p_inst->enable_status) {
GetHciInterface()->Enable(true, advertising_handle, p_inst->duration,
- p_inst->maxExtAdvEvents, Bind(DoNothing));
+ p_inst->maxExtAdvEvents, base::DoNothing());
}
} else {
void btm_ble_adv_raddr_timer_timeout(void* data) {
BleAdvertisingManagerImpl* ptr = instance_weakptr.get();
- if (ptr) ptr->ConfigureRpa((AdvertisingInstance*)data, base::Bind(DoNothing));
+ if (ptr) ptr->ConfigureRpa((AdvertisingInstance*)data, base::DoNothing());
}
} // namespace
if (BleAdvertiserHciInterface::Get()->QuirkAdvertiserZeroHandle()) {
// If handle 0 can't be used, register advertiser for it, but never use it.
- BleAdvertisingManager::Get().get()->RegisterAdvertiser(Bind(DoNothing2));
+ BleAdvertisingManager::Get().get()->RegisterAdvertiser(base::DoNothing());
}
}
#include "osi/include/log.h"
#include "osi/include/osi.h"
-using tracked_objects::Location;
+using base::Location;
extern void btm_process_cancel_complete(uint8_t status, uint8_t mode);
extern void btm_ble_test_command_complete(uint8_t* p);
/* This function is called to send commands to the Host Controller. |cb| is
* called when command status event is called with error code, or when the
* command complete event is received. */
-void btu_hcif_send_cmd_with_cb(const tracked_objects::Location& posted_from,
- uint16_t opcode, uint8_t* params,
- uint8_t params_len, hci_cmd_cb cb) {
+void btu_hcif_send_cmd_with_cb(const Location& posted_from, uint16_t opcode,
+ uint8_t* params, uint8_t params_len,
+ hci_cmd_cb cb) {
BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
uint8_t* pp = (uint8_t*)(p + 1);
#include <stdlib.h>
#include <string.h>
-#include <base/bind.h>
-#include <base/logging.h>
-#include <base/run_loop.h>
-#include <base/threading/thread.h>
-
#include "bta/sys/bta_sys.h"
#include "btcore/include/module.h"
#include "bte.h"
#include "stack/include/btu.h"
#include "stack/l2cap/l2c_int.h"
+#include <base/bind.h>
+#include <base/logging.h>
+#include <base/run_loop.h>
+#include <base/threading/thread.h>
+
using bluetooth::common::MessageLoopThread;
/* Define BTU storage area */
return main_thread.message_loop();
}
-bt_status_t do_in_main_thread(const tracked_objects::Location& from_here,
+bt_status_t do_in_main_thread(const base::Location& from_here,
base::OnceClosure task) {
if (!main_thread.DoInThread(from_here, std::move(task))) {
LOG(ERROR) << __func__ << ": failed from " << from_here.ToString();
#ifndef AVRC_API_H
#define AVRC_API_H
-#include <base/bind.h>
-
#include "avct_api.h"
#include "avrc_defs.h"
#include "bt_target.h"
#include "sdp_api.h"
+#include <base/callback.h>
+
/*****************************************************************************
* constants
****************************************************************************/
#ifndef BTU_H
#define BTU_H
-#include <base/callback.h>
-#include <base/location.h>
-#include <base/threading/thread.h>
#include "bt_common.h"
#include "bt_target.h"
#include "common/message_loop_thread.h"
#include "osi/include/alarm.h"
+#include <base/callback.h>
+#include <base/location.h>
+#include <base/threading/thread.h>
+
/* Global BTU data */
extern uint8_t btu_trace_level;
*/
void btu_hcif_process_event(uint8_t controller_id, BT_HDR* p_buf);
void btu_hcif_send_cmd(uint8_t controller_id, BT_HDR* p_msg);
-void btu_hcif_send_cmd_with_cb(const tracked_objects::Location& posted_from,
+void btu_hcif_send_cmd_with_cb(const base::Location& posted_from,
uint16_t opcode, uint8_t* params,
uint8_t params_len,
base::Callback<void(uint8_t*, uint16_t)> cb);
***********************************
*/
base::MessageLoop* get_main_message_loop();
-bt_status_t do_in_main_thread(const tracked_objects::Location& from_here,
+bt_status_t do_in_main_thread(const base::Location& from_here,
base::OnceClosure task);
void BTU_StartUp(void);
/* Below are methods and variables that must be implemented if we don't want to
* compile the whole stack. They will be removed, or changed into mocks one by
* one in the future, as the refactoring progresses */
-bt_status_t do_in_jni_thread(const tracked_objects::Location& from_here,
+bt_status_t do_in_jni_thread(const base::Location& from_here,
base::OnceClosure task) {
helper.notify();
return BT_STATUS_SUCCESS;
namespace {
// Functions used by JSONValueConverter to read stringified JSON.
-bool ParseUint8t(const base::StringPiece& value, uint8_t* field) {
+bool ParseUint8t(base::StringPiece value, uint8_t* field) {
*field = std::stoi(value.as_string());
return true;
}
-bool ParseUint16t(const base::StringPiece& value, uint16_t* field) {
+bool ParseUint16t(base::StringPiece value, uint16_t* field) {
*field = std::stoi(value.as_string());
return true;
}