summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Henri Chataing <henrichataing@google.com> 2024-04-05 16:35:44 +0000
committer Henri Chataing <henrichataing@google.com> 2024-04-05 21:26:39 +0000
commitb83d9d6ca2110659c3eb5264c72e615a26e879af (patch)
tree1a3526b6829f77930d9a7ec42fe75b842ce1aba6
parentf74910d43791b629218df9fab93503774f0d00de (diff)
Remove includes of <base/logging.h>
Convert remaining DLOG, LOG, CHECK_xx occurences in the same pass Test: m com.android.btservices Bug: 305066880 Flag: EXEMPT, mechanical refactor Change-Id: I7ae3e14c84b6ee5dc2ac0babc652c699c7424418
-rw-r--r--android/app/jni/com_android_bluetooth_le_audio.cpp2
-rw-r--r--system/audio/asrc/asrc_resampler.cc14
-rw-r--r--system/audio_hal_interface/aidl/audio_aidl_interfaces.h2
-rw-r--r--system/audio_hal_interface/hal_version_manager.cc1
-rw-r--r--system/audio_hal_interface/hidl/client_interface_hidl.cc1
-rw-r--r--system/bta/ag/bta_ag_act.cc1
-rw-r--r--system/bta/ag/bta_ag_cmd.cc1
-rw-r--r--system/bta/ag/bta_ag_main.cc1
-rw-r--r--system/bta/ag/bta_ag_rfc.cc34
-rw-r--r--system/bta/ag/bta_ag_sco.cc1
-rw-r--r--system/bta/ag/bta_ag_sdp.cc1
-rw-r--r--system/bta/av/bta_av_aact.cc3
-rw-r--r--system/bta/csis/csis_client.cc1
-rw-r--r--system/bta/csis/csis_client_test.cc2
-rw-r--r--system/bta/csis/csis_types.h2
-rw-r--r--system/bta/dm/bta_dm_act.cc1
-rw-r--r--system/bta/dm/bta_dm_disc.cc1
-rw-r--r--system/bta/gatt/bta_gattc_act.cc1
-rw-r--r--system/bta/gatt/bta_gattc_api.cc1
-rw-r--r--system/bta/gatt/bta_gattc_cache.cc1
-rw-r--r--system/bta/gatt/bta_gattc_db_storage.cc1
-rw-r--r--system/bta/gatt/bta_gattc_main.cc1
-rw-r--r--system/bta/gatt/bta_gattc_queue.cc1
-rw-r--r--system/bta/gatt/bta_gattc_utils.cc1
-rw-r--r--system/bta/gatt/bta_gatts_act.cc1
-rw-r--r--system/bta/gatt/bta_gatts_api.cc1
-rw-r--r--system/bta/gatt/bta_gatts_main.cc1
-rw-r--r--system/bta/gatt/bta_gatts_utils.cc1
-rw-r--r--system/bta/gatt/database.cc1
-rw-r--r--system/bta/gatt/database_builder.cc1
-rw-r--r--system/bta/groups/groups.cc1
-rw-r--r--system/bta/groups/groups_test.cc3
-rw-r--r--system/bta/has/has_client.cc93
-rw-r--r--system/bta/has/has_client_test.cc2
-rw-r--r--system/bta/has/has_ctp.h3
-rw-r--r--system/bta/has/has_preset.h7
-rw-r--r--system/bta/has/has_types.h2
-rw-r--r--system/bta/hearing_aid/hearing_aid.cc1
-rw-r--r--system/bta/hearing_aid/hearing_aid_audio_source.cc1
-rw-r--r--system/bta/hf_client/bta_hf_client_main.cc1
-rw-r--r--system/bta/hf_client/bta_hf_client_rfc.cc1
-rw-r--r--system/bta/jv/bta_jv_act.cc1
-rw-r--r--system/bta/jv/bta_jv_api.cc1
-rw-r--r--system/bta/le_audio/audio_hal_client/audio_source_hal_client.cc1
-rw-r--r--system/bta/le_audio/broadcaster/broadcaster.cc1
-rw-r--r--system/bta/le_audio/broadcaster/broadcaster_types.h1
-rw-r--r--system/bta/le_audio/client.cc43
-rw-r--r--system/bta/le_audio/client_parser.cc1
-rw-r--r--system/bta/le_audio/codec_interface.cc1
-rw-r--r--system/bta/le_audio/content_control_id_keeper.cc1
-rw-r--r--system/bta/le_audio/device_groups.cc3
-rw-r--r--system/bta/le_audio/devices.cc2
-rw-r--r--system/bta/le_audio/devices.h2
-rw-r--r--system/bta/le_audio/devices_test.cc2
-rw-r--r--system/bta/le_audio/le_audio_client_test.cc2
-rw-r--r--system/bta/le_audio/le_audio_health_status_test.cc5
-rw-r--r--system/bta/le_audio/le_audio_log_history.cc1
-rw-r--r--system/bta/le_audio/le_audio_set_configuration_provider_json.cc1
-rw-r--r--system/bta/le_audio/le_audio_types.cc1
-rw-r--r--system/bta/le_audio/metrics_collector.cc1
-rw-r--r--system/bta/le_audio/mock_state_machine.cc2
-rw-r--r--system/bta/le_audio/state_machine.cc8
-rw-r--r--system/bta/le_audio/state_machine_test.cc22
-rw-r--r--system/bta/le_audio/storage_helper_test.cc4
-rw-r--r--system/bta/sys/bta_sys_main.cc1
-rw-r--r--system/bta/test/bta_hf_client_add_record_test.cc1
-rw-r--r--system/bta/test/common/mock_csis_client.cc2
-rw-r--r--system/bta/test/common/mock_device_groups.cc2
-rw-r--r--system/bta/test/gatt/database_builder_sample_device_test.cc1
-rw-r--r--system/bta/test/gatt/database_builder_test.cc1
-rw-r--r--system/bta/test/gatt/database_test.cc1
-rw-r--r--system/bta/vc/device.cc1
-rw-r--r--system/bta/vc/devices_test.cc2
-rw-r--r--system/bta/vc/vc.cc1
-rw-r--r--system/bta/vc/vc_test.cc2
-rw-r--r--system/btcore/src/device_class.cc1
-rw-r--r--system/btcore/src/hal_util.cc1
-rw-r--r--system/btcore/src/module.cc1
-rw-r--r--system/btcore/src/property.cc1
-rw-r--r--system/btif/avrcp/avrcp_service.cc1
-rw-r--r--system/btif/co/bta_hh_co.cc1
-rw-r--r--system/btif/co/bta_pan_co.cc1
-rw-r--r--system/btif/src/bluetooth.cc1
-rw-r--r--system/btif/src/btif_a2dp.cc1
-rw-r--r--system/btif/src/btif_a2dp_control.cc1
-rw-r--r--system/btif/src/btif_a2dp_sink.cc1
-rw-r--r--system/btif/src/btif_a2dp_source.cc1
-rw-r--r--system/btif/src/btif_avrcp_audio_track.cc1
-rw-r--r--system/btif/src/btif_bqr.cc1
-rw-r--r--system/btif/src/btif_config.cc1
-rw-r--r--system/btif/src/btif_core.cc1
-rw-r--r--system/btif/src/btif_csis_client.cc1
-rw-r--r--system/btif/src/btif_dm.cc1
-rw-r--r--system/btif/src/btif_gatt_client.cc1
-rw-r--r--system/btif/src/btif_has_client.cc1
-rw-r--r--system/btif/src/btif_hearing_aid.cc1
-rw-r--r--system/btif/src/btif_hf.cc14
-rw-r--r--system/btif/src/btif_hf_client.cc1
-rw-r--r--system/btif/src/btif_hh.cc1
-rw-r--r--system/btif/src/btif_jni_task.cc1
-rw-r--r--system/btif/src/btif_keystore.cc1
-rw-r--r--system/btif/src/btif_le_audio.cc9
-rw-r--r--system/btif/src/btif_le_audio_broadcaster.cc1
-rw-r--r--system/btif/src/btif_profile_queue.cc1
-rw-r--r--system/btif/src/btif_profile_storage.cc1
-rw-r--r--system/btif/src/btif_rc.cc1
-rw-r--r--system/btif/src/btif_sock.cc1
-rw-r--r--system/btif/src/btif_sock_l2cap.cc1
-rw-r--r--system/btif/src/btif_storage.cc1
-rw-r--r--system/btif/src/btif_util.cc1
-rw-r--r--system/btif/src/btif_vc.cc1
-rw-r--r--system/btif/test/btif_hf_client_service_test.cc1
-rw-r--r--system/btif/test/btif_keystore_test.cc1
-rw-r--r--system/common/address_obfuscator.cc6
-rw-r--r--system/common/benchmark/thread_performance_benchmark.cc10
-rw-r--r--system/common/leaky_bonded_queue_unittest.cc1
-rw-r--r--system/common/lru.h1
-rw-r--r--system/common/lru_unittest.cc1
-rw-r--r--system/common/message_loop_thread.cc7
-rw-r--r--system/common/metric_id_allocator.cc1
-rw-r--r--system/common/metric_id_allocator_unittest.cc1
-rw-r--r--system/common/metrics.cc1
-rw-r--r--system/common/metrics_linux.cc1
-rw-r--r--system/common/metrics_unittest.cc13
-rw-r--r--system/common/repeating_timer.cc7
-rw-r--r--system/common/repeating_timer_unittest.cc5
-rw-r--r--system/common/state_machine.h1
-rw-r--r--system/common/stop_watch_legacy.cc1
-rw-r--r--system/common/test/thread_performance_test.cc1
-rw-r--r--system/device/src/device_iot_config.cc1
-rw-r--r--system/device/src/device_iot_config_int.cc1
-rw-r--r--system/device/src/interop.cc1
-rw-r--r--system/gd/hal/hci_hal_android_hidl.cc2
-rw-r--r--system/gd/hal/snoop_logger_socket.cc1
-rw-r--r--system/gd/hal/snoop_logger_socket_thread.cc1
-rw-r--r--system/gd/security/pairing_handler_le_legacy.cc1
-rw-r--r--system/gd/security/pairing_handler_le_secure_connections.cc1
-rw-r--r--system/hci/src/buffer_allocator.cc1
-rw-r--r--system/hci/src/packet_fragmenter.cc1
-rw-r--r--system/include/check.h4
-rw-r--r--system/include/notreached.h2
-rw-r--r--system/main/shim/btm.cc1
-rw-r--r--system/main/shim/btm_api.cc1
-rw-r--r--system/main/shim/le_advertising_manager.cc1
-rw-r--r--system/main/shim/le_scanning_manager.cc1
-rw-r--r--system/main/stack_config.cc1
-rw-r--r--system/osi/include/stack_power_telemetry.h2
-rw-r--r--system/osi/src/alarm.cc1
-rw-r--r--system/osi/src/allocator.cc1
-rw-r--r--system/osi/src/config.cc1
-rw-r--r--system/osi/src/fixed_queue.cc1
-rw-r--r--system/osi/src/future.cc1
-rw-r--r--system/osi/src/internal/semaphore.cc1
-rw-r--r--system/osi/src/list.cc1
-rw-r--r--system/osi/src/osi.cc1
-rw-r--r--system/osi/src/reactor.cc1
-rw-r--r--system/osi/src/ringbuffer.cc1
-rw-r--r--system/osi/src/socket.cc1
-rw-r--r--system/osi/src/stack_power_telemetry.cc1
-rw-r--r--system/osi/src/thread.cc1
-rw-r--r--system/packet/Android.bp1
-rw-r--r--system/packet/avrcp/avrcp_browse_packet.cc2
-rw-r--r--system/packet/avrcp/avrcp_browse_packet.h1
-rw-r--r--system/packet/avrcp/avrcp_packet.cc1
-rw-r--r--system/packet/avrcp/avrcp_packet.h1
-rw-r--r--system/packet/avrcp/capabilities_packet.cc17
-rw-r--r--system/packet/avrcp/get_element_attributes_packet.cc9
-rw-r--r--system/packet/avrcp/register_notification_packet.cc1
-rw-r--r--system/packet/avrcp/vendor_packet.cc10
-rw-r--r--system/packet/base/Android.bp7
-rw-r--r--system/packet/base/iterator.cc13
-rw-r--r--system/packet/base/packet.cc11
-rw-r--r--system/packet/base/packet_builder.cc7
-rw-r--r--system/packet/tests/avrcp/change_path_packet_test.cc1
-rw-r--r--system/packet/tests/fuzzers/change_path_req_fuzzer.cc1
-rw-r--r--system/packet/tests/fuzzers/change_path_res_fuzzer.cc1
-rw-r--r--system/stack/a2dp/a2dp_aac_decoder_linux.cc2
-rw-r--r--system/stack/a2dp/a2dp_ext.cc1
-rw-r--r--system/stack/a2dp/a2dp_vendor_aptx_hd.cc1
-rw-r--r--system/stack/a2dp/a2dp_vendor_ldac.cc1
-rw-r--r--system/stack/a2dp/a2dp_vendor_ldac_decoder.cc1
-rw-r--r--system/stack/a2dp/a2dp_vendor_opus.cc1
-rw-r--r--system/stack/a2dp/a2dp_vendor_opus_decoder.cc1
-rw-r--r--system/stack/btm/ble_scanner_hci_interface.cc1
-rw-r--r--system/stack/btm/btm_devctl.cc2
-rw-r--r--system/stack/btm/btm_inq.cc1
-rw-r--r--system/stack/btm/btm_sco.cc1
-rw-r--r--system/stack/btm/hfp_lc3_decoder.cc1
-rw-r--r--system/stack/btm/hfp_msbc_decoder.cc1
-rw-r--r--system/stack/btu/main_thread.cc1
-rw-r--r--system/stack/eatt/eatt_impl.h1
-rw-r--r--system/stack/gatt/att_protocol.cc1
-rw-r--r--system/stack/gatt/connection_manager.cc1
-rw-r--r--system/stack/gatt/gatt_api.cc1
-rw-r--r--system/stack/gatt/gatt_attr.cc1
-rw-r--r--system/stack/gatt/gatt_auth.cc2
-rw-r--r--system/stack/gatt/gatt_cl.cc1
-rw-r--r--system/stack/gatt/gatt_db.cc1
-rw-r--r--system/stack/gatt/gatt_main.cc1
-rw-r--r--system/stack/gatt/gatt_sr.cc2
-rw-r--r--system/stack/gatt/gatt_sr_hash.cc1
-rw-r--r--system/stack/gatt/gatt_utils.cc1
-rw-r--r--system/stack/hid/hidd_conn.cc1
-rw-r--r--system/stack/hid/hidh_conn.cc1
-rw-r--r--system/stack/l2cap/l2c_api.cc1
-rw-r--r--system/stack/l2cap/l2c_ble.cc1
-rw-r--r--system/stack/l2cap/l2c_ble_conn_params.cc1
-rw-r--r--system/stack/l2cap/l2c_csm.cc1
-rw-r--r--system/stack/l2cap/l2c_fcr.cc1
-rw-r--r--system/stack/l2cap/l2c_utils.cc1
-rw-r--r--system/stack/mmc/codec_client/codec_client.cc1
-rw-r--r--system/stack/mmc/codec_server/a2dp_aac_mmc_encoder.cc1
-rw-r--r--system/stack/mmc/codec_server/hfp_lc3_mmc_decoder.cc1
-rw-r--r--system/stack/mmc/codec_server/hfp_lc3_mmc_encoder.cc1
-rw-r--r--system/stack/mmc/codec_server/lc3_utils.h1
-rw-r--r--system/stack/mmc/daemon/service.cc1
-rw-r--r--system/stack/mmc/main.cc3
-rw-r--r--system/stack/mmc/metrics/mmc_rtt_logger.cc2
-rw-r--r--system/stack/pan/pan_api.cc1
-rw-r--r--system/stack/pan/pan_utils.cc1
-rw-r--r--system/stack/rfcomm/port_api.cc1
-rw-r--r--system/stack/rfcomm/port_rfc.cc1
-rw-r--r--system/stack/rfcomm/port_utils.cc1
-rw-r--r--system/stack/rfcomm/rfc_l2cap_if.cc1
-rw-r--r--system/stack/rfcomm/rfc_mx_fsm.cc1
-rw-r--r--system/stack/rfcomm/rfc_port_fsm.cc1
-rw-r--r--system/stack/rfcomm/rfc_ts_frames.cc1
-rw-r--r--system/stack/rfcomm/rfc_utils.cc1
-rw-r--r--system/stack/sdp/sdp_main.cc1
-rw-r--r--system/stack/sdp/sdp_server.cc1
-rw-r--r--system/stack/sdp/sdp_utils.cc3
-rw-r--r--system/stack/srvc/srvc_dis.cc1
-rw-r--r--system/stack/srvc/srvc_eng.cc1
-rw-r--r--system/stack/test/a2dp/a2dp_aac_unittest.cc1
-rw-r--r--system/stack/test/a2dp/a2dp_opus_unittest.cc1
-rw-r--r--system/stack/test/a2dp/a2dp_sbc_unittest.cc1
-rw-r--r--system/stack/test/common/mock_l2cap_layer.cc1
-rw-r--r--system/stack/test/common/stack_test_packet_utils.cc5
-rw-r--r--system/stack/test/gatt/gatt_api_test.cc1
-rw-r--r--system/stack/test/rfcomm/stack_rfcomm_test.cc3
-rw-r--r--system/stack/test/rfcomm/stack_rfcomm_test_main.cc1
-rw-r--r--system/test/headless/get_options.cc2
-rw-r--r--system/test/mock/mock_a2dp_codec_config.cc2
-rw-r--r--system/test/mock/mock_bta_jv_api.cc1
-rw-r--r--system/test/mock/mock_bta_vc.cc1
-rw-r--r--system/test/mock/mock_btif_profile_storage.h1
-rw-r--r--system/test/mock/mock_common_address_obfuscator.cc1
-rw-r--r--system/test/mock/mock_osi_allocator.h2
-rw-r--r--system/test/mock/mock_osi_config.h1
-rw-r--r--system/test/mock/mock_osi_fixed_queue.h2
-rw-r--r--system/test/mock/mock_osi_future.h2
-rw-r--r--system/test/mock/mock_osi_list.h1
-rw-r--r--system/test/mock/mock_osi_ringbuffer.h2
-rw-r--r--system/test/mock/mock_stack_a2dp_codec_config.cc2
-rw-r--r--system/test/mock/mock_stack_avrc_api.cc2
-rw-r--r--system/test/mock/mock_stack_avrc_bld_tg.cc2
-rw-r--r--system/test/mock/mock_stack_btm_ble_scanner.cc1
-rw-r--r--system/test/mock/mock_stack_btm_devctl.cc1
-rw-r--r--system/test/mock/mock_stack_btm_hfp_msbc_decoder.h1
-rw-r--r--system/test/mock/mock_stack_btm_inq.h2
-rw-r--r--system/test/mock/mock_stack_gatt_api.h2
-rw-r--r--system/test/mock/mock_stack_l2cap_api.h2
-rw-r--r--system/test/mock/mock_stack_rfcomm_port_api.cc2
263 files changed, 231 insertions, 441 deletions
diff --git a/android/app/jni/com_android_bluetooth_le_audio.cpp b/android/app/jni/com_android_bluetooth_le_audio.cpp
index 21996efcdf..91c4f62ca1 100644
--- a/android/app/jni/com_android_bluetooth_le_audio.cpp
+++ b/android/app/jni/com_android_bluetooth_le_audio.cpp
@@ -365,7 +365,7 @@ class LeAudioClientCallbacksImpl : public LeAudioClientCallbacks {
void OnGroupStreamStatus(int group_id,
GroupStreamStatus group_stream_status) override {
- LOG(INFO) << __func__;
+ log::info("");
std::shared_lock<std::shared_timed_mutex> lock(callbacks_mutex);
CallbackEnv sCallbackEnv(__func__);
diff --git a/system/audio/asrc/asrc_resampler.cc b/system/audio/asrc/asrc_resampler.cc
index 12c906b9c7..0176c0dcee 100644
--- a/system/audio/asrc/asrc_resampler.cc
+++ b/system/audio/asrc/asrc_resampler.cc
@@ -16,7 +16,6 @@
#include "asrc_resampler.h"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
@@ -160,14 +159,11 @@ class SourceAudioHalAsrc::ClockRecovery
output_stats = output_stats_;
}
- LOG(INFO) << base::StringPrintf("Deviation: %6d us (%3.0f ppm)",
- state.stream_time - state.local_time,
- state.butter_drift)
- << " | "
- << base::StringPrintf("Output Fs: %5.2f Hz drift: %2d us",
- output_stats.sample_rate,
- output_stats.drift_us)
- << std::endl;
+ log::info(
+ "Deviation: {:6} us ({:3.0f} ppm) | Output Fs: {:5.2f} Hz drift: {:2} "
+ "us",
+ state.stream_time - state.local_time, state.butter_drift,
+ output_stats.sample_rate, output_stats.drift_us);
}
public:
diff --git a/system/audio_hal_interface/aidl/audio_aidl_interfaces.h b/system/audio_hal_interface/aidl/audio_aidl_interfaces.h
index 3c25d24d35..e8fb9ba5e8 100644
--- a/system/audio_hal_interface/aidl/audio_aidl_interfaces.h
+++ b/system/audio_hal_interface/aidl/audio_aidl_interfaces.h
@@ -75,6 +75,4 @@
#undef LOG_DEBUG
#endif
-#include <base/logging.h>
-
// clang-format on \ No newline at end of file
diff --git a/system/audio_hal_interface/hal_version_manager.cc b/system/audio_hal_interface/hal_version_manager.cc
index d30d6c30b3..b3b4299cf7 100644
--- a/system/audio_hal_interface/hal_version_manager.cc
+++ b/system/audio_hal_interface/hal_version_manager.cc
@@ -18,7 +18,6 @@
#include <android/binder_manager.h>
#include <android/hidl/manager/1.2/IServiceManager.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hidl/ServiceManagement.h>
diff --git a/system/audio_hal_interface/hidl/client_interface_hidl.cc b/system/audio_hal_interface/hidl/client_interface_hidl.cc
index d67e36ae89..c55afe508e 100644
--- a/system/audio_hal_interface/hidl/client_interface_hidl.cc
+++ b/system/audio_hal_interface/hidl/client_interface_hidl.cc
@@ -19,7 +19,6 @@
#include "client_interface_hidl.h"
#include <android/hardware/bluetooth/audio/2.0/IBluetoothAudioPort.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hidl/MQDescriptor.h>
diff --git a/system/bta/ag/bta_ag_act.cc b/system/bta/ag/bta_ag_act.cc
index fdb5a63a81..0a96ab777e 100644
--- a/system/bta/ag/bta_ag_act.cc
+++ b/system/bta/ag/bta_ag_act.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/ag/bta_ag_cmd.cc b/system/bta/ag/bta_ag_cmd.cc
index 9b8cd47a39..27a692c071 100644
--- a/system/bta/ag/bta_ag_cmd.cc
+++ b/system/bta/ag/bta_ag_cmd.cc
@@ -19,7 +19,6 @@
#define LOG_TAG "bta_ag_cmd"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/ag/bta_ag_main.cc b/system/bta/ag/bta_ag_main.cc
index 09222589cc..cf01e443ff 100644
--- a/system/bta/ag/bta_ag_main.cc
+++ b/system/bta/ag/bta_ag_main.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string>
diff --git a/system/bta/ag/bta_ag_rfc.cc b/system/bta/ag/bta_ag_rfc.cc
index 62de05effc..5458a60f92 100644
--- a/system/bta/ag/bta_ag_rfc.cc
+++ b/system/bta/ag/bta_ag_rfc.cc
@@ -24,7 +24,6 @@
******************************************************************************/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "bta/ag/bta_ag_int.h"
@@ -221,14 +220,14 @@ void bta_ag_port_cback_6(uint32_t code, uint16_t port_handle) {
******************************************************************************/
void bta_ag_setup_port(tBTA_AG_SCB* p_scb, uint16_t handle) {
int port_callback_index = bta_ag_scb_to_idx(p_scb) - 1;
- CHECK_GE(port_callback_index, 0)
- << "invalid callback index, handle=" << handle << ", bd_addr"
- << p_scb->peer_addr;
- CHECK_LT(port_callback_index,
- static_cast<int>(sizeof(bta_ag_port_cback_tbl) /
- sizeof(bta_ag_port_cback_tbl[0])))
- << "callback index out of bound, handle=" << handle << ", bd_addr"
- << p_scb->peer_addr;
+ log::assert_that(port_callback_index >= 0,
+ "invalid callback index, handle={}, bd_addr={}", handle,
+ ADDRESS_TO_LOGGABLE_STR(p_scb->peer_addr));
+ log::assert_that(
+ port_callback_index < static_cast<int>(sizeof(bta_ag_port_cback_tbl) /
+ sizeof(bta_ag_port_cback_tbl[0])),
+ "callback index out of bound, handle={}, bd_addr={}", handle,
+ ADDRESS_TO_LOGGABLE_STR(p_scb->peer_addr));
PORT_SetEventMask(handle, BTA_AG_PORT_EV_MASK);
PORT_SetEventCallback(handle, bta_ag_port_cback_tbl[port_callback_index]);
}
@@ -249,14 +248,15 @@ void bta_ag_start_servers(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK services) {
/* if service is set in mask */
if (services & 1) {
int management_callback_index = bta_ag_scb_to_idx(p_scb) - 1;
- CHECK_GE(management_callback_index, 0)
- << "invalid callback index, services=" << loghex(services)
- << ", bd_addr=" << p_scb->peer_addr;
- CHECK_LT(management_callback_index,
- static_cast<int>(sizeof(bta_ag_mgmt_cback_tbl) /
- sizeof(bta_ag_mgmt_cback_tbl[0])))
- << "callback index out of bound, services=" << loghex(services)
- << ", bd_addr" << p_scb->peer_addr;
+ log::assert_that(management_callback_index >= 0,
+ "invalid callback index, services=0x{:x}, bd_addr={}",
+ services, ADDRESS_TO_LOGGABLE_STR(p_scb->peer_addr));
+ log::assert_that(
+ management_callback_index <
+ static_cast<int>(sizeof(bta_ag_mgmt_cback_tbl) /
+ sizeof(bta_ag_mgmt_cback_tbl[0])),
+ "callback index out of bound, services=0x{:x}, bd_addr={}", services,
+ ADDRESS_TO_LOGGABLE_STR(p_scb->peer_addr));
int status = RFCOMM_CreateConnectionWithSecurity(
bta_ag_uuid[i], bta_ag_cb.profile[i].scn, true, BTA_AG_MTU,
RawAddress::kAny, &(p_scb->serv_handle[i]),
diff --git a/system/bta/ag/bta_ag_sco.cc b/system/bta/ag/bta_ag_sco.cc
index d67c79fd90..4b26f10651 100644
--- a/system/bta/ag/bta_ag_sco.cc
+++ b/system/bta/ag/bta_ag_sco.cc
@@ -24,7 +24,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/ag/bta_ag_sdp.cc b/system/bta/ag/bta_ag_sdp.cc
index c4b30d88eb..66215bbbe9 100644
--- a/system/bta/ag/bta_ag_sdp.cc
+++ b/system/bta/ag/bta_ag_sdp.cc
@@ -25,7 +25,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "bta/ag/bta_ag_int.h"
diff --git a/system/bta/av/bta_av_aact.cc b/system/bta/av/bta_av_aact.cc
index 4b2d7ab873..02dda1b59b 100644
--- a/system/bta/av/bta_av_aact.cc
+++ b/system/bta/av/bta_av_aact.cc
@@ -356,7 +356,8 @@ static bool bta_av_next_getcap(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
void bta_av_proc_stream_evt(uint8_t handle, const RawAddress& bd_addr,
uint8_t event, tAVDT_CTRL* p_data,
uint8_t scb_index) {
- CHECK_LT(scb_index, BTA_AV_NUM_STRS);
+ log::assert_that(scb_index < BTA_AV_NUM_STRS,
+ "assert failed: scb_index < BTA_AV_NUM_STRS");
tBTA_AV_SCB* p_scb = bta_av_cb.p_scb[scb_index];
uint16_t sec_len = 0;
diff --git a/system/bta/csis/csis_client.cc b/system/bta/csis/csis_client.cc
index a893ad322c..fb1d363c3f 100644
--- a/system/bta/csis/csis_client.cc
+++ b/system/bta/csis/csis_client.cc
@@ -17,7 +17,6 @@
#include <base/functional/bind.h>
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
#include <hardware/bt_csis.h>
diff --git a/system/bta/csis/csis_client_test.cc b/system/bta/csis/csis_client_test.cc
index e905b2dbbd..d4be5fe63d 100644
--- a/system/bta/csis/csis_client_test.cc
+++ b/system/bta/csis/csis_client_test.cc
@@ -78,7 +78,7 @@ extern "C" const char* __asan_default_options() {
}
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/bta/csis/csis_types.h b/system/bta/csis/csis_types.h
index 6c2e43ad6d..7104df0315 100644
--- a/system/bta/csis/csis_types.h
+++ b/system/bta/csis/csis_types.h
@@ -16,7 +16,7 @@
*/
#pragma once
-#include <base/logging.h>
+
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc
index 9baacd606a..d4fc4731eb 100644
--- a/system/bta/dm/bta_dm_act.cc
+++ b/system/bta/dm/bta_dm_act.cc
@@ -28,7 +28,6 @@
#include <android_bluetooth_flags.h>
#include <android_bluetooth_sysprop.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/dm/bta_dm_disc.cc b/system/bta/dm/bta_dm_disc.cc
index 877af4c381..3e0a01e80d 100644
--- a/system/bta/dm/bta_dm_disc.cc
+++ b/system/bta/dm/bta_dm_disc.cc
@@ -20,7 +20,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
#include <stddef.h>
diff --git a/system/bta/gatt/bta_gattc_act.cc b/system/bta/gatt/bta_gattc_act.cc
index abafb9f2de..b090c14811 100644
--- a/system/bta/gatt/bta_gattc_act.cc
+++ b/system/bta/gatt/bta_gattc_act.cc
@@ -27,7 +27,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/bta/gatt/bta_gattc_api.cc b/system/bta/gatt/bta_gattc_api.cc
index 048bc14534..b2142942c7 100644
--- a/system/bta/gatt/bta_gattc_api.cc
+++ b/system/bta/gatt/bta_gattc_api.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "bta_gattc_api"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <ios>
diff --git a/system/bta/gatt/bta_gattc_cache.cc b/system/bta/gatt/bta_gattc_cache.cc
index b5059597da..cfe5992e6b 100644
--- a/system/bta/gatt/bta_gattc_cache.cc
+++ b/system/bta/gatt/bta_gattc_cache.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "bt_bta_gattc"
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/bta/gatt/bta_gattc_db_storage.cc b/system/bta/gatt/bta_gattc_db_storage.cc
index 08c3ac107b..f074dbd507 100644
--- a/system/bta/gatt/bta_gattc_db_storage.cc
+++ b/system/bta/gatt/bta_gattc_db_storage.cc
@@ -18,7 +18,6 @@
#define LOG_TAG "bt_bta_gattc"
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
#include <dirent.h>
diff --git a/system/bta/gatt/bta_gattc_main.cc b/system/bta/gatt/bta_gattc_main.cc
index 962c819437..a7a58457ad 100644
--- a/system/bta/gatt/bta_gattc_main.cc
+++ b/system/bta/gatt/bta_gattc_main.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#define LOG_TAG "bta_gattc_main"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/bta/gatt/bta_gattc_queue.cc b/system/bta/gatt/bta_gattc_queue.cc
index 7531323a30..9929dabf6a 100644
--- a/system/bta/gatt/bta_gattc_queue.cc
+++ b/system/bta/gatt/bta_gattc_queue.cc
@@ -16,7 +16,6 @@
#define LOG_TAG "gatt"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <list>
diff --git a/system/bta/gatt/bta_gattc_utils.cc b/system/bta/gatt/bta_gattc_utils.cc
index b10cea70d3..5673a4adb9 100644
--- a/system/bta/gatt/bta_gattc_utils.cc
+++ b/system/bta/gatt/bta_gattc_utils.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "bt_bta_gattc"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/gatt/bta_gatts_act.cc b/system/bta/gatt/bta_gatts_act.cc
index cf5b6c0fbb..935f0b9ba7 100644
--- a/system/bta/gatt/bta_gatts_act.cc
+++ b/system/bta/gatt/bta_gatts_act.cc
@@ -23,7 +23,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/gatt/bta_gatts_api.cc b/system/bta/gatt/bta_gatts_api.cc
index 0362f0d991..2c695919fb 100644
--- a/system/bta/gatt/bta_gatts_api.cc
+++ b/system/bta/gatt/bta_gatts_api.cc
@@ -24,7 +24,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/gatt/bta_gatts_main.cc b/system/bta/gatt/bta_gatts_main.cc
index 49eb718402..853c63ad2f 100644
--- a/system/bta/gatt/bta_gatts_main.cc
+++ b/system/bta/gatt/bta_gatts_main.cc
@@ -22,7 +22,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "bta/gatt/bta_gatts_int.h"
diff --git a/system/bta/gatt/bta_gatts_utils.cc b/system/bta/gatt/bta_gatts_utils.cc
index 2f996470c4..783d42ba52 100644
--- a/system/bta/gatt/bta_gatts_utils.cc
+++ b/system/bta/gatt/bta_gatts_utils.cc
@@ -22,7 +22,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/gatt/database.cc b/system/bta/gatt/database.cc
index b1596b9cbd..60a23961da 100644
--- a/system/bta/gatt/database.cc
+++ b/system/bta/gatt/database.cc
@@ -18,7 +18,6 @@
#include "database.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <algorithm>
diff --git a/system/bta/gatt/database_builder.cc b/system/bta/gatt/database_builder.cc
index 34e6305617..bf29e4efed 100644
--- a/system/bta/gatt/database_builder.cc
+++ b/system/bta/gatt/database_builder.cc
@@ -18,7 +18,6 @@
#include "bta/gatt/database_builder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <algorithm>
diff --git a/system/bta/groups/groups.cc b/system/bta/groups/groups.cc
index fd81b9fb41..765bac872b 100644
--- a/system/bta/groups/groups.cc
+++ b/system/bta/groups/groups.cc
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <algorithm>
diff --git a/system/bta/groups/groups_test.cc b/system/bta/groups/groups_test.cc
index 860f743f55..60ed120884 100644
--- a/system/bta/groups/groups_test.cc
+++ b/system/bta/groups/groups_test.cc
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -42,7 +41,7 @@ using bluetooth::groups::DeviceGroupsCallbacks;
DeviceGroupsCallbacks* dev_callbacks;
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/bta/has/has_client.cc b/system/bta/has/has_client.cc
index 1a06cd8ea7..dc2aea3739 100644
--- a/system/bta/has/has_client.cc
+++ b/system/bta/has/has_client.cc
@@ -17,7 +17,6 @@
#include <base/functional/bind.h>
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
#include <hardware/bt_gatt_types.h>
@@ -190,9 +189,9 @@ class HasClientImpl : public HasClient {
void AddFromStorage(const RawAddress& address, uint8_t features,
uint16_t is_acceptlisted) {
- DLOG(INFO) << __func__ << ": " << ADDRESS_TO_LOGGABLE_STR(address)
- << ", features=" << loghex(features)
- << ", isAcceptlisted=" << is_acceptlisted;
+ log::debug("{}, features={}, isAcceptlisted={}",
+ ADDRESS_TO_LOGGABLE_STR(address), loghex(features),
+ is_acceptlisted);
/* Notify upper layer about the device */
callbacks_->OnDeviceAvailable(address, features);
@@ -208,7 +207,7 @@ class HasClientImpl : public HasClient {
}
void Disconnect(const RawAddress& address) override {
- DLOG(INFO) << __func__ << ": " << ADDRESS_TO_LOGGABLE_STR(address);
+ log::debug("{}", ADDRESS_TO_LOGGABLE_STR(address));
std::vector<RawAddress> addresses = {address};
auto csis_api = CsisClient::Get();
@@ -298,7 +297,7 @@ class HasClientImpl : public HasClient {
void OnHasActivePresetCycleStatus(uint16_t conn_id, tGATT_STATUS status,
void* user_data) {
- DLOG(INFO) << __func__ << " status: " << +status;
+ log::debug("status: {}", status);
auto device = GetDevice(conn_id);
if (!device) {
@@ -407,7 +406,7 @@ class HasClientImpl : public HasClient {
void OnHasPresetIndexOperation(uint16_t conn_id, tGATT_STATUS status,
void* user_data) {
- DLOG(INFO) << __func__;
+ log::debug("");
auto device = GetDevice(conn_id);
if (!device) {
@@ -455,7 +454,7 @@ class HasClientImpl : public HasClient {
}
void CpReadAllPresetsOperation(HasCtpOp operation) {
- DLOG(INFO) << __func__ << " Operation: " << operation;
+ log::debug("Operation: {}", operation);
if (std::holds_alternative<int>(operation.addr_or_group)) {
log::error("Read all presets on the entire group not supported.");
@@ -501,7 +500,7 @@ class HasClientImpl : public HasClient {
ErrorCode CpPresetIndexOperationWriteReq(HasDevice& device,
HasCtpOp& operation) {
- DLOG(INFO) << __func__ << " Operation: " << operation;
+ log::debug("Operation: {}", operation);
if (!device.IsConnected()) return ErrorCode::OPERATION_NOT_POSSIBLE;
@@ -550,7 +549,7 @@ class HasClientImpl : public HasClient {
HasCtpOp operation,
std::function<ErrorCode(HasDevice& device, HasCtpOp& operation)>
write_cb) {
- DLOG(INFO) << __func__ << " Operation: " << operation;
+ log::debug("Operation: {}", operation);
auto status = ErrorCode::NO_ERROR;
if (operation.IsGroupRequest()) {
@@ -659,8 +658,8 @@ class HasClientImpl : public HasClient {
ErrorCode CpPresetsCycleOperationWriteReq(HasDevice& device,
HasCtpOp& operation) {
- DLOG(INFO) << __func__ << " addr: " << ADDRESS_TO_LOGGABLE_STR(device.addr)
- << " operation: " << operation;
+ log::debug("addr: {} operation: {}", ADDRESS_TO_LOGGABLE_STR(device.addr),
+ operation);
if (!device.IsConnected()) return ErrorCode::OPERATION_NOT_POSSIBLE;
@@ -691,7 +690,7 @@ class HasClientImpl : public HasClient {
}
void CpPresetsCycleOperation(HasCtpOp operation) {
- DLOG(INFO) << __func__ << " Operation: " << operation;
+ log::debug("Operation: {}", operation);
auto status = CpPresetOperationCaller(
operation, [](HasDevice& device, HasCtpOp operation) -> ErrorCode {
@@ -706,8 +705,8 @@ class HasClientImpl : public HasClient {
ErrorCode CpWritePresetNameOperationWriteReq(HasDevice& device,
HasCtpOp operation) {
- DLOG(INFO) << __func__ << " addr: " << ADDRESS_TO_LOGGABLE_STR(device.addr)
- << " operation: " << operation;
+ log::debug("addr: {} operation: {}", ADDRESS_TO_LOGGABLE_STR(device.addr),
+ operation);
if (!device.IsConnected()) return ErrorCode::OPERATION_NOT_POSSIBLE;
@@ -746,7 +745,7 @@ class HasClientImpl : public HasClient {
}
void CpWritePresetNameOperation(HasCtpOp operation) {
- DLOG(INFO) << __func__ << " operation: " << operation;
+ log::debug("operation: {}", operation);
auto status = ErrorCode::NO_ERROR;
@@ -820,7 +819,7 @@ class HasClientImpl : public HasClient {
void SelectActivePreset(std::variant<RawAddress, int> addr_or_group_id,
uint8_t preset_index) override {
- DLOG(INFO) << __func__;
+ log::debug("");
auto opcode = shouldRequestSyncedOp(addr_or_group_id,
PresetCtpOpcode::SET_ACTIVE_PRESET_SYNC)
@@ -832,7 +831,7 @@ class HasClientImpl : public HasClient {
void NextActivePreset(
std::variant<RawAddress, int> addr_or_group_id) override {
- DLOG(INFO) << __func__;
+ log::debug("");
auto opcode = shouldRequestSyncedOp(addr_or_group_id,
PresetCtpOpcode::SET_NEXT_PRESET_SYNC)
@@ -844,7 +843,7 @@ class HasClientImpl : public HasClient {
void PreviousActivePreset(
std::variant<RawAddress, int> addr_or_group_id) override {
- DLOG(INFO) << __func__;
+ log::debug("");
auto opcode = shouldRequestSyncedOp(addr_or_group_id,
PresetCtpOpcode::SET_PREV_PRESET_SYNC)
@@ -863,7 +862,7 @@ class HasClientImpl : public HasClient {
return;
}
- DLOG(INFO) << __func__ << " preset idx: " << +preset_index;
+ log::debug("preset idx: {}", preset_index);
/* Due to mandatory control point notifications or indications, preset
* details are always up to date. However we have to be able to do the
@@ -894,8 +893,7 @@ class HasClientImpl : public HasClient {
void SetPresetName(std::variant<RawAddress, int> addr_or_group_id,
uint8_t preset_index, std::string name) override {
- DLOG(INFO) << __func__ << "preset_idx: " << +preset_index
- << ", name: " << name;
+ log::debug("preset_idx: {}, name: {}", preset_index, name);
CpWritePresetNameOperation(HasCtpOp(addr_or_group_id,
PresetCtpOpcode::WRITE_PRESET_NAME,
@@ -975,7 +973,7 @@ class HasClientImpl : public HasClient {
}
void OnEncrypted(HasDevice& device) {
- DLOG(INFO) << __func__ << ": " << ADDRESS_TO_LOGGABLE_STR(device.addr);
+ log::debug("{}", ADDRESS_TO_LOGGABLE_STR(device.addr));
if (device.isGattServiceValid()) {
device.is_connecting_actively = false;
@@ -992,7 +990,7 @@ class HasClientImpl : public HasClient {
}
void NotifyHasDeviceValid(const HasDevice& device) {
- DLOG(INFO) << __func__ << " addr:" << ADDRESS_TO_LOGGABLE_STR(device.addr);
+ log::debug("addr:{}", ADDRESS_TO_LOGGABLE_STR(device.addr));
std::vector<uint8_t> preset_indices;
preset_indices.reserve(device.has_presets.size());
@@ -1024,7 +1022,7 @@ class HasClientImpl : public HasClient {
void OnGattWriteCcc(uint16_t conn_id, tGATT_STATUS status, uint16_t handle,
void* user_data) {
- DLOG(INFO) << __func__ << ": handle=" << loghex(handle);
+ log::debug("handle={}", loghex(handle));
auto device = GetDevice(conn_id);
if (!device) {
@@ -1100,7 +1098,7 @@ class HasClientImpl : public HasClient {
std::variant<uint16_t, HasDevice*> conn_id_device_variant,
tGATT_STATUS status, uint16_t handle, uint16_t len, const uint8_t* value,
void* user_data = nullptr) {
- DLOG(INFO) << __func__;
+ log::debug("");
auto device = GetDevice(conn_id_device_variant);
if (!device) {
@@ -1179,7 +1177,7 @@ class HasClientImpl : public HasClient {
}
void OnHasPresetReadResponseNotification(HasDevice& device) {
- DLOG(INFO) << __func__;
+ log::debug("");
while (device.ctp_notifications_.size() != 0) {
auto ntf = device.ctp_notifications_.front();
@@ -1228,7 +1226,7 @@ class HasClientImpl : public HasClient {
}
void OnHasPresetGenericUpdate(HasDevice& device) {
- DLOG(ERROR) << __func__;
+ log::verbose("");
std::vector<PresetInfo> updated_infos;
std::vector<PresetInfo> deleted_infos;
@@ -1342,7 +1340,7 @@ class HasClientImpl : public HasClient {
}
void OnHasPresetAvailabilityChanged(HasDevice& device) {
- DLOG(INFO) << __func__;
+ log::debug("");
std::vector<PresetInfo> infos;
@@ -1390,7 +1388,7 @@ class HasClientImpl : public HasClient {
}
void OnHasPresetDeleted(HasDevice& device) {
- DLOG(INFO) << __func__;
+ log::debug("");
std::vector<PresetInfo> infos;
bool is_deleted = false;
@@ -1435,7 +1433,7 @@ class HasClientImpl : public HasClient {
while (device.ctp_notifications_.size() != 0) {
auto ntf = device.ctp_notifications_.front();
- DLOG(INFO) << __func__ << " ntf: " << ntf;
+ log::debug("ntf: {}", ntf);
if (ntf.opcode == PresetCtpOpcode::PRESET_CHANGED) {
switch (ntf.change_id) {
@@ -1475,7 +1473,7 @@ class HasClientImpl : public HasClient {
}
auto ntf = ntf_opt.value();
- DLOG(INFO) << __func__ << ntf;
+ log::debug("{}", ntf);
device->ctp_notifications_.push_back(ntf);
if (ntf.is_last) ProcessCtpNotificationQueue(*device);
@@ -1485,7 +1483,7 @@ class HasClientImpl : public HasClient {
std::variant<uint16_t, HasDevice*> conn_id_device_variant,
tGATT_STATUS status, uint16_t handle, uint16_t len, const uint8_t* value,
void* user_data = nullptr) {
- DLOG(INFO) << __func__;
+ log::debug("");
auto device = GetDevice(conn_id_device_variant);
if (!device) {
@@ -1621,8 +1619,7 @@ class HasClientImpl : public HasClient {
/* These below are all GATT service discovery, validation, cache & storage */
bool CacheAttributeHandles(const gatt::Service& service, HasDevice* device) {
- DLOG(INFO) << __func__ << ": device="
- << ADDRESS_TO_LOGGABLE_STR(device->addr);
+ log::debug("device={}", ADDRESS_TO_LOGGABLE_STR(device->addr));
for (const gatt::Characteristic& charac : service.characteristics) {
if (charac.uuid == kUuidActivePresetIndex) {
@@ -1672,8 +1669,7 @@ class HasClientImpl : public HasClient {
}
bool LoadHasDetailsFromStorage(HasDevice* device) {
- DLOG(INFO) << __func__ << ": device="
- << ADDRESS_TO_LOGGABLE_STR(device->addr);
+ log::debug("device={}", ADDRESS_TO_LOGGABLE_STR(device->addr));
std::vector<uint8_t> presets_bin;
uint8_t active_preset;
@@ -1789,7 +1785,7 @@ class HasClientImpl : public HasClient {
}
bool OnHasServiceFound(const gatt::Service& service, void* context) {
- DLOG(INFO) << __func__;
+ log::debug("");
auto* device = static_cast<HasDevice*>(context);
@@ -1805,7 +1801,7 @@ class HasClientImpl : public HasClient {
/* These below are all generic event handlers calling in HAS specific code. */
void GattcCallback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
- DLOG(INFO) << __func__ << ": event = " << static_cast<int>(event);
+ log::debug("event = {}", static_cast<int>(event));
switch (event) {
case BTA_GATTC_DEREG_EVT:
@@ -1917,9 +1913,8 @@ class HasClientImpl : public HasClient {
loghex(evt.conn_id));
return;
}
- DLOG(INFO) << __func__ << ": device="
- << ADDRESS_TO_LOGGABLE_STR(device->addr)
- << ": reason=" << loghex(static_cast<int>(evt.reason));
+ log::debug("device={}: reason={}", ADDRESS_TO_LOGGABLE_STR(device->addr),
+ loghex(static_cast<int>(evt.reason)));
/* Don't notify disconnect state for background connection that failed */
if (device->is_connecting_actively || device->isGattServiceValid())
@@ -1943,7 +1938,7 @@ class HasClientImpl : public HasClient {
return;
}
- DLOG(INFO) << __func__;
+ log::debug("");
/* verify link is encrypted */
if (!BTM_IsEncrypted(device->addr, BT_TRANSPORT_LE)) {
@@ -1996,7 +1991,7 @@ class HasClientImpl : public HasClient {
}
void OnLeEncryptionComplete(const RawAddress& address, bool success) {
- DLOG(INFO) << __func__ << ": " << ADDRESS_TO_LOGGABLE_STR(address);
+ log::debug("{}", ADDRESS_TO_LOGGABLE_STR(address));
auto device = std::find_if(devices_.begin(), devices_.end(),
HasDevice::MatchAddress(address));
@@ -2063,8 +2058,7 @@ class HasClientImpl : public HasClient {
return;
}
- DLOG(INFO) << __func__ << ": address="
- << ADDRESS_TO_LOGGABLE_STR(address);
+ log::debug("address={}", ADDRESS_TO_LOGGABLE_STR(address));
if (!device->isGattServiceValid())
BTA_GATTC_ServiceSearchRequest(device->conn_id,
@@ -2094,10 +2088,9 @@ class HasClientImpl : public HasClient {
if (value_handle != GAP_INVALID_HANDLE) {
tGATT_STATUS register_status =
BTA_GATTC_RegisterForNotifications(gatt_if_, address, value_handle);
- DLOG(INFO) << __func__ << ": BTA_GATTC_RegisterForNotifications, status="
- << loghex(+register_status)
- << " value=" << loghex(value_handle)
- << " ccc=" << loghex(ccc_handle);
+ log::debug(
+ "BTA_GATTC_RegisterForNotifications, status={} value={} ccc={}",
+ loghex(+register_status), loghex(value_handle), loghex(ccc_handle));
if (register_status != GATT_SUCCESS) return;
}
diff --git a/system/bta/has/has_client_test.cc b/system/bta/has/has_client_test.cc
index 7575561606..8724823544 100644
--- a/system/bta/has/has_client_test.cc
+++ b/system/bta/has/has_client_test.cc
@@ -81,7 +81,7 @@ using ::testing::WithArg;
// }
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/bta/has/has_ctp.h b/system/bta/has/has_ctp.h
index d04fb2f95a..9dff63c674 100644
--- a/system/bta/has/has_ctp.h
+++ b/system/bta/has/has_ctp.h
@@ -17,7 +17,6 @@
#pragma once
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <list>
@@ -180,7 +179,7 @@ struct HasCtpGroupOpCoordinator {
static void Cleanup() {
if (operation_timeout_timer != nullptr) {
if (alarm_is_scheduled(operation_timeout_timer)) {
- DLOG(INFO) << __func__ << +ref_cnt;
+ log::verbose("{}", ref_cnt);
alarm_cancel(operation_timeout_timer);
}
alarm_free(operation_timeout_timer);
diff --git a/system/bta/has/has_preset.h b/system/bta/has/has_preset.h
index 7ba4e523de..57991beaa5 100644
--- a/system/bta/has/has_preset.h
+++ b/system/bta/has/has_preset.h
@@ -17,7 +17,7 @@
#pragma once
-#include <base/logging.h>
+#include <bluetooth/log.h>
#include <optional>
#include <string>
@@ -113,3 +113,8 @@ class HasPreset {
} // namespace has
} // namespace bluetooth::le_audio
+
+namespace fmt {
+template <>
+struct formatter<bluetooth::le_audio::has::HasPreset> : ostream_formatter {};
+} // namespace fmt
diff --git a/system/bta/has/has_types.h b/system/bta/has/has_types.h
index 729c8186ce..c5b100b66d 100644
--- a/system/bta/has/has_types.h
+++ b/system/bta/has/has_types.h
@@ -284,7 +284,7 @@ class HasDevice : public GattServiceDevice {
all_info.reserve(has_presets.size());
for (auto const& preset : has_presets) {
- DLOG(INFO) << __func__ << " preset: " << preset;
+ log::verbose("preset: {}", preset);
all_info.push_back({.preset_index = preset.GetIndex(),
.writable = preset.IsWritable(),
.available = preset.IsAvailable(),
diff --git a/system/bta/hearing_aid/hearing_aid.cc b/system/bta/hearing_aid/hearing_aid.cc
index 08431843d5..11401321f3 100644
--- a/system/bta/hearing_aid/hearing_aid.cc
+++ b/system/bta/hearing_aid/hearing_aid.cc
@@ -24,7 +24,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h> // HexEncode
#include <bluetooth/log.h>
diff --git a/system/bta/hearing_aid/hearing_aid_audio_source.cc b/system/bta/hearing_aid/hearing_aid_audio_source.cc
index 3c1b038934..6c5656cbae 100644
--- a/system/bta/hearing_aid/hearing_aid_audio_source.cc
+++ b/system/bta/hearing_aid/hearing_aid_audio_source.cc
@@ -17,7 +17,6 @@
******************************************************************************/
#include <base/files/file_util.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/hf_client/bta_hf_client_main.cc b/system/bta/hf_client/bta_hf_client_main.cc
index 3f0fde6f07..6bf3e73d2d 100644
--- a/system/bta/hf_client/bta_hf_client_main.cc
+++ b/system/bta/hf_client/bta_hf_client_main.cc
@@ -17,7 +17,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/hf_client/bta_hf_client_rfc.cc b/system/bta/hf_client/bta_hf_client_rfc.cc
index b61ebb48e1..6348a15acd 100644
--- a/system/bta/hf_client/bta_hf_client_rfc.cc
+++ b/system/bta/hf_client/bta_hf_client_rfc.cc
@@ -24,7 +24,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/jv/bta_jv_act.cc b/system/bta/jv/bta_jv_act.cc
index d28968cda5..a0c7f39ed1 100644
--- a/system/bta/jv/bta_jv_act.cc
+++ b/system/bta/jv/bta_jv_act.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "bluetooth"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/jv/bta_jv_api.cc b/system/bta/jv/bta_jv_api.cc
index 593915eb5b..d19c21b407 100644
--- a/system/bta/jv/bta_jv_api.cc
+++ b/system/bta/jv/bta_jv_api.cc
@@ -25,7 +25,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/bta/le_audio/audio_hal_client/audio_source_hal_client.cc b/system/bta/le_audio/audio_hal_client/audio_source_hal_client.cc
index 2842900380..e7a357b3df 100644
--- a/system/bta/le_audio/audio_hal_client/audio_source_hal_client.cc
+++ b/system/bta/le_audio/audio_hal_client/audio_source_hal_client.cc
@@ -19,7 +19,6 @@
******************************************************************************/
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "audio/asrc/asrc_resampler.h"
diff --git a/system/bta/le_audio/broadcaster/broadcaster.cc b/system/bta/le_audio/broadcaster/broadcaster.cc
index 1af7248240..a8d9b5cb82 100644
--- a/system/bta/le_audio/broadcaster/broadcaster.cc
+++ b/system/bta/le_audio/broadcaster/broadcaster.cc
@@ -16,7 +16,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/bta/le_audio/broadcaster/broadcaster_types.h b/system/bta/le_audio/broadcaster/broadcaster_types.h
index 1b9a445fe0..fa71a34f12 100644
--- a/system/bta/le_audio/broadcaster/broadcaster_types.h
+++ b/system/bta/le_audio/broadcaster/broadcaster_types.h
@@ -17,7 +17,6 @@
#pragma once
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <optional>
diff --git a/system/bta/le_audio/client.cc b/system/bta/le_audio/client.cc
index 0b17a0cf91..15eb91eee6 100644
--- a/system/bta/le_audio/client.cc
+++ b/system/bta/le_audio/client.cc
@@ -171,6 +171,11 @@ std::ostream& operator<<(std::ostream& os, const AudioState& audio_state) {
return os;
}
+namespace fmt {
+template <>
+struct formatter<AudioState> : ostream_formatter {};
+} // namespace fmt
+
namespace {
void le_audio_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data);
@@ -842,7 +847,7 @@ class LeAudioClientImpl : public LeAudioClient {
log::debug("configuration_context_type= {}",
ToString(configuration_context_type));
- DLOG(INFO) << __func__;
+ log::debug("");
if (configuration_context_type >= LeAudioContextType::RFU) {
log::error("stream context type is not supported: {}",
ToHexString(configuration_context_type));
@@ -2649,8 +2654,7 @@ class LeAudioClientImpl : public LeAudioClient {
LeAudioDevice* leAudioDevice = leAudioDevices_.FindByConnId(conn_id);
if (!leAudioDevice) {
- DLOG(ERROR) << __func__ << ", skipping unknown leAudioDevice, conn_id: "
- << loghex(conn_id);
+ log::error("skipping unknown leAudioDevice, conn_id: 0x{:x}", conn_id);
return;
}
@@ -3137,8 +3141,7 @@ class LeAudioClientImpl : public LeAudioClient {
if (audio_sender_state_ == AudioState::IDLE &&
audio_receiver_state_ == AudioState::IDLE) {
- DLOG(INFO) << __func__
- << " Device not streaming but active - nothing to do";
+ log::debug("Device not streaming but active - nothing to do");
return;
}
@@ -3369,8 +3372,8 @@ class LeAudioClientImpl : public LeAudioClient {
sw_enc_right->Encode(data.data() + bytes_per_sample, 2, byte_count);
}
- DLOG(INFO) << __func__ << " left_cis_handle: " << +left_cis_handle
- << " right_cis_handle: " << right_cis_handle;
+ log::debug("left_cis_handle: {} right_cis_handle: {}", left_cis_handle,
+ right_cis_handle);
/* Send data to the controller */
if (left_cis_handle)
IsoManager::GetInstance()->SendIsoData(
@@ -4141,12 +4144,12 @@ class LeAudioClientImpl : public LeAudioClient {
return;
}
- DLOG(INFO) << __func__ << " active_group_id: " << active_group_id_ << "\n"
- << " audio_receiver_state: " << audio_receiver_state_ << "\n"
- << " audio_sender_state: " << audio_sender_state_ << "\n"
- << " configuration_context_type_: "
- << ToHexString(configuration_context_type_) << "\n"
- << " group " << (group ? " exist " : " does not exist ") << "\n";
+ log::debug(
+ "active_group_id: {}\n audio_receiver_state: {}\n audio_sender_state: "
+ "{}\n configuration_context_type_: {}\n group {}\n",
+ active_group_id_, audio_receiver_state_, audio_sender_state_,
+ ToHexString(configuration_context_type_),
+ (group ? " exist " : " does not exist "));
switch (audio_sender_state_) {
case AudioState::STARTED:
@@ -4416,12 +4419,12 @@ class LeAudioClientImpl : public LeAudioClient {
return;
}
- DLOG(INFO) << __func__ << " active_group_id: " << active_group_id_ << "\n"
- << " audio_receiver_state: " << audio_receiver_state_ << "\n"
- << " audio_sender_state: " << audio_sender_state_ << "\n"
- << " configuration_context_type_: "
- << ToHexString(configuration_context_type_) << "\n"
- << " group " << (group ? " exist " : " does not exist ") << "\n";
+ log::debug(
+ "active_group_id: {}\n audio_receiver_state: {}\n audio_sender_state: "
+ "{}\n configuration_context_type_: {}\n group {}\n",
+ active_group_id_, audio_receiver_state_, audio_sender_state_,
+ ToHexString(configuration_context_type_),
+ (group ? " exist " : " does not exist "));
switch (audio_receiver_state_) {
case AudioState::STARTED:
@@ -4649,7 +4652,7 @@ class LeAudioClientImpl : public LeAudioClient {
}
if (group->GetState() != AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) {
- DLOG(INFO) << __func__ << " Group is not streaming ";
+ log::debug("Group is not streaming");
return false;
}
diff --git a/system/bta/le_audio/client_parser.cc b/system/bta/le_audio/client_parser.cc
index ea1ac998b2..b23adb9b7d 100644
--- a/system/bta/le_audio/client_parser.cc
+++ b/system/bta/le_audio/client_parser.cc
@@ -21,7 +21,6 @@
#include "client_parser.h"
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
#include <endian.h>
diff --git a/system/bta/le_audio/codec_interface.cc b/system/bta/le_audio/codec_interface.cc
index e3eaf8f0df..ee5d0f2e80 100644
--- a/system/bta/le_audio/codec_interface.cc
+++ b/system/bta/le_audio/codec_interface.cc
@@ -18,7 +18,6 @@
#include "codec_interface.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/bta/le_audio/content_control_id_keeper.cc b/system/bta/le_audio/content_control_id_keeper.cc
index 18035fab62..3f5d410368 100644
--- a/system/bta/le_audio/content_control_id_keeper.cc
+++ b/system/bta/le_audio/content_control_id_keeper.cc
@@ -16,7 +16,6 @@
#include "content_control_id_keeper.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <bitset>
diff --git a/system/bta/le_audio/device_groups.cc b/system/bta/le_audio/device_groups.cc
index eea8e57240..0fc34a8163 100644
--- a/system/bta/le_audio/device_groups.cc
+++ b/system/bta/le_audio/device_groups.cc
@@ -2160,8 +2160,7 @@ void LeAudioDeviceGroups::Dump(int fd, int active_group_id) const {
bool LeAudioDeviceGroups::IsAnyInTransition(void) const {
for (auto& g : groups_) {
if (g->IsInTransition()) {
- DLOG(INFO) << __func__ << " group: " << g->group_id_
- << " is in transition";
+ log::debug("group: {} is in transition", g->group_id_);
return true;
}
}
diff --git a/system/bta/le_audio/devices.cc b/system/bta/le_audio/devices.cc
index be4ef48d20..f11c569188 100644
--- a/system/bta/le_audio/devices.cc
+++ b/system/bta/le_audio/devices.cc
@@ -365,7 +365,7 @@ void LeAudioDevice::RegisterPACs(
std::vector<struct types::acs_ac_record>* pac_recs) {
/* Clear PAC database for characteristic in case if re-read, indicated */
if (!pac_db->empty()) {
- DLOG(INFO) << __func__ << ", upgrade PACs for characteristic";
+ log::debug("upgrade PACs for characteristic");
pac_db->clear();
}
diff --git a/system/bta/le_audio/devices.h b/system/bta/le_audio/devices.h
index 0c40719359..7742245c46 100644
--- a/system/bta/le_audio/devices.h
+++ b/system/bta/le_audio/devices.h
@@ -17,8 +17,6 @@
#pragma once
-#include <base/logging.h>
-
#include <map>
#include <memory>
#include <optional>
diff --git a/system/bta/le_audio/devices_test.cc b/system/bta/le_audio/devices_test.cc
index 74352ed9fc..249d14c367 100644
--- a/system/bta/le_audio/devices_test.cc
+++ b/system/bta/le_audio/devices_test.cc
@@ -56,7 +56,7 @@ using testing::Return;
using testing::Test;
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/bta/le_audio/le_audio_client_test.cc b/system/bta/le_audio/le_audio_client_test.cc
index ac6a826b46..a71468d171 100644
--- a/system/bta/le_audio/le_audio_client_test.cc
+++ b/system/bta/le_audio/le_audio_client_test.cc
@@ -2897,7 +2897,7 @@ class UnicastTestHandoverMode : public UnicastTest {
};
RawAddress GetTestAddress(uint8_t index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {{0xC0, 0xDE, 0xC0, 0xDE, 0x00, index}};
return result;
}
diff --git a/system/bta/le_audio/le_audio_health_status_test.cc b/system/bta/le_audio/le_audio_health_status_test.cc
index 0a6ecc07f3..0819f6c088 100644
--- a/system/bta/le_audio/le_audio_health_status_test.cc
+++ b/system/bta/le_audio/le_audio_health_status_test.cc
@@ -19,7 +19,6 @@
#include <base/functional/callback.h>
#include <base/functional/callback_forward.h>
#include <base/functional/callback_helpers.h>
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -73,7 +72,7 @@ class LeAudioHealthStatusTest : public ::testing::Test {
};
RawAddress GetTestAddress(uint8_t index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {{0xC0, 0xDE, 0xC0, 0xDE, 0x00, index}};
return result;
}
@@ -232,4 +231,4 @@ TEST_F(LeAudioHealthStatusTest, test_inactivate_group) {
ASSERT_TRUE(group_id_in_callback == group_id_);
ASSERT_TRUE(recommendation_in_callback ==
LeAudioHealthBasedAction::INACTIVATE_GROUP);
-} \ No newline at end of file
+}
diff --git a/system/bta/le_audio/le_audio_log_history.cc b/system/bta/le_audio/le_audio_log_history.cc
index 4360ae8f47..2f18f3ab40 100644
--- a/system/bta/le_audio/le_audio_log_history.cc
+++ b/system/bta/le_audio/le_audio_log_history.cc
@@ -16,7 +16,6 @@
#include "le_audio_log_history.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <check.h>
diff --git a/system/bta/le_audio/le_audio_set_configuration_provider_json.cc b/system/bta/le_audio/le_audio_set_configuration_provider_json.cc
index bf44721c88..ea3a70b94d 100644
--- a/system/bta/le_audio/le_audio_set_configuration_provider_json.cc
+++ b/system/bta/le_audio/le_audio_set_configuration_provider_json.cc
@@ -15,7 +15,6 @@
*
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <mutex>
diff --git a/system/bta/le_audio/le_audio_types.cc b/system/bta/le_audio/le_audio_types.cc
index 4a992e0046..6ceab68396 100644
--- a/system/bta/le_audio/le_audio_types.cc
+++ b/system/bta/le_audio/le_audio_types.cc
@@ -22,7 +22,6 @@
#include "le_audio_types.h"
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
diff --git a/system/bta/le_audio/metrics_collector.cc b/system/bta/le_audio/metrics_collector.cc
index 9b07e826b5..3b0c92ddc6 100644
--- a/system/bta/le_audio/metrics_collector.cc
+++ b/system/bta/le_audio/metrics_collector.cc
@@ -16,7 +16,6 @@
#include "metrics_collector.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <memory>
diff --git a/system/bta/le_audio/mock_state_machine.cc b/system/bta/le_audio/mock_state_machine.cc
index 2df36818c1..feafcd3c86 100644
--- a/system/bta/le_audio/mock_state_machine.cc
+++ b/system/bta/le_audio/mock_state_machine.cc
@@ -17,8 +17,6 @@
#include "mock_state_machine.h"
-#include <base/logging.h>
-
static MockLeAudioGroupStateMachine* mock_machine = nullptr;
void bluetooth::le_audio::LeAudioGroupStateMachine::Initialize(
diff --git a/system/bta/le_audio/state_machine.cc b/system/bta/le_audio/state_machine.cc
index 31a9da151e..13661df2cd 100644
--- a/system/bta/le_audio/state_machine.cc
+++ b/system/bta/le_audio/state_machine.cc
@@ -1700,8 +1700,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
BTM_GetHCIConnHandle(leAudioDevice->address_, BT_TRANSPORT_LE);
conn_pairs.push_back({.cis_conn_handle = ase->cis_conn_hdl,
.acl_conn_handle = acl_handle});
- DLOG(INFO) << __func__ << " cis handle: " << +ase->cis_conn_hdl
- << " acl handle : " << loghex(+acl_handle);
+ log::debug("cis handle: {} acl handle : {}", ase->cis_conn_hdl,
+ loghex(+acl_handle));
} while ((ase = leAudioDevice->GetNextActiveAse(ase)));
} while ((leAudioDevice = group->GetNextActiveDevice(leAudioDevice)));
@@ -3108,8 +3108,8 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
ase->data_path_state == DataPathState::IDLE) {
DisconnectCisIfNeeded(group, leAudioDevice, ase);
} else {
- DLOG(INFO) << __func__ << ", Nothing to do ase data path state: "
- << static_cast<int>(ase->data_path_state);
+ log::debug("Nothing to do ase data path state: {}",
+ static_cast<int>(ase->data_path_state));
}
break;
}
diff --git a/system/bta/le_audio/state_machine_test.cc b/system/bta/le_audio/state_machine_test.cc
index 3c73042664..8f38d44052 100644
--- a/system/bta/le_audio/state_machine_test.cc
+++ b/system/bta/le_audio/state_machine_test.cc
@@ -396,7 +396,7 @@ class StateMachineTestBase : public Test {
.WillByDefault(
[this](uint8_t cig_id,
bluetooth::hci::iso_manager::cig_create_params p) {
- DLOG(INFO) << "CreateCig";
+ log::debug("CreateCig");
auto& group = le_audio_device_groups_[cig_id];
if (group) {
@@ -418,7 +418,7 @@ class StateMachineTestBase : public Test {
ON_CALL(*mock_iso_manager_, RemoveCig)
.WillByDefault([this](uint8_t cig_id, bool force) {
- DLOG(INFO) << "CreateRemove";
+ log::debug("CreateRemove");
auto& group = le_audio_device_groups_[cig_id];
if (group) {
@@ -432,7 +432,7 @@ class StateMachineTestBase : public Test {
.WillByDefault([this](uint16_t conn_handle,
bluetooth::hci::iso_manager::iso_data_path_params
p) {
- DLOG(INFO) << "SetupIsoDataPath";
+ log::debug("SetupIsoDataPath");
auto dev_it =
std::find_if(le_audio_devices_.begin(), le_audio_devices_.end(),
@@ -441,7 +441,7 @@ class StateMachineTestBase : public Test {
return (ases.sink || ases.source);
});
if (dev_it == le_audio_devices_.end()) {
- DLOG(ERROR) << "Device not found";
+ log::error("Device not found");
return;
}
@@ -457,7 +457,7 @@ class StateMachineTestBase : public Test {
ON_CALL(*mock_iso_manager_, RemoveIsoDataPath)
.WillByDefault([this](uint16_t conn_handle, uint8_t iso_direction) {
- DLOG(INFO) << "RemoveIsoDataPath";
+ log::debug("RemoveIsoDataPath");
auto dev_it =
std::find_if(le_audio_devices_.begin(), le_audio_devices_.end(),
@@ -466,7 +466,7 @@ class StateMachineTestBase : public Test {
return (ases.sink || ases.source);
});
if (dev_it == le_audio_devices_.end()) {
- DLOG(ERROR) << "Device not found";
+ log::error("Device not found");
return;
}
@@ -483,10 +483,10 @@ class StateMachineTestBase : public Test {
ON_CALL(*mock_iso_manager_, EstablishCis)
.WillByDefault([this](bluetooth::hci::iso_manager::cis_establish_params
conn_params) {
- DLOG(INFO) << "EstablishCis";
+ log::debug("EstablishCis");
if (do_not_send_cis_establish_event_) {
- DLOG(INFO) << "Don't send cis establish event";
+ log::debug("Don't send cis establish event");
return;
}
@@ -498,7 +498,7 @@ class StateMachineTestBase : public Test {
return (ases.sink || ases.source);
});
if (dev_it == le_audio_devices_.end()) {
- DLOG(ERROR) << "Device not found";
+ log::error("Device not found");
return;
}
@@ -552,7 +552,7 @@ class StateMachineTestBase : public Test {
ON_CALL(*mock_iso_manager_, DisconnectCis)
.WillByDefault([this](uint16_t cis_handle, uint8_t reason) {
- DLOG(INFO) << "DisconnectCis";
+ log::debug("DisconnectCis");
auto dev_it =
std::find_if(le_audio_devices_.begin(), le_audio_devices_.end(),
@@ -561,7 +561,7 @@ class StateMachineTestBase : public Test {
return (ases.sink || ases.source);
});
if (dev_it == le_audio_devices_.end()) {
- DLOG(ERROR) << "Device not found";
+ log::error("Device not found");
return;
}
diff --git a/system/bta/le_audio/storage_helper_test.cc b/system/bta/le_audio/storage_helper_test.cc
index b7084b2340..e24750e243 100644
--- a/system/bta/le_audio/storage_helper_test.cc
+++ b/system/bta/le_audio/storage_helper_test.cc
@@ -24,7 +24,7 @@ using bluetooth::le_audio::LeAudioDevice;
namespace bluetooth::le_audio {
RawAddress GetTestAddress(uint8_t index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {{0xC0, 0xDE, 0xC0, 0xDE, 0x00, index}};
return result;
}
@@ -309,4 +309,4 @@ TEST(StorageHelperTest, DeserializeHandles) {
ASSERT_FALSE(DeserializeHandles(&leAudioDevice, invalidHandlesMagic));
ASSERT_FALSE(DeserializeHandles(&leAudioDevice, invalidHandles));
}
-} // namespace bluetooth::le_audio \ No newline at end of file
+} // namespace bluetooth::le_audio
diff --git a/system/bta/sys/bta_sys_main.cc b/system/bta/sys/bta_sys_main.cc
index e17b988cf6..ae0279d176 100644
--- a/system/bta/sys/bta_sys_main.cc
+++ b/system/bta/sys/bta_sys_main.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "bt_bta_sys_main"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstring>
diff --git a/system/bta/test/bta_hf_client_add_record_test.cc b/system/bta/test/bta_hf_client_add_record_test.cc
index 5af46688ac..0e3f75b6d1 100644
--- a/system/bta/test/bta_hf_client_add_record_test.cc
+++ b/system/bta/test/bta_hf_client_add_record_test.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <gtest/gtest.h>
#include <memory>
diff --git a/system/bta/test/common/mock_csis_client.cc b/system/bta/test/common/mock_csis_client.cc
index 867372f8e5..3ba83c8aae 100644
--- a/system/bta/test/common/mock_csis_client.cc
+++ b/system/bta/test/common/mock_csis_client.cc
@@ -17,8 +17,6 @@
#include "mock_csis_client.h"
-#include <base/logging.h>
-
static MockCsisClient* mock_csis_client;
void MockCsisClient::SetMockInstanceForTesting(MockCsisClient* mock) {
diff --git a/system/bta/test/common/mock_device_groups.cc b/system/bta/test/common/mock_device_groups.cc
index 4ecf04bcd9..b435708699 100644
--- a/system/bta/test/common/mock_device_groups.cc
+++ b/system/bta/test/common/mock_device_groups.cc
@@ -17,8 +17,6 @@
#include "mock_device_groups.h"
-#include <base/logging.h>
-
static MockDeviceGroups* mock_groups = nullptr;
void MockDeviceGroups::SetMockInstanceForTesting(MockDeviceGroups* groups) {
diff --git a/system/bta/test/gatt/database_builder_sample_device_test.cc b/system/bta/test/gatt/database_builder_sample_device_test.cc
index c8ff031bdc..8c9bf83f81 100644
--- a/system/bta/test/gatt/database_builder_sample_device_test.cc
+++ b/system/bta/test/gatt/database_builder_sample_device_test.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <gtest/gtest.h>
#include <iterator>
diff --git a/system/bta/test/gatt/database_builder_test.cc b/system/bta/test/gatt/database_builder_test.cc
index 05ec747af4..660ebda271 100644
--- a/system/bta/test/gatt/database_builder_test.cc
+++ b/system/bta/test/gatt/database_builder_test.cc
@@ -18,7 +18,6 @@
#include "gatt/database_builder.h"
-#include <base/logging.h>
#include <gtest/gtest.h>
#include <iterator>
diff --git a/system/bta/test/gatt/database_test.cc b/system/bta/test/gatt/database_test.cc
index 7b0adeff3c..09d7d9b9aa 100644
--- a/system/bta/test/gatt/database_test.cc
+++ b/system/bta/test/gatt/database_test.cc
@@ -18,7 +18,6 @@
#include "gatt/database.h"
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
#include <gtest/gtest.h>
diff --git a/system/bta/vc/device.cc b/system/bta/vc/device.cc
index b9d47b91e3..c42a1ce8a8 100644
--- a/system/bta/vc/device.cc
+++ b/system/bta/vc/device.cc
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <map>
diff --git a/system/bta/vc/devices_test.cc b/system/bta/vc/devices_test.cc
index aa2ab5cd7b..287b83bb42 100644
--- a/system/bta/vc/devices_test.cc
+++ b/system/bta/vc/devices_test.cc
@@ -43,7 +43,7 @@ using ::testing::SetArgPointee;
using ::testing::Test;
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/bta/vc/vc.cc b/system/bta/vc/vc.cc
index 95c9c66f22..d871c85bf3 100644
--- a/system/bta/vc/vc.cc
+++ b/system/bta/vc/vc.cc
@@ -16,7 +16,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <base/strings/string_util.h>
#include <bluetooth/log.h>
diff --git a/system/bta/vc/vc_test.cc b/system/bta/vc/vc_test.cc
index 3986ea5b4f..5af10ddb38 100644
--- a/system/bta/vc/vc_test.cc
+++ b/system/bta/vc/vc_test.cc
@@ -57,7 +57,7 @@ using testing::SetArgPointee;
using testing::WithArg;
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xC0, 0xDE, 0xC0, 0xDE, 0x00, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/btcore/src/device_class.cc b/system/btcore/src/device_class.cc
index 94c72029bc..c354feb951 100644
--- a/system/btcore/src/device_class.cc
+++ b/system/btcore/src/device_class.cc
@@ -19,7 +19,6 @@
#include "btcore/include/device_class.h"
#include <arpa/inet.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <endian.h>
#include <string.h>
diff --git a/system/btcore/src/hal_util.cc b/system/btcore/src/hal_util.cc
index 18c069930b..5c32ed6208 100644
--- a/system/btcore/src/hal_util.cc
+++ b/system/btcore/src/hal_util.cc
@@ -18,7 +18,6 @@
#include "btcore/include/hal_util.h"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <dlfcn.h>
#include <hardware/bluetooth.h>
diff --git a/system/btcore/src/module.cc b/system/btcore/src/module.cc
index 099ebd9747..4afd3b11b7 100644
--- a/system/btcore/src/module.cc
+++ b/system/btcore/src/module.cc
@@ -20,7 +20,6 @@
#include "btcore/include/module.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <dlfcn.h>
#include <string.h>
diff --git a/system/btcore/src/property.cc b/system/btcore/src/property.cc
index 7680a4ac5f..3bf8b998e3 100644
--- a/system/btcore/src/property.cc
+++ b/system/btcore/src/property.cc
@@ -18,7 +18,6 @@
#include "btcore/include/property.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/btif/avrcp/avrcp_service.cc b/system/btif/avrcp/avrcp_service.cc
index 50ae619291..d3b03da4ad 100644
--- a/system/btif/avrcp/avrcp_service.cc
+++ b/system/btif/avrcp/avrcp_service.cc
@@ -17,7 +17,6 @@
#include "avrcp_service.h"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/task/cancelable_task_tracker.h>
#include <base/threading/thread.h>
#include <bluetooth/log.h>
diff --git a/system/btif/co/bta_hh_co.cc b/system/btif/co/bta_hh_co.cc
index 1804861c61..9c1b5635d5 100644
--- a/system/btif/co/bta_hh_co.cc
+++ b/system/btif/co/bta_hh_co.cc
@@ -19,7 +19,6 @@
#include "bta_hh_co.h"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <fcntl.h>
#include <linux/uhid.h>
#include <poll.h>
diff --git a/system/btif/co/bta_pan_co.cc b/system/btif/co/bta_pan_co.cc
index 5f5f2f55a5..d17f19033d 100644
--- a/system/btif/co/bta_pan_co.cc
+++ b/system/btif/co/bta_pan_co.cc
@@ -26,7 +26,6 @@
******************************************************************************/
#include "bta_pan_co.h"
-#include <base/logging.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_pan.h>
#include <string.h>
diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc
index 5bed1c9c5f..2998f22c5b 100644
--- a/system/btif/src/bluetooth.cc
+++ b/system/btif/src/bluetooth.cc
@@ -28,7 +28,6 @@
#define LOG_TAG "bt_btif"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bluetooth_headset_interface.h>
diff --git a/system/btif/src/btif_a2dp.cc b/system/btif/src/btif_a2dp.cc
index a76d317037..a489414a95 100644
--- a/system/btif/src/btif_a2dp.cc
+++ b/system/btif/src/btif_a2dp.cc
@@ -22,7 +22,6 @@
#include "btif_a2dp.h"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdbool.h>
diff --git a/system/btif/src/btif_a2dp_control.cc b/system/btif/src/btif_a2dp_control.cc
index f2764f7eb9..1ecf726327 100644
--- a/system/btif/src/btif_a2dp_control.cc
+++ b/system/btif/src/btif_a2dp_control.cc
@@ -21,7 +21,6 @@
#include "btif_a2dp_control.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdbool.h>
#include <stdint.h>
diff --git a/system/btif/src/btif_a2dp_sink.cc b/system/btif/src/btif_a2dp_sink.cc
index cf1aff091e..3f47ebc44f 100644
--- a/system/btif/src/btif_a2dp_sink.cc
+++ b/system/btif/src/btif_a2dp_sink.cc
@@ -23,7 +23,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <atomic>
diff --git a/system/btif/src/btif_a2dp_source.cc b/system/btif/src/btif_a2dp_source.cc
index cb098fa846..85a3261bda 100644
--- a/system/btif/src/btif_a2dp_source.cc
+++ b/system/btif/src/btif_a2dp_source.cc
@@ -21,7 +21,6 @@
#define ATRACE_TAG ATRACE_TAG_AUDIO
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <base/run_loop.h>
#include <bluetooth/log.h>
#ifdef __ANDROID__
diff --git a/system/btif/src/btif_avrcp_audio_track.cc b/system/btif/src/btif_avrcp_audio_track.cc
index fb176333dd..a25e693851 100644
--- a/system/btif/src/btif_avrcp_audio_track.cc
+++ b/system/btif/src/btif_avrcp_audio_track.cc
@@ -24,7 +24,6 @@
#endif
#include <aaudio/AAudio.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <utils/StrongPointer.h>
diff --git a/system/btif/src/btif_bqr.cc b/system/btif/src/btif_bqr.cc
index 0dcbe1377d..f289adec5f 100644
--- a/system/btif/src/btif_bqr.cc
+++ b/system/btif/src/btif_bqr.cc
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <fcntl.h>
#ifdef __ANDROID__
#include <statslog_bt.h>
diff --git a/system/btif/src/btif_config.cc b/system/btif/src/btif_config.cc
index 89489a225c..554478dc9c 100644
--- a/system/btif/src/btif_config.cc
+++ b/system/btif/src/btif_config.cc
@@ -20,7 +20,6 @@
#include "btif_config.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <openssl/rand.h>
#include <unistd.h>
diff --git a/system/btif/src/btif_core.cc b/system/btif/src/btif_core.cc
index 4b4a5d221e..2922203dad 100644
--- a/system/btif/src/btif_core.cc
+++ b/system/btif/src/btif_core.cc
@@ -32,7 +32,6 @@
#include <android_bluetooth_sysprop.h>
#include <base/at_exit.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/threading/platform_thread.h>
#include <bluetooth/log.h>
#include <signal.h>
diff --git a/system/btif/src/btif_csis_client.cc b/system/btif/src/btif_csis_client.cc
index 387a8c2d1f..f16be993ec 100644
--- a/system/btif/src/btif_csis_client.cc
+++ b/system/btif/src/btif_csis_client.cc
@@ -17,7 +17,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_csis.h>
diff --git a/system/btif/src/btif_dm.cc b/system/btif/src/btif_dm.cc
index 68730e20da..d5bc0fbc5d 100644
--- a/system/btif/src/btif_dm.cc
+++ b/system/btif/src/btif_dm.cc
@@ -32,7 +32,6 @@
#include <android_bluetooth_flags.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
#include <bluetooth/uuid.h>
diff --git a/system/btif/src/btif_gatt_client.cc b/system/btif/src/btif_gatt_client.cc
index 6267a19858..2ca655b275 100644
--- a/system/btif/src/btif_gatt_client.cc
+++ b/system/btif/src/btif_gatt_client.cc
@@ -28,7 +28,6 @@
#include <base/at_exit.h>
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/threading/thread.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
diff --git a/system/btif/src/btif_has_client.cc b/system/btif/src/btif_has_client.cc
index dfcb8093ce..5dbf5a3e33 100644
--- a/system/btif/src/btif_has_client.cc
+++ b/system/btif/src/btif_has_client.cc
@@ -17,7 +17,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_has.h>
diff --git a/system/btif/src/btif_hearing_aid.cc b/system/btif/src/btif_hearing_aid.cc
index d8ed4ab89f..86a6283c0a 100644
--- a/system/btif/src/btif_hearing_aid.cc
+++ b/system/btif/src/btif_hearing_aid.cc
@@ -20,7 +20,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_hearing_aid.h>
diff --git a/system/btif/src/btif_hf.cc b/system/btif/src/btif_hf.cc
index d5b177efcf..6411d92c62 100644
--- a/system/btif/src/btif_hf.cc
+++ b/system/btif/src/btif_hf.cc
@@ -30,7 +30,6 @@
#include <android_bluetooth_flags.h>
#include <android_bluetooth_sysprop.h>
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
@@ -378,8 +377,9 @@ static void btif_hf_upstreams_evt(uint16_t event, char* p_param) {
// There is an outgoing connection.
// Check the outgoing connection state and address.
- CHECK_EQ(btif_hf_cb[idx].state, BTHF_CONNECTION_STATE_CONNECTING)
- << "Control block must be in connecting state when initiating";
+ log::assert_that(
+ btif_hf_cb[idx].state == BTHF_CONNECTION_STATE_CONNECTING,
+ "Control block must be in connecting state when initiating");
log::assert_that(
!btif_hf_cb[idx].connected_bda.IsEmpty(),
"Remote device address must not be empty when initiating");
@@ -895,11 +895,9 @@ bt_status_t HeadsetInterface::Init(Callbacks* callbacks, int max_hf_clients,
} else {
btif_hf_features &= ~BTA_AG_FEAT_INBAND;
}
- CHECK_LE(max_hf_clients, BTA_AG_MAX_NUM_CLIENTS)
- << __func__
- << "Too many HF clients,"
- " maximum is "
- << BTA_AG_MAX_NUM_CLIENTS << " was given " << max_hf_clients;
+ log::assert_that(max_hf_clients <= BTA_AG_MAX_NUM_CLIENTS,
+ "Too many HF clients, maximum is {}, was given {}",
+ BTA_AG_MAX_NUM_CLIENTS, max_hf_clients);
btif_max_hf_clients = max_hf_clients;
log::verbose(
"btif_hf_features={}, max_hf_clients={}, inband_ringing_enabled={}",
diff --git a/system/btif/src/btif_hf_client.cc b/system/btif/src/btif_hf_client.cc
index b66b48b2e3..297e14d89a 100644
--- a/system/btif/src/btif_hf_client.cc
+++ b/system/btif/src/btif_hf_client.cc
@@ -46,7 +46,6 @@
#define LOG_TAG "bt_btif_hfc"
#endif
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_hf_client.h>
diff --git a/system/btif/src/btif_hh.cc b/system/btif/src/btif_hh.cc
index 6e4258d14f..8fd23d4515 100644
--- a/system/btif/src/btif_hh.cc
+++ b/system/btif/src/btif_hh.cc
@@ -30,7 +30,6 @@
#include "btif/include/btif_hh.h"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/btif/src/btif_jni_task.cc b/system/btif/src/btif_jni_task.cc
index 3389e931ca..098df2b81e 100644
--- a/system/btif/src/btif_jni_task.cc
+++ b/system/btif/src/btif_jni_task.cc
@@ -18,7 +18,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <base/threading/platform_thread.h>
#include <bluetooth/log.h>
diff --git a/system/btif/src/btif_keystore.cc b/system/btif/src/btif_keystore.cc
index 734fb3d8f8..dd6d1fa368 100644
--- a/system/btif/src/btif_keystore.cc
+++ b/system/btif/src/btif_keystore.cc
@@ -20,7 +20,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
diff --git a/system/btif/src/btif_le_audio.cc b/system/btif/src/btif_le_audio.cc
index 65760220f2..be9586edb9 100644
--- a/system/btif/src/btif_le_audio.cc
+++ b/system/btif/src/btif_le_audio.cc
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_le_audio.h>
@@ -324,11 +323,11 @@ class LeAudioClientInterfaceImpl : public LeAudioClientInterface,
}
void SetUnicastMonitorMode(uint8_t direction, bool enable) {
- DVLOG(2) << __func__ << " enable: " << enable;
+ log::verbose("enable: {}", enable);
if (!initialized || !LeAudioClient::IsLeAudioClientRunning()) {
- DVLOG(2) << __func__
- << " Unicast monitoring mode set ignored, due to already"
- " started cleanup procedure or service being not read";
+ log::verbose(
+ "Unicast monitoring mode set ignored, due to already"
+ " started cleanup procedure or service being not read");
return;
}
diff --git a/system/btif/src/btif_le_audio_broadcaster.cc b/system/btif/src/btif_le_audio_broadcaster.cc
index f4db4e13be..82efbb3d1d 100644
--- a/system/btif/src/btif_le_audio_broadcaster.cc
+++ b/system/btif/src/btif_le_audio_broadcaster.cc
@@ -16,7 +16,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_le_audio.h>
diff --git a/system/btif/src/btif_profile_queue.cc b/system/btif/src/btif_profile_queue.cc
index fada89d908..d94017f1eb 100644
--- a/system/btif/src/btif_profile_queue.cc
+++ b/system/btif/src/btif_profile_queue.cc
@@ -30,7 +30,6 @@
#include <base/functional/bind.h>
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/btif/src/btif_profile_storage.cc b/system/btif/src/btif_profile_storage.cc
index 1b1ff6688f..3b7b07a04d 100644
--- a/system/btif/src/btif_profile_storage.cc
+++ b/system/btif/src/btif_profile_storage.cc
@@ -21,7 +21,6 @@
#include <alloca.h>
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdlib.h>
#include <string.h>
diff --git a/system/btif/src/btif_rc.cc b/system/btif/src/btif_rc.cc
index 1d235fa8f7..b7e5b68d54 100644
--- a/system/btif/src/btif_rc.cc
+++ b/system/btif/src/btif_rc.cc
@@ -26,7 +26,6 @@
#include "btif_rc.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <hardware/bluetooth.h>
diff --git a/system/btif/src/btif_sock.cc b/system/btif/src/btif_sock.cc
index 3d335c5a5b..1a4bac09ce 100644
--- a/system/btif/src/btif_sock.cc
+++ b/system/btif/src/btif_sock.cc
@@ -21,7 +21,6 @@
#include "btif/include/btif_sock.h"
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_sock.h>
diff --git a/system/btif/src/btif_sock_l2cap.cc b/system/btif/src/btif_sock_l2cap.cc
index 880d16642a..b53561939e 100644
--- a/system/btif/src/btif_sock_l2cap.cc
+++ b/system/btif/src/btif_sock_l2cap.cc
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/system/btif/src/btif_storage.cc b/system/btif/src/btif_storage.cc
index 1f1af58c57..ada726c843 100644
--- a/system/btif/src/btif_storage.cc
+++ b/system/btif/src/btif_storage.cc
@@ -33,7 +33,6 @@
#include "btif_storage.h"
#include <alloca.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdlib.h>
#include <string.h>
diff --git a/system/btif/src/btif_util.cc b/system/btif/src/btif_util.cc
index bd33a70a8f..19a6e343c3 100644
--- a/system/btif/src/btif_util.cc
+++ b/system/btif/src/btif_util.cc
@@ -30,7 +30,6 @@
#include "btif_util.h"
-#include <base/logging.h>
#include <ctype.h>
#include <hardware/bt_av.h>
#include <netinet/in.h>
diff --git a/system/btif/src/btif_vc.cc b/system/btif/src/btif_vc.cc
index 3a29255e43..084f762a08 100644
--- a/system/btif/src/btif_vc.cc
+++ b/system/btif/src/btif_vc.cc
@@ -19,7 +19,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_vc.h>
diff --git a/system/btif/test/btif_hf_client_service_test.cc b/system/btif/test/btif_hf_client_service_test.cc
index 952e241156..0c5b122be5 100644
--- a/system/btif/test/btif_hf_client_service_test.cc
+++ b/system/btif/test/btif_hf_client_service_test.cc
@@ -1,5 +1,4 @@
#include <android_bluetooth_sysprop.h>
-#include <base/logging.h>
#include <gtest/gtest.h>
#include "bta_hfp_api.h"
diff --git a/system/btif/test/btif_keystore_test.cc b/system/btif/test/btif_keystore_test.cc
index 4cabbadbfa..0f525a3805 100644
--- a/system/btif/test/btif_keystore_test.cc
+++ b/system/btif/test/btif_keystore_test.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <binder/ProcessState.h>
#include <gtest/gtest.h>
#include <fstream>
diff --git a/system/common/address_obfuscator.cc b/system/common/address_obfuscator.cc
index 586658e030..7e1a6ee145 100644
--- a/system/common/address_obfuscator.cc
+++ b/system/common/address_obfuscator.cc
@@ -18,7 +18,7 @@
#include "address_obfuscator.h"
-#include <base/logging.h>
+#include <bluetooth/log.h>
#include <openssl/hmac.h>
#include <algorithm>
@@ -56,7 +56,9 @@ std::string AddressObfuscator::Obfuscate(const RawAddress& address) {
"assert failed: ::HMAC(EVP_sha256(), salt_256bit_.data(), "
"salt_256bit_.size(), address.address, address.kLength, "
"result.data(), &out_len) != nullptr");
- CHECK_EQ(out_len, static_cast<unsigned int>(kOctet32Length));
+ log::assert_that(
+ out_len == static_cast<unsigned int>(kOctet32Length),
+ "assert failed: out_len == static_cast<unsigned int>(kOctet32Length)");
return std::string(reinterpret_cast<const char*>(result.data()), out_len);
}
diff --git a/system/common/benchmark/thread_performance_benchmark.cc b/system/common/benchmark/thread_performance_benchmark.cc
index 7d2c6722e6..b79c45949f 100644
--- a/system/common/benchmark/thread_performance_benchmark.cc
+++ b/system/common/benchmark/thread_performance_benchmark.cc
@@ -15,7 +15,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/run_loop.h>
#include <base/threading/thread.h>
#include <benchmark/benchmark.h>
@@ -41,7 +40,8 @@ static std::unique_ptr<std::promise<void>> g_counter_promise = nullptr;
void pthread_callback_batch(void* context) {
auto queue = static_cast<fixed_queue_t*>(context);
- CHECK_NE(queue, nullptr);
+ bluetooth::log::assert_that(queue != nullptr,
+ "assert failed: queue != nullptr");
fixed_queue_dequeue(queue);
g_counter++;
if (g_counter >= NUM_MESSAGES_TO_SEND) {
@@ -52,13 +52,15 @@ void pthread_callback_batch(void* context) {
void callback_sequential(void* context) { g_counter_promise->set_value(); }
void callback_sequential_queue(fixed_queue_t* queue, void* context) {
- CHECK_NE(queue, nullptr);
+ bluetooth::log::assert_that(queue != nullptr,
+ "assert failed: queue != nullptr");
fixed_queue_dequeue(queue);
g_counter_promise->set_value();
}
void callback_batch(fixed_queue_t* queue, void* data) {
- CHECK_NE(queue, nullptr);
+ bluetooth::log::assert_that(queue != nullptr,
+ "assert failed: queue != nullptr");
fixed_queue_dequeue(queue);
g_counter++;
if (g_counter >= NUM_MESSAGES_TO_SEND) {
diff --git a/system/common/leaky_bonded_queue_unittest.cc b/system/common/leaky_bonded_queue_unittest.cc
index c2e6abfed7..d265b43423 100644
--- a/system/common/leaky_bonded_queue_unittest.cc
+++ b/system/common/leaky_bonded_queue_unittest.cc
@@ -17,7 +17,6 @@
******************************************************************************/
#include "common/leaky_bonded_queue.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/system/common/lru.h b/system/common/lru.h
index cfe18ef3b2..99cf40c117 100644
--- a/system/common/lru.h
+++ b/system/common/lru.h
@@ -18,7 +18,6 @@
#pragma once
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <functional>
diff --git a/system/common/lru_unittest.cc b/system/common/lru_unittest.cc
index 83f92fc1e9..34786cb3e6 100644
--- a/system/common/lru_unittest.cc
+++ b/system/common/lru_unittest.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <chrono>
diff --git a/system/common/message_loop_thread.cc b/system/common/message_loop_thread.cc
index dcfc8c5175..6d81a7b67a 100644
--- a/system/common/message_loop_thread.cc
+++ b/system/common/message_loop_thread.cc
@@ -18,7 +18,6 @@
#include <base/functional/callback.h>
#include <base/location.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
#include <bluetooth/log.h>
@@ -114,9 +113,9 @@ void MessageLoopThread::ShutDown() {
return;
}
shutting_down_ = true;
- CHECK_NE(thread_id_, base::PlatformThread::CurrentId())
- << __func__ << " should not be called on the thread itself. "
- << "Otherwise, deadlock may happen.";
+ log::assert_that(thread_id_ != base::PlatformThread::CurrentId(),
+ "should not be called on the thread itself. Otherwise, "
+ "deadlock may happen.");
run_loop_->QuitWhenIdle();
}
thread_->join();
diff --git a/system/common/metric_id_allocator.cc b/system/common/metric_id_allocator.cc
index ea4ac00614..0d2cf1cf26 100644
--- a/system/common/metric_id_allocator.cc
+++ b/system/common/metric_id_allocator.cc
@@ -18,7 +18,6 @@
#include "metric_id_allocator.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <functional>
diff --git a/system/common/metric_id_allocator_unittest.cc b/system/common/metric_id_allocator_unittest.cc
index 4104802f2e..68cc1ff8a7 100644
--- a/system/common/metric_id_allocator_unittest.cc
+++ b/system/common/metric_id_allocator_unittest.cc
@@ -18,7 +18,6 @@
#include "common/metric_id_allocator.h"
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/system/common/metrics.cc b/system/common/metrics.cc
index 9397aae1f7..251af12258 100644
--- a/system/common/metrics.cc
+++ b/system/common/metrics.cc
@@ -19,7 +19,6 @@
#include "metrics.h"
#include <base/base64.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/le/enums.pb.h>
#include <include/hardware/bt_av.h>
diff --git a/system/common/metrics_linux.cc b/system/common/metrics_linux.cc
index 707e0a54b2..59a3b0e305 100644
--- a/system/common/metrics_linux.cc
+++ b/system/common/metrics_linux.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "leaky_bonded_queue.h"
diff --git a/system/common/metrics_unittest.cc b/system/common/metrics_unittest.cc
index a46c8969f3..7db7ec812f 100644
--- a/system/common/metrics_unittest.cc
+++ b/system/common/metrics_unittest.cc
@@ -15,20 +15,19 @@
* limitations under the License.
*
******************************************************************************/
+#include "common/metrics.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+#include <include/hardware/bt_av.h>
+
#include <chrono>
#include <cstdint>
#include <string>
#include <thread>
#include <vector>
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <base/logging.h>
-#include <include/hardware/bt_av.h>
-
#include "bluetooth/metrics/bluetooth.pb.h"
-#include "common/metrics.h"
#include "common/time_util.h"
#define BTM_COD_MAJOR_AUDIO_TEST 0x04
diff --git a/system/common/repeating_timer.cc b/system/common/repeating_timer.cc
index 39825eb3e1..841343989f 100644
--- a/system/common/repeating_timer.cc
+++ b/system/common/repeating_timer.cc
@@ -17,7 +17,6 @@
#include "repeating_timer.h"
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "message_loop_thread.h"
@@ -134,9 +133,9 @@ void RepeatingTimer::RunTask() {
log::error("message_loop_thread_ is null or is not running");
return;
}
- CHECK_EQ(message_loop_thread_->GetThreadId(),
- base::PlatformThread::CurrentId())
- << ": task must run on message loop thread";
+ log::assert_that(
+ message_loop_thread_->GetThreadId() == base::PlatformThread::CurrentId(),
+ "task must run on message loop thread");
int64_t period_us = period_.count();
expected_time_next_task_us_ += period_us;
diff --git a/system/common/repeating_timer_unittest.cc b/system/common/repeating_timer_unittest.cc
index 510e2483fe..f8defb5e45 100644
--- a/system/common/repeating_timer_unittest.cc
+++ b/system/common/repeating_timer_unittest.cc
@@ -14,14 +14,15 @@
* limitations under the License.
*/
+#include "repeating_timer.h"
+
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <gtest/gtest.h>
+
#include <future>
#include "bind_helpers.h"
#include "message_loop_thread.h"
-#include "repeating_timer.h"
using bluetooth::common::MessageLoopThread;
using bluetooth::common::RepeatingTimer;
diff --git a/system/common/state_machine.h b/system/common/state_machine.h
index db743af5c3..e040f00697 100644
--- a/system/common/state_machine.h
+++ b/system/common/state_machine.h
@@ -16,7 +16,6 @@
#pragma once
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <map>
diff --git a/system/common/stop_watch_legacy.cc b/system/common/stop_watch_legacy.cc
index eb0a05e0d1..de2a8bfdef 100644
--- a/system/common/stop_watch_legacy.cc
+++ b/system/common/stop_watch_legacy.cc
@@ -18,7 +18,6 @@
#include "common/stop_watch_legacy.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <iomanip>
diff --git a/system/common/test/thread_performance_test.cc b/system/common/test/thread_performance_test.cc
index 7b573064aa..af2d1fcebe 100644
--- a/system/common/test/thread_performance_test.cc
+++ b/system/common/test/thread_performance_test.cc
@@ -15,7 +15,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/run_loop.h>
#include <base/threading/thread.h>
#include <bluetooth/log.h>
diff --git a/system/device/src/device_iot_config.cc b/system/device/src/device_iot_config.cc
index 894c76a76c..d0afe10c15 100644
--- a/system/device/src/device_iot_config.cc
+++ b/system/device/src/device_iot_config.cc
@@ -20,7 +20,6 @@
#include "device/include/device_iot_config.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <ctype.h>
#include <stdio.h>
diff --git a/system/device/src/device_iot_config_int.cc b/system/device/src/device_iot_config_int.cc
index f88d447be2..73cb54da55 100644
--- a/system/device/src/device_iot_config_int.cc
+++ b/system/device/src/device_iot_config_int.cc
@@ -20,7 +20,6 @@
#define LOG_TAG "device_iot_config"
#include "device_iot_config_int.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdio.h>
#include <string.h>
diff --git a/system/device/src/interop.cc b/system/device/src/interop.cc
index 917c06a19e..f1f3692bef 100644
--- a/system/device/src/interop.cc
+++ b/system/device/src/interop.cc
@@ -22,7 +22,6 @@
#include "device/include/interop.h"
#include <assert.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <ctype.h>
#include <fcntl.h>
diff --git a/system/gd/hal/hci_hal_android_hidl.cc b/system/gd/hal/hci_hal_android_hidl.cc
index 6119f2dcf0..c109d1e7aa 100644
--- a/system/gd/hal/hci_hal_android_hidl.cc
+++ b/system/gd/hal/hci_hal_android_hidl.cc
@@ -116,7 +116,7 @@ class InternalHciCallbacks : public IBluetoothHciCallbacks_1_1 {
Return<void> initializationComplete(HidlStatus status) {
common::StopWatch stop_watch(__func__);
log::info("initialization complete with status: {}", status);
- CHECK_EQ(status, HidlStatus::SUCCESS);
+ log::assert_that(status == HidlStatus::SUCCESS, "assert failed: status == HidlStatus::SUCCESS");
init_promise_->set_value();
return Void();
}
diff --git a/system/gd/hal/snoop_logger_socket.cc b/system/gd/hal/snoop_logger_socket.cc
index 80c19c6fd9..c3a912ebaa 100644
--- a/system/gd/hal/snoop_logger_socket.cc
+++ b/system/gd/hal/snoop_logger_socket.cc
@@ -19,7 +19,6 @@
#include "hal/snoop_logger_socket.h"
#include <arpa/inet.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <netinet/in.h>
diff --git a/system/gd/hal/snoop_logger_socket_thread.cc b/system/gd/hal/snoop_logger_socket_thread.cc
index 3c035708f1..472397589e 100644
--- a/system/gd/hal/snoop_logger_socket_thread.cc
+++ b/system/gd/hal/snoop_logger_socket_thread.cc
@@ -19,7 +19,6 @@
#include "hal/snoop_logger_socket_thread.h"
#include <arpa/inet.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <netinet/in.h>
diff --git a/system/gd/security/pairing_handler_le_legacy.cc b/system/gd/security/pairing_handler_le_legacy.cc
index f94d3f1894..affc5f9121 100644
--- a/system/gd/security/pairing_handler_le_legacy.cc
+++ b/system/gd/security/pairing_handler_le_legacy.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "hci/octets.h"
diff --git a/system/gd/security/pairing_handler_le_secure_connections.cc b/system/gd/security/pairing_handler_le_secure_connections.cc
index b66cf624c1..45455f5a45 100644
--- a/system/gd/security/pairing_handler_le_secure_connections.cc
+++ b/system/gd/security/pairing_handler_le_secure_connections.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "crypto_toolbox/crypto_toolbox.h"
diff --git a/system/hci/src/buffer_allocator.cc b/system/hci/src/buffer_allocator.cc
index 8271622c28..5ede1c0746 100644
--- a/system/hci/src/buffer_allocator.cc
+++ b/system/hci/src/buffer_allocator.cc
@@ -18,7 +18,6 @@
#include "hci/include/buffer_allocator.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "include/check.h"
diff --git a/system/hci/src/packet_fragmenter.cc b/system/hci/src/packet_fragmenter.cc
index ef33191c3c..cbe3f09ccc 100644
--- a/system/hci/src/packet_fragmenter.cc
+++ b/system/hci/src/packet_fragmenter.cc
@@ -20,7 +20,6 @@
#include "packet_fragmenter.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/include/check.h b/system/include/check.h
index 1bc3f5b20e..6c7cdbf795 100644
--- a/system/include/check.h
+++ b/system/include/check.h
@@ -19,7 +19,5 @@
// After 822064, this was moved into base/check.h and base/check_op.h
#if defined(BASE_VER) && BASE_VER >= 822064
#include <base/check.h> // CHECK/DCHECK
-#include <base/check_op.h> // CHECK_LE/DCHECK_LE/CHECK/_GT, etc
-#else
-#include <base/logging.h>
+#include <base/check_op.h> // CHECK_LE/DCHECK_LE/CHECK/_GT, etc
#endif
diff --git a/system/include/notreached.h b/system/include/notreached.h
index 1bc849776e..52b87524dc 100644
--- a/system/include/notreached.h
+++ b/system/include/notreached.h
@@ -19,6 +19,4 @@
// After 822064, this was moved into base/notreached.h
#if defined(BASE_VER) && BASE_VER >= 822064
#include <base/notreached.h>
-#else
-#include <base/logging.h>
#endif
diff --git a/system/main/shim/btm.cc b/system/main/shim/btm.cc
index 6c33bea129..f6926b357e 100644
--- a/system/main/shim/btm.cc
+++ b/system/main/shim/btm.cc
@@ -18,7 +18,6 @@
#include "main/shim/btm.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <chrono>
diff --git a/system/main/shim/btm_api.cc b/system/main/shim/btm_api.cc
index 074b41a261..5dde4b0546 100644
--- a/system/main/shim/btm_api.cc
+++ b/system/main/shim/btm_api.cc
@@ -19,7 +19,6 @@
#include "main/shim/btm_api.h"
#include <base/functional/callback.h>
-#include <base/logging.h>
#include "hci/controller.h"
#include "hci/controller_interface.h"
diff --git a/system/main/shim/le_advertising_manager.cc b/system/main/shim/le_advertising_manager.cc
index 07ff568344..2972725804 100644
--- a/system/main/shim/le_advertising_manager.cc
+++ b/system/main/shim/le_advertising_manager.cc
@@ -18,7 +18,6 @@
#include "le_advertising_manager.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_gatt.h>
diff --git a/system/main/shim/le_scanning_manager.cc b/system/main/shim/le_scanning_manager.cc
index 3874bddcbb..c023c6f625 100644
--- a/system/main/shim/le_scanning_manager.cc
+++ b/system/main/shim/le_scanning_manager.cc
@@ -19,7 +19,6 @@
#include "le_scanning_manager.h"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/threading/thread.h>
#include <bluetooth/log.h>
#include <hardware/bluetooth.h>
diff --git a/system/main/stack_config.cc b/system/main/stack_config.cc
index 20d041cdfe..6fe4dd10ff 100644
--- a/system/main/stack_config.cc
+++ b/system/main/stack_config.cc
@@ -20,7 +20,6 @@
#include "internal_include/stack_config.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "include/check.h"
diff --git a/system/osi/include/stack_power_telemetry.h b/system/osi/include/stack_power_telemetry.h
index 2936797c26..1626d6d45e 100644
--- a/system/osi/include/stack_power_telemetry.h
+++ b/system/osi/include/stack_power_telemetry.h
@@ -16,8 +16,6 @@
#pragma once
-#include <base/logging.h>
-
#include <cstdint>
#include <memory>
diff --git a/system/osi/src/alarm.cc b/system/osi/src/alarm.cc
index 7b17e0574d..68e7c3cb9b 100644
--- a/system/osi/src/alarm.cc
+++ b/system/osi/src/alarm.cc
@@ -21,7 +21,6 @@
#include "osi/include/alarm.h"
#include <base/cancelable_callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <hardware/bluetooth.h>
diff --git a/system/osi/src/allocator.cc b/system/osi/src/allocator.cc
index c3a76b3014..1ffd7dcbc0 100644
--- a/system/osi/src/allocator.cc
+++ b/system/osi/src/allocator.cc
@@ -17,7 +17,6 @@
******************************************************************************/
#include "osi/include/allocator.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdlib.h>
#include <string.h>
diff --git a/system/osi/src/config.cc b/system/osi/src/config.cc
index 6b2f05e5d5..3ade2f56a8 100644
--- a/system/osi/src/config.cc
+++ b/system/osi/src/config.cc
@@ -19,7 +19,6 @@
#include "osi/include/config.h"
#include <base/files/file_util.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <ctype.h>
#include <fcntl.h>
diff --git a/system/osi/src/fixed_queue.cc b/system/osi/src/fixed_queue.cc
index 0faadaa12c..f2c8efdca4 100644
--- a/system/osi/src/fixed_queue.cc
+++ b/system/osi/src/fixed_queue.cc
@@ -18,7 +18,6 @@
#include "osi/include/fixed_queue.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/osi/src/future.cc b/system/osi/src/future.cc
index 4741143b5d..4d4b91a7ae 100644
--- a/system/osi/src/future.cc
+++ b/system/osi/src/future.cc
@@ -20,7 +20,6 @@
#include "osi/include/future.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "check.h"
diff --git a/system/osi/src/internal/semaphore.cc b/system/osi/src/internal/semaphore.cc
index b549ea7966..06ef9a51af 100644
--- a/system/osi/src/internal/semaphore.cc
+++ b/system/osi/src/internal/semaphore.cc
@@ -20,7 +20,6 @@
#include "osi/semaphore.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <malloc.h>
diff --git a/system/osi/src/list.cc b/system/osi/src/list.cc
index 1bf8df2e24..2771c27637 100644
--- a/system/osi/src/list.cc
+++ b/system/osi/src/list.cc
@@ -1,6 +1,5 @@
#include "osi/include/list.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "check.h"
diff --git a/system/osi/src/osi.cc b/system/osi/src/osi.cc
index c59c2d995e..fdc42b8f39 100644
--- a/system/osi/src/osi.cc
+++ b/system/osi/src/osi.cc
@@ -20,7 +20,6 @@
#include "osi/include/osi.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <fcntl.h>
#include <stdio.h>
diff --git a/system/osi/src/reactor.cc b/system/osi/src/reactor.cc
index 21179df426..69648b5043 100644
--- a/system/osi/src/reactor.cc
+++ b/system/osi/src/reactor.cc
@@ -20,7 +20,6 @@
#include "osi/include/reactor.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <pthread.h>
#include <stdlib.h>
diff --git a/system/osi/src/ringbuffer.cc b/system/osi/src/ringbuffer.cc
index a3d54bb403..7c6f8c4f6a 100644
--- a/system/osi/src/ringbuffer.cc
+++ b/system/osi/src/ringbuffer.cc
@@ -18,7 +18,6 @@
#include "osi/include/ringbuffer.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdlib.h>
diff --git a/system/osi/src/socket.cc b/system/osi/src/socket.cc
index 38ffd9e1e7..4cefead604 100644
--- a/system/osi/src/socket.cc
+++ b/system/osi/src/socket.cc
@@ -21,7 +21,6 @@
#include "osi/include/socket.h"
#include <asm/ioctls.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <netinet/in.h>
#include <string.h>
diff --git a/system/osi/src/stack_power_telemetry.cc b/system/osi/src/stack_power_telemetry.cc
index ed02b9e7ad..50d18721a9 100644
--- a/system/osi/src/stack_power_telemetry.cc
+++ b/system/osi/src/stack_power_telemetry.cc
@@ -19,7 +19,6 @@
#include "osi/include/stack_power_telemetry.h"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <sys/stat.h>
#include <time.h>
diff --git a/system/osi/src/thread.cc b/system/osi/src/thread.cc
index 778f6722ec..bda82b41a4 100644
--- a/system/osi/src/thread.cc
+++ b/system/osi/src/thread.cc
@@ -20,7 +20,6 @@
#include "osi/include/thread.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <malloc.h>
#include <pthread.h>
diff --git a/system/packet/Android.bp b/system/packet/Android.bp
index 1e3f9c44b9..b5257108d2 100644
--- a/system/packet/Android.bp
+++ b/system/packet/Android.bp
@@ -18,6 +18,7 @@ cc_library_static {
static_libs: [
"lib-bt-packets-avrcp",
"lib-bt-packets-base",
+ "libbluetooth_log",
],
apex_available: [
"com.android.btservices",
diff --git a/system/packet/avrcp/avrcp_browse_packet.cc b/system/packet/avrcp/avrcp_browse_packet.cc
index fedd52a3aa..14fdff4c5b 100644
--- a/system/packet/avrcp/avrcp_browse_packet.cc
+++ b/system/packet/avrcp/avrcp_browse_packet.cc
@@ -16,8 +16,6 @@
#include "avrcp_browse_packet.h"
-#include <base/logging.h>
-
#include "internal_include/bt_trace.h"
namespace bluetooth {
diff --git a/system/packet/avrcp/avrcp_browse_packet.h b/system/packet/avrcp/avrcp_browse_packet.h
index f6bd72e225..113b0e9f34 100644
--- a/system/packet/avrcp/avrcp_browse_packet.h
+++ b/system/packet/avrcp/avrcp_browse_packet.h
@@ -16,7 +16,6 @@
#pragma once
-#include <base/logging.h>
#include <iostream>
#include "hardware/avrcp/avrcp_common.h"
diff --git a/system/packet/avrcp/avrcp_packet.cc b/system/packet/avrcp/avrcp_packet.cc
index 635759ae4f..10526e07bd 100644
--- a/system/packet/avrcp/avrcp_packet.cc
+++ b/system/packet/avrcp/avrcp_packet.cc
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <iomanip>
#include <sstream>
#include <type_traits>
diff --git a/system/packet/avrcp/avrcp_packet.h b/system/packet/avrcp/avrcp_packet.h
index 7a44dc57bb..8dd0099a8c 100644
--- a/system/packet/avrcp/avrcp_packet.h
+++ b/system/packet/avrcp/avrcp_packet.h
@@ -16,7 +16,6 @@
#pragma once
-#include <base/logging.h>
#include <iostream>
#include "hardware/avrcp/avrcp_common.h"
diff --git a/system/packet/avrcp/capabilities_packet.cc b/system/packet/avrcp/capabilities_packet.cc
index 6c5c675655..92cad14739 100644
--- a/system/packet/avrcp/capabilities_packet.cc
+++ b/system/packet/avrcp/capabilities_packet.cc
@@ -16,6 +16,8 @@
#include "capabilities_packet.h"
+#include <bluetooth/log.h>
+
#include "internal_include/bt_trace.h"
namespace bluetooth {
@@ -96,9 +98,10 @@ GetCapabilitiesResponseBuilder::MakeEventsSupportedBuilder(Event event) {
GetCapabilitiesResponseBuilder* GetCapabilitiesResponseBuilder::AddCompanyId(
uint32_t company_id) {
- CHECK_EQ(capability_, Capability::COMPANY_ID);
- CHECK_LT(elements_.size(), size_t(0xFF))
- << __func__ << ": maximum capability count reached";
+ log::assert_that(capability_ == Capability::COMPANY_ID,
+ "assert failed: capability_ == Capability::COMPANY_ID");
+ log::assert_that(elements_.size() < size_t(0xFF),
+ "maximum capability count reached");
company_id &= 0x00FFFFFF;
elements_.insert(company_id);
@@ -108,9 +111,11 @@ GetCapabilitiesResponseBuilder* GetCapabilitiesResponseBuilder::AddCompanyId(
GetCapabilitiesResponseBuilder* GetCapabilitiesResponseBuilder::AddEvent(
Event event) {
- CHECK_EQ(capability_, Capability::EVENTS_SUPPORTED);
- CHECK_LT(elements_.size(), size_t(0xFF))
- << __func__ << ": maximum capability count reached";
+ log::assert_that(
+ capability_ == Capability::EVENTS_SUPPORTED,
+ "assert failed: capability_ == Capability::EVENTS_SUPPORTED");
+ log::assert_that(elements_.size() < size_t(0xFF),
+ "maximum capability count reached");
elements_.insert(static_cast<uint8_t>(event));
diff --git a/system/packet/avrcp/get_element_attributes_packet.cc b/system/packet/avrcp/get_element_attributes_packet.cc
index f08a698267..4e90a455c0 100644
--- a/system/packet/avrcp/get_element_attributes_packet.cc
+++ b/system/packet/avrcp/get_element_attributes_packet.cc
@@ -14,10 +14,12 @@
* limitations under the License.
*/
-#include <algorithm>
-
#include "get_element_attributes_packet.h"
+#include <bluetooth/log.h>
+
+#include <algorithm>
+
namespace bluetooth {
namespace avrcp {
@@ -92,8 +94,7 @@ GetElementAttributesResponseBuilder::MakeBuilder(size_t mtu) {
size_t GetElementAttributesResponseBuilder::AddAttributeEntry(
AttributeEntry entry) {
- CHECK_LT(entries_.size(), size_t(0xFF))
- << __func__ << ": attribute entry overflow";
+ log::assert_that(entries_.size() < size_t(0xFF), "attribute entry overflow");
size_t remaining_space = mtu_ - size();
if (entry.size() > remaining_space) {
diff --git a/system/packet/avrcp/register_notification_packet.cc b/system/packet/avrcp/register_notification_packet.cc
index 4d5a1a79b6..15f1726166 100644
--- a/system/packet/avrcp/register_notification_packet.cc
+++ b/system/packet/avrcp/register_notification_packet.cc
@@ -16,7 +16,6 @@
#include "register_notification_packet.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "include/check.h"
diff --git a/system/packet/avrcp/vendor_packet.cc b/system/packet/avrcp/vendor_packet.cc
index 83ccd1fdc5..d4f924d168 100644
--- a/system/packet/avrcp/vendor_packet.cc
+++ b/system/packet/avrcp/vendor_packet.cc
@@ -16,6 +16,8 @@
#include "vendor_packet.h"
+#include <bluetooth/log.h>
+
#include "internal_include/bt_trace.h"
namespace bluetooth {
@@ -26,8 +28,8 @@ std::unique_ptr<VendorPacketBuilder> VendorPacketBuilder::MakeBuilder(
std::unique_ptr<::bluetooth::PacketBuilder> payload) {
// If the payload size is greater than max uint16_t
// the packet should be fragmented
- CHECK_LE(payload->size(), size_t(0xFFFF))
- << __func__ << ": payload size bigger than uint16_t";
+ log::assert_that(payload->size() <= size_t(0xFFFF),
+ "payload size bigger than uint16_t");
std::unique_ptr<VendorPacketBuilder> builder(
new VendorPacketBuilder(ctype, pdu, packet_type));
@@ -48,8 +50,8 @@ bool VendorPacketBuilder::Serialize(
PacketBuilder::PushHeader(pkt);
// Push the avrcp vendor command headers
- CHECK_LT(payload_->size(), size_t(0xFFFF))
- << __func__ << ": payload size bigger than uint16_t";
+ log::assert_that(payload_->size() < size_t(0xFFFF),
+ "payload size bigger than uint16_t");
PushHeader(pkt, payload_->size());
// Push the payload for the packet
diff --git a/system/packet/base/Android.bp b/system/packet/base/Android.bp
index cb255c28b1..732d597c34 100644
--- a/system/packet/base/Android.bp
+++ b/system/packet/base/Android.bp
@@ -22,5 +22,10 @@ cc_library_static {
"com.android.btservices",
],
min_sdk_version: "30",
- static_libs: ["libchrome"],
+ shared_libs: [
+ "libbase",
+ ],
+ static_libs: [
+ "libbluetooth_log",
+ ],
}
diff --git a/system/packet/base/iterator.cc b/system/packet/base/iterator.cc
index 58b73672f0..376e8108eb 100644
--- a/system/packet/base/iterator.cc
+++ b/system/packet/base/iterator.cc
@@ -16,7 +16,7 @@
#include "iterator.h"
-#include <base/logging.h>
+#include <bluetooth/log.h>
#include "check.h"
#include "packet.h"
@@ -27,8 +27,10 @@ Iterator::Iterator(std::shared_ptr<const Packet> packet, size_t i) {
packet_ = packet;
index_ = i;
- CHECK_GE(index_, packet->packet_start_index_);
- CHECK_LE(index_, packet->packet_end_index_);
+ log::assert_that(index_ >= packet->packet_start_index_,
+ "assert failed: index_ >= packet->packet_start_index_");
+ log::assert_that(index_ <= packet->packet_end_index_,
+ "assert failed: index_ <= packet->packet_end_index_");
}
Iterator::Iterator(const Iterator& itr) { *this = itr; }
@@ -122,9 +124,10 @@ bool Iterator::operator>=(const Iterator& itr) const {
}
uint8_t Iterator::operator*() const {
- CHECK_NE(index_, packet_->packet_end_index_);
+ log::assert_that(index_ != packet_->packet_end_index_,
+ "assert failed: index_ != packet_->packet_end_index_");
return packet_->get_at_index(index_);
}
-} // namespace bluetooth \ No newline at end of file
+} // namespace bluetooth
diff --git a/system/packet/base/packet.cc b/system/packet/base/packet.cc
index aee17e137a..ea210e37f5 100644
--- a/system/packet/base/packet.cc
+++ b/system/packet/base/packet.cc
@@ -16,7 +16,8 @@
#include "packet.h"
-#include <base/logging.h>
+#include <bluetooth/log.h>
+
#include <algorithm>
#include "check.h"
@@ -43,9 +44,11 @@ size_t Packet::get_length() const { return data_->size(); }
// Iterators use the absolute index to access data.
uint8_t Packet::get_at_index(size_t index) const {
- CHECK_GE(index, packet_start_index_);
- CHECK_LT(index, packet_end_index_);
+ log::assert_that(index >= packet_start_index_,
+ "assert failed: index >= packet_start_index_");
+ log::assert_that(index < packet_end_index_,
+ "assert failed: index < packet_end_index_");
return data_->at(index);
}
-} // namespace bluetooth \ No newline at end of file
+} // namespace bluetooth
diff --git a/system/packet/base/packet_builder.cc b/system/packet/base/packet_builder.cc
index 6ce9544da2..a78e21b9e1 100644
--- a/system/packet/base/packet_builder.cc
+++ b/system/packet/base/packet_builder.cc
@@ -16,7 +16,7 @@
#include "packet_builder.h"
-#include <base/logging.h>
+#include <bluetooth/log.h>
#include "check.h"
#include "packet.h"
@@ -30,7 +30,8 @@ void PacketBuilder::ReserveSpace(const std::shared_ptr<Packet>& pkt,
bool PacketBuilder::AddPayloadOctets(const std::shared_ptr<Packet>& pkt,
size_t octets, uint64_t value) {
- CHECK_LE(octets, sizeof(uint64_t));
+ log::assert_that(octets <= sizeof(uint64_t),
+ "assert failed: octets <= sizeof(uint64_t)");
for (size_t i = 0; i < octets; i++) {
pkt->data_->push_back(value & 0xff);
@@ -41,4 +42,4 @@ bool PacketBuilder::AddPayloadOctets(const std::shared_ptr<Packet>& pkt,
return true;
}
-} // namespace bluetooth \ No newline at end of file
+} // namespace bluetooth
diff --git a/system/packet/tests/avrcp/change_path_packet_test.cc b/system/packet/tests/avrcp/change_path_packet_test.cc
index b14d57768e..c114f6ff1a 100644
--- a/system/packet/tests/avrcp/change_path_packet_test.cc
+++ b/system/packet/tests/avrcp/change_path_packet_test.cc
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/system/packet/tests/fuzzers/change_path_req_fuzzer.cc b/system/packet/tests/fuzzers/change_path_req_fuzzer.cc
index 8ca88b2c6f..c614e2f69f 100644
--- a/system/packet/tests/fuzzers/change_path_req_fuzzer.cc
+++ b/system/packet/tests/fuzzers/change_path_req_fuzzer.cc
@@ -16,7 +16,6 @@
// Adapted from change_path_packet_test.cc
-#include <base/logging.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/system/packet/tests/fuzzers/change_path_res_fuzzer.cc b/system/packet/tests/fuzzers/change_path_res_fuzzer.cc
index 127ff07df5..804628a91d 100644
--- a/system/packet/tests/fuzzers/change_path_res_fuzzer.cc
+++ b/system/packet/tests/fuzzers/change_path_res_fuzzer.cc
@@ -16,7 +16,6 @@
// Adapted from change_path_packet_test.cc
-#include <base/logging.h>
#include <fuzzer/FuzzedDataProvider.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
diff --git a/system/stack/a2dp/a2dp_aac_decoder_linux.cc b/system/stack/a2dp/a2dp_aac_decoder_linux.cc
index bad594c57d..0526338fc2 100644
--- a/system/stack/a2dp/a2dp_aac_decoder_linux.cc
+++ b/system/stack/a2dp/a2dp_aac_decoder_linux.cc
@@ -16,8 +16,6 @@
#define LOG_TAG "a2dp_aac_decoder"
-#include <base/logging.h>
-
#include "a2dp_aac_decoder.h"
#include "stack/include/bt_hdr.h"
diff --git a/system/stack/a2dp/a2dp_ext.cc b/system/stack/a2dp/a2dp_ext.cc
index e9636e00d4..aeba4cfa7d 100644
--- a/system/stack/a2dp/a2dp_ext.cc
+++ b/system/stack/a2dp/a2dp_ext.cc
@@ -16,7 +16,6 @@
#include "a2dp_ext.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "a2dp_codec_api.h"
diff --git a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
index ced4018788..38ab19843d 100644
--- a/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
+++ b/system/stack/a2dp/a2dp_vendor_aptx_hd.cc
@@ -25,7 +25,6 @@
#include "a2dp_vendor_aptx_hd.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/a2dp/a2dp_vendor_ldac.cc b/system/stack/a2dp/a2dp_vendor_ldac.cc
index 1d3515985c..2b3b700f0a 100644
--- a/system/stack/a2dp/a2dp_vendor_ldac.cc
+++ b/system/stack/a2dp/a2dp_vendor_ldac.cc
@@ -25,7 +25,6 @@
#include "a2dp_vendor_ldac.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/a2dp/a2dp_vendor_ldac_decoder.cc b/system/stack/a2dp/a2dp_vendor_ldac_decoder.cc
index 6327ff42be..45e0b18c23 100644
--- a/system/stack/a2dp/a2dp_vendor_ldac_decoder.cc
+++ b/system/stack/a2dp/a2dp_vendor_ldac_decoder.cc
@@ -18,7 +18,6 @@
#include "a2dp_vendor_ldac_decoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <dlfcn.h>
#include <ldacBT.h>
diff --git a/system/stack/a2dp/a2dp_vendor_opus.cc b/system/stack/a2dp/a2dp_vendor_opus.cc
index cc872933a6..8d8d66a1bc 100644
--- a/system/stack/a2dp/a2dp_vendor_opus.cc
+++ b/system/stack/a2dp/a2dp_vendor_opus.cc
@@ -25,7 +25,6 @@
#include "a2dp_vendor_opus.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/a2dp/a2dp_vendor_opus_decoder.cc b/system/stack/a2dp/a2dp_vendor_opus_decoder.cc
index ad3fbe1443..5a442bcdbf 100644
--- a/system/stack/a2dp/a2dp_vendor_opus_decoder.cc
+++ b/system/stack/a2dp/a2dp_vendor_opus_decoder.cc
@@ -18,7 +18,6 @@
#include "a2dp_vendor_opus_decoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <opus.h>
diff --git a/system/stack/btm/ble_scanner_hci_interface.cc b/system/stack/btm/ble_scanner_hci_interface.cc
index addcafe7d6..c0e11f0b77 100644
--- a/system/stack/btm/ble_scanner_hci_interface.cc
+++ b/system/stack/btm/ble_scanner_hci_interface.cc
@@ -18,7 +18,6 @@
#include "ble_scanner_hci_interface.h"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "btm_api.h"
diff --git a/system/stack/btm/btm_devctl.cc b/system/stack/btm/btm_devctl.cc
index 374e245853..cfefa05343 100644
--- a/system/stack/btm/btm_devctl.cc
+++ b/system/stack/btm/btm_devctl.cc
@@ -24,7 +24,7 @@
******************************************************************************/
#define LOG_TAG "devctl"
-#include <base/logging.h>
+
#include <bluetooth/log.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/system/stack/btm/btm_inq.cc b/system/stack/btm/btm_inq.cc
index d0436fe077..d57bb63eda 100644
--- a/system/stack/btm/btm_inq.cc
+++ b/system/stack/btm/btm_inq.cc
@@ -25,7 +25,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stddef.h>
#include <stdio.h>
diff --git a/system/stack/btm/btm_sco.cc b/system/stack/btm/btm_sco.cc
index 8f5cdcfbf3..c135fff8de 100644
--- a/system/stack/btm/btm_sco.cc
+++ b/system/stack/btm/btm_sco.cc
@@ -27,7 +27,6 @@
#include "stack/btm/btm_sco.h"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/btm/hfp_lc3_decoder.cc b/system/stack/btm/hfp_lc3_decoder.cc
index fa83ceb030..264b796b83 100644
--- a/system/stack/btm/hfp_lc3_decoder.cc
+++ b/system/stack/btm/hfp_lc3_decoder.cc
@@ -18,7 +18,6 @@
#include "hfp_lc3_decoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/stack/btm/hfp_msbc_decoder.cc b/system/stack/btm/hfp_msbc_decoder.cc
index 2d4f452adf..7db1c0923d 100644
--- a/system/stack/btm/hfp_msbc_decoder.cc
+++ b/system/stack/btm/hfp_msbc_decoder.cc
@@ -18,7 +18,6 @@
#include "hfp_msbc_decoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstring>
diff --git a/system/stack/btu/main_thread.cc b/system/stack/btu/main_thread.cc
index 4da4583379..2be3a85636 100644
--- a/system/stack/btu/main_thread.cc
+++ b/system/stack/btu/main_thread.cc
@@ -21,7 +21,6 @@
#include "stack/include/main_thread.h"
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/run_loop.h>
#include <base/threading/thread.h>
#include <bluetooth/log.h>
diff --git a/system/stack/eatt/eatt_impl.h b/system/stack/eatt/eatt_impl.h
index 6318659729..efe1e2cd50 100644
--- a/system/stack/eatt/eatt_impl.h
+++ b/system/stack/eatt/eatt_impl.h
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <map>
diff --git a/system/stack/gatt/att_protocol.cc b/system/stack/gatt/att_protocol.cc
index be95f6ad82..251ac43aac 100644
--- a/system/stack/gatt/att_protocol.cc
+++ b/system/stack/gatt/att_protocol.cc
@@ -22,7 +22,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "gatt_int.h"
diff --git a/system/stack/gatt/connection_manager.cc b/system/stack/gatt/connection_manager.cc
index 2deee85e20..dc98318d7f 100644
--- a/system/stack/gatt/connection_manager.cc
+++ b/system/stack/gatt/connection_manager.cc
@@ -21,7 +21,6 @@
#include <base/functional/bind.h>
#include <base/functional/callback.h>
#include <base/location.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <map>
diff --git a/system/stack/gatt/gatt_api.cc b/system/stack/gatt/gatt_api.cc
index 887a17df46..b5bd3f1025 100644
--- a/system/stack/gatt/gatt_api.cc
+++ b/system/stack/gatt/gatt_api.cc
@@ -26,7 +26,6 @@
#include "stack/include/gatt_api.h"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
diff --git a/system/stack/gatt/gatt_attr.cc b/system/stack/gatt/gatt_attr.cc
index 526fb05257..63169bb438 100644
--- a/system/stack/gatt/gatt_attr.cc
+++ b/system/stack/gatt/gatt_attr.cc
@@ -23,7 +23,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <deque>
diff --git a/system/stack/gatt/gatt_auth.cc b/system/stack/gatt/gatt_auth.cc
index 0b2ccebd3e..828dfbf721 100644
--- a/system/stack/gatt/gatt_auth.cc
+++ b/system/stack/gatt/gatt_auth.cc
@@ -21,7 +21,7 @@
* this file contains GATT authentication handling functions
*
******************************************************************************/
-#include <base/logging.h>
+
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/gatt/gatt_cl.cc b/system/stack/gatt/gatt_cl.cc
index 8726365d53..0984a20489 100644
--- a/system/stack/gatt/gatt_cl.cc
+++ b/system/stack/gatt/gatt_cl.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "bluetooth"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/gatt/gatt_db.cc b/system/stack/gatt/gatt_db.cc
index 6817690f57..df68362e11 100644
--- a/system/stack/gatt/gatt_db.cc
+++ b/system/stack/gatt/gatt_db.cc
@@ -22,7 +22,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdio.h>
#include <string.h>
diff --git a/system/stack/gatt/gatt_main.cc b/system/stack/gatt/gatt_main.cc
index 93d9fc6628..dfa333a94f 100644
--- a/system/stack/gatt/gatt_main.cc
+++ b/system/stack/gatt/gatt_main.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "btif/include/btif_dm.h"
diff --git a/system/stack/gatt/gatt_sr.cc b/system/stack/gatt/gatt_sr.cc
index 4c37d77a8b..4bba0858a4 100644
--- a/system/stack/gatt/gatt_sr.cc
+++ b/system/stack/gatt/gatt_sr.cc
@@ -21,7 +21,7 @@
* this file contains the GATT server functions
*
******************************************************************************/
-#include <base/logging.h>
+
#include <bluetooth/log.h>
#include <string.h>
diff --git a/system/stack/gatt/gatt_sr_hash.cc b/system/stack/gatt/gatt_sr_hash.cc
index 1400379460..2610380c6d 100644
--- a/system/stack/gatt/gatt_sr_hash.cc
+++ b/system/stack/gatt/gatt_sr_hash.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <bluetooth/log.h>
diff --git a/system/stack/gatt/gatt_utils.cc b/system/stack/gatt/gatt_utils.cc
index eb88f40b54..40943edf7c 100644
--- a/system/stack/gatt/gatt_utils.cc
+++ b/system/stack/gatt/gatt_utils.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "gatt_utils"
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/hid/hidd_conn.cc b/system/stack/hid/hidd_conn.cc
index 47ffa78297..ba2822982a 100644
--- a/system/stack/hid/hidd_conn.cc
+++ b/system/stack/hid/hidd_conn.cc
@@ -24,7 +24,6 @@
******************************************************************************/
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
diff --git a/system/stack/hid/hidh_conn.cc b/system/stack/hid/hidh_conn.cc
index 261446dbf2..51f0b3faea 100644
--- a/system/stack/hid/hidh_conn.cc
+++ b/system/stack/hid/hidh_conn.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
diff --git a/system/stack/l2cap/l2c_api.cc b/system/stack/l2cap/l2c_api.cc
index df6cc9ff19..8f9277d268 100644
--- a/system/stack/l2cap/l2c_api.cc
+++ b/system/stack/l2cap/l2c_api.cc
@@ -27,7 +27,6 @@
#include "stack/include/l2c_api.h"
#include <base/location.h>
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/l2cap/l2c_ble.cc b/system/stack/l2cap/l2c_ble.cc
index 3187f39d70..57012bca41 100644
--- a/system/stack/l2cap/l2c_ble.cc
+++ b/system/stack/l2cap/l2c_ble.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "l2c_ble"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/l2cap/l2c_ble_conn_params.cc b/system/stack/l2cap/l2c_ble_conn_params.cc
index 3328e2a9db..8e04d10eb7 100644
--- a/system/stack/l2cap/l2c_ble_conn_params.cc
+++ b/system/stack/l2cap/l2c_ble_conn_params.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "l2c_ble_conn_params"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "hci/controller_interface.h"
diff --git a/system/stack/l2cap/l2c_csm.cc b/system/stack/l2cap/l2c_csm.cc
index 911f59975a..c21b69924c 100644
--- a/system/stack/l2cap/l2c_csm.cc
+++ b/system/stack/l2cap/l2c_csm.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "l2c_csm"
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
diff --git a/system/stack/l2cap/l2c_fcr.cc b/system/stack/l2cap/l2c_fcr.cc
index bbe94004dc..117b576cfb 100644
--- a/system/stack/l2cap/l2c_fcr.cc
+++ b/system/stack/l2cap/l2c_fcr.cc
@@ -23,7 +23,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/system/stack/l2cap/l2c_utils.cc b/system/stack/l2cap/l2c_utils.cc
index f3db85404f..fbe7ba8c1e 100644
--- a/system/stack/l2cap/l2c_utils.cc
+++ b/system/stack/l2cap/l2c_utils.cc
@@ -23,7 +23,6 @@
******************************************************************************/
#define LOG_TAG "l2c_utils"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <stdio.h>
#include <string.h>
diff --git a/system/stack/mmc/codec_client/codec_client.cc b/system/stack/mmc/codec_client/codec_client.cc
index 7ff627e7c5..5b18f6d300 100644
--- a/system/stack/mmc/codec_client/codec_client.cc
+++ b/system/stack/mmc/codec_client/codec_client.cc
@@ -16,7 +16,6 @@
#include "mmc/codec_client/codec_client.h"
-#include <base/logging.h>
#include <base/timer/elapsed_timer.h>
#include <bluetooth/log.h>
#include <dbus/bus.h>
diff --git a/system/stack/mmc/codec_server/a2dp_aac_mmc_encoder.cc b/system/stack/mmc/codec_server/a2dp_aac_mmc_encoder.cc
index be7f5e5b3c..8e159f7652 100644
--- a/system/stack/mmc/codec_server/a2dp_aac_mmc_encoder.cc
+++ b/system/stack/mmc/codec_server/a2dp_aac_mmc_encoder.cc
@@ -24,7 +24,6 @@ extern "C" {
#include <libavutil/samplefmt.h>
}
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "a2dp_aac.h"
diff --git a/system/stack/mmc/codec_server/hfp_lc3_mmc_decoder.cc b/system/stack/mmc/codec_server/hfp_lc3_mmc_decoder.cc
index add1d7bbef..37ae4a3794 100644
--- a/system/stack/mmc/codec_server/hfp_lc3_mmc_decoder.cc
+++ b/system/stack/mmc/codec_server/hfp_lc3_mmc_decoder.cc
@@ -16,7 +16,6 @@
#include "mmc/codec_server/hfp_lc3_mmc_decoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/stack/mmc/codec_server/hfp_lc3_mmc_encoder.cc b/system/stack/mmc/codec_server/hfp_lc3_mmc_encoder.cc
index c695f99652..6694294a2e 100644
--- a/system/stack/mmc/codec_server/hfp_lc3_mmc_encoder.cc
+++ b/system/stack/mmc/codec_server/hfp_lc3_mmc_encoder.cc
@@ -16,7 +16,6 @@
#include "mmc/codec_server/hfp_lc3_mmc_encoder.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/stack/mmc/codec_server/lc3_utils.h b/system/stack/mmc/codec_server/lc3_utils.h
index 18551b4e9f..f6eec6a062 100644
--- a/system/stack/mmc/codec_server/lc3_utils.h
+++ b/system/stack/mmc/codec_server/lc3_utils.h
@@ -17,7 +17,6 @@
#ifndef MMC_CODEC_SERVER_LC3_UTILS_H_
#define MMC_CODEC_SERVER_LC3_UTILS_H_
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <lc3.h>
diff --git a/system/stack/mmc/daemon/service.cc b/system/stack/mmc/daemon/service.cc
index ac84d37fdb..9962962bdc 100644
--- a/system/stack/mmc/daemon/service.cc
+++ b/system/stack/mmc/daemon/service.cc
@@ -18,7 +18,6 @@
#include <base/functional/bind.h>
#include <base/functional/callback_helpers.h>
-#include <base/logging.h>
#include <base/stl_util.h>
#include <base/task/single_thread_task_runner.h>
#include <base/unguessable_token.h>
diff --git a/system/stack/mmc/main.cc b/system/stack/mmc/main.cc
index 8443b2e0ca..b054c22649 100644
--- a/system/stack/mmc/main.cc
+++ b/system/stack/mmc/main.cc
@@ -18,6 +18,7 @@
#include <base/check.h>
#include <base/files/file_descriptor_watcher_posix.h>
#include <base/files/file_util.h>
+#include <base/logging.h>
#include <base/run_loop.h>
#include <base/strings/stringprintf.h>
#include <base/task/single_thread_task_executor.h>
@@ -42,8 +43,6 @@ const int kSyslogCritical = LOG_CRIT;
#undef LOG_CRIT
} // namespace
-#include <base/logging.h>
-
static bool MessageHandler(int severity, const char* file, int line,
size_t message_start, const std::string& message) {
const auto str = base::StringPrintf("%s:%d - %s", file, line,
diff --git a/system/stack/mmc/metrics/mmc_rtt_logger.cc b/system/stack/mmc/metrics/mmc_rtt_logger.cc
index b697dbbe4b..aef9cf31db 100644
--- a/system/stack/mmc/metrics/mmc_rtt_logger.cc
+++ b/system/stack/mmc/metrics/mmc_rtt_logger.cc
@@ -16,8 +16,6 @@
#include "mmc/metrics/mmc_rtt_logger.h"
-#include <base/logging.h>
-
#include <algorithm>
#include <cmath>
#include <string>
diff --git a/system/stack/pan/pan_api.cc b/system/stack/pan/pan_api.cc
index 0e6aaaad6c..4bc51cfb66 100644
--- a/system/stack/pan/pan_api.cc
+++ b/system/stack/pan/pan_api.cc
@@ -27,7 +27,6 @@
#include "stack/include/pan_api.h"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/pan/pan_utils.cc b/system/stack/pan/pan_utils.cc
index 6156d1659e..0543c76cbe 100644
--- a/system/stack/pan/pan_utils.cc
+++ b/system/stack/pan/pan_utils.cc
@@ -25,7 +25,6 @@
#define LOG_TAG "pan"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/rfcomm/port_api.cc b/system/stack/rfcomm/port_api.cc
index 32a3840336..1ca1669ee6 100644
--- a/system/stack/rfcomm/port_api.cc
+++ b/system/stack/rfcomm/port_api.cc
@@ -26,7 +26,6 @@
#include "stack/include/port_api.h"
-#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <bluetooth/log.h>
diff --git a/system/stack/rfcomm/port_rfc.cc b/system/stack/rfcomm/port_rfc.cc
index 32b12c463e..c99da81849 100644
--- a/system/stack/rfcomm/port_rfc.cc
+++ b/system/stack/rfcomm/port_rfc.cc
@@ -26,7 +26,6 @@
#define LOG_TAG "rfcomm"
#include <base/functional/callback.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
diff --git a/system/stack/rfcomm/port_utils.cc b/system/stack/rfcomm/port_utils.cc
index aaecc83f21..bf86a63a5d 100644
--- a/system/stack/rfcomm/port_utils.cc
+++ b/system/stack/rfcomm/port_utils.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "rfcomm_port_utils"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/rfcomm/rfc_l2cap_if.cc b/system/stack/rfcomm/rfc_l2cap_if.cc
index 845e7d2542..a97475c6f2 100644
--- a/system/stack/rfcomm/rfc_l2cap_if.cc
+++ b/system/stack/rfcomm/rfc_l2cap_if.cc
@@ -22,7 +22,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstddef>
diff --git a/system/stack/rfcomm/rfc_mx_fsm.cc b/system/stack/rfcomm/rfc_mx_fsm.cc
index 931f29079a..ec065a4c9b 100644
--- a/system/stack/rfcomm/rfc_mx_fsm.cc
+++ b/system/stack/rfcomm/rfc_mx_fsm.cc
@@ -23,7 +23,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/rfcomm/rfc_port_fsm.cc b/system/stack/rfcomm/rfc_port_fsm.cc
index f217990843..3672fb341d 100644
--- a/system/stack/rfcomm/rfc_port_fsm.cc
+++ b/system/stack/rfcomm/rfc_port_fsm.cc
@@ -23,7 +23,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/rfcomm/rfc_ts_frames.cc b/system/stack/rfcomm/rfc_ts_frames.cc
index e3e9a2b619..3328fe7631 100644
--- a/system/stack/rfcomm/rfc_ts_frames.cc
+++ b/system/stack/rfcomm/rfc_ts_frames.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "rfcomm"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/rfcomm/rfc_utils.cc b/system/stack/rfcomm/rfc_utils.cc
index cccce59179..11eb67af1c 100644
--- a/system/stack/rfcomm/rfc_utils.cc
+++ b/system/stack/rfcomm/rfc_utils.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "rfcomm"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <cstdint>
diff --git a/system/stack/sdp/sdp_main.cc b/system/stack/sdp/sdp_main.cc
index 1db6c606f6..c8d1fb7d5c 100644
--- a/system/stack/sdp/sdp_main.cc
+++ b/system/stack/sdp/sdp_main.cc
@@ -24,7 +24,6 @@
#define LOG_TAG "sdp"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h> // memset
diff --git a/system/stack/sdp/sdp_server.cc b/system/stack/sdp/sdp_server.cc
index 20dbb38236..f702ad6670 100644
--- a/system/stack/sdp/sdp_server.cc
+++ b/system/stack/sdp/sdp_server.cc
@@ -24,7 +24,6 @@
******************************************************************************/
#define LOG_TAG "sdp_server"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <string.h> // memcpy
diff --git a/system/stack/sdp/sdp_utils.cc b/system/stack/sdp/sdp_utils.cc
index 940a0c1f18..b54ea5038c 100644
--- a/system/stack/sdp/sdp_utils.cc
+++ b/system/stack/sdp/sdp_utils.cc
@@ -24,7 +24,6 @@
*
******************************************************************************/
#include <android_bluetooth_flags.h>
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <array>
@@ -193,7 +192,7 @@ static uint16_t sdpu_find_most_specific_service_uuid(tSDP_DISC_REC* p_rec) {
void sdpu_log_attribute_metrics(const RawAddress& bda,
tSDP_DISCOVERY_DB* p_db) {
- CHECK_NE(p_db, nullptr);
+ log::assert_that(p_db != nullptr, "assert failed: p_db != nullptr");
bool has_di_record = false;
for (tSDP_DISC_REC* p_rec = p_db->p_first_rec; p_rec != nullptr;
p_rec = p_rec->p_next_rec) {
diff --git a/system/stack/srvc/srvc_dis.cc b/system/stack/srvc/srvc_dis.cc
index 81f9c6bdb2..0701e4dadf 100644
--- a/system/stack/srvc/srvc_dis.cc
+++ b/system/stack/srvc/srvc_dis.cc
@@ -18,7 +18,6 @@
#define LOG_TAG "bt_srvc"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "gatt_api.h"
diff --git a/system/stack/srvc/srvc_eng.cc b/system/stack/srvc/srvc_eng.cc
index cc2f1cb295..2e86e762cb 100644
--- a/system/stack/srvc/srvc_eng.cc
+++ b/system/stack/srvc/srvc_eng.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "gatt_api.h"
diff --git a/system/stack/test/a2dp/a2dp_aac_unittest.cc b/system/stack/test/a2dp/a2dp_aac_unittest.cc
index 776a6bfeab..9323214ffc 100644
--- a/system/stack/test/a2dp/a2dp_aac_unittest.cc
+++ b/system/stack/test/a2dp/a2dp_aac_unittest.cc
@@ -16,7 +16,6 @@
#include "stack/include/a2dp_aac.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <gtest/gtest.h>
#include <stdio.h>
diff --git a/system/stack/test/a2dp/a2dp_opus_unittest.cc b/system/stack/test/a2dp/a2dp_opus_unittest.cc
index 305ccef676..6ca8a45689 100644
--- a/system/stack/test/a2dp/a2dp_opus_unittest.cc
+++ b/system/stack/test/a2dp/a2dp_opus_unittest.cc
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <base/logging.h>
#include <gtest/gtest.h>
#include <stdio.h>
diff --git a/system/stack/test/a2dp/a2dp_sbc_unittest.cc b/system/stack/test/a2dp/a2dp_sbc_unittest.cc
index 4ab8902306..cdd513b76a 100644
--- a/system/stack/test/a2dp/a2dp_sbc_unittest.cc
+++ b/system/stack/test/a2dp/a2dp_sbc_unittest.cc
@@ -16,7 +16,6 @@
#include "stack/include/a2dp_sbc.h"
-#include <base/logging.h>
#include <gtest/gtest.h>
#include <stdio.h>
diff --git a/system/stack/test/common/mock_l2cap_layer.cc b/system/stack/test/common/mock_l2cap_layer.cc
index 678419d503..c1fe394c17 100644
--- a/system/stack/test/common/mock_l2cap_layer.cc
+++ b/system/stack/test/common/mock_l2cap_layer.cc
@@ -17,7 +17,6 @@
******************************************************************************/
#include "mock_l2cap_layer.h"
-#include <base/logging.h>
#include <bluetooth/log.h>
#include "stack/include/bt_hdr.h"
diff --git a/system/stack/test/common/stack_test_packet_utils.cc b/system/stack/test/common/stack_test_packet_utils.cc
index e605813ebe..95afa5159c 100644
--- a/system/stack/test/common/stack_test_packet_utils.cc
+++ b/system/stack/test/common/stack_test_packet_utils.cc
@@ -18,6 +18,8 @@
#include "stack_test_packet_utils.h"
+#include <bluetooth/log.h>
+
#include "hci/include/hci_layer.h"
#include "osi/include/allocator.h"
#include "stack/include/bt_hdr.h"
@@ -77,7 +79,8 @@ BT_HDR* AllocateWrappedIncomingL2capAclPacket(
BT_HDR* AllocateWrappedOutgoingL2capAclPacket(const uint8_t* acl_packet_bytes,
size_t buffer_length) {
size_t acl_l2cap_header_size = 4 + L2CAP_PKT_OVERHEAD;
- CHECK_GE(L2CAP_MIN_OFFSET, static_cast<int>(acl_l2cap_header_size));
+ log::assert_that(L2CAP_MIN_OFFSET >= static_cast<int>(acl_l2cap_header_size),
+ "invalid acl l2cap header size");
size_t packet_size =
BT_HDR_SIZE + L2CAP_MIN_OFFSET + buffer_length - acl_l2cap_header_size;
auto packet = reinterpret_cast<BT_HDR*>(osi_malloc(packet_size));
diff --git a/system/stack/test/gatt/gatt_api_test.cc b/system/stack/test/gatt/gatt_api_test.cc
index 770c08f589..3be6b49ea6 100644
--- a/system/stack/test/gatt/gatt_api_test.cc
+++ b/system/stack/test/gatt/gatt_api_test.cc
@@ -16,7 +16,6 @@
#include "gatt_api.h"
-#include <base/logging.h>
#include <gtest/gtest.h>
#include "btm/btm_dev.h"
diff --git a/system/stack/test/rfcomm/stack_rfcomm_test.cc b/system/stack/test/rfcomm/stack_rfcomm_test.cc
index eeb7080b21..22f947ce39 100644
--- a/system/stack/test/rfcomm/stack_rfcomm_test.cc
+++ b/system/stack/test/rfcomm/stack_rfcomm_test.cc
@@ -16,7 +16,6 @@
*
******************************************************************************/
-#include <base/logging.h>
#include <bluetooth/log.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
@@ -124,7 +123,7 @@ void port_event_cback_1(uint32_t code, uint16_t port_handle) {
}
RawAddress GetTestAddress(int index) {
- CHECK_LT(index, UINT8_MAX);
+ EXPECT_LT(index, UINT8_MAX);
RawAddress result = {
{0xAA, 0x00, 0x11, 0x22, 0x33, static_cast<uint8_t>(index)}};
return result;
diff --git a/system/stack/test/rfcomm/stack_rfcomm_test_main.cc b/system/stack/test/rfcomm/stack_rfcomm_test_main.cc
index bc01657afb..936900679c 100644
--- a/system/stack/test/rfcomm/stack_rfcomm_test_main.cc
+++ b/system/stack/test/rfcomm/stack_rfcomm_test_main.cc
@@ -17,7 +17,6 @@
******************************************************************************/
#include <base/command_line.h>
-#include <base/logging.h>
#include <base/strings/string_piece.h>
#include <base/strings/string_util.h>
#include <bluetooth/log.h>
diff --git a/system/test/headless/get_options.cc b/system/test/headless/get_options.cc
index 9f5d3f0726..a9f63ea442 100644
--- a/system/test/headless/get_options.cc
+++ b/system/test/headless/get_options.cc
@@ -16,12 +16,12 @@
#include "test/headless/get_options.h"
-#include <base/logging.h>
#include <getopt.h>
#include <stdio.h>
#include <unistd.h>
#include <list>
+#include <sstream>
#include <string>
#include "include/check.h"
diff --git a/system/test/mock/mock_a2dp_codec_config.cc b/system/test/mock/mock_a2dp_codec_config.cc
index 46ad311bd8..ed49ebf089 100644
--- a/system/test/mock/mock_a2dp_codec_config.cc
+++ b/system/test/mock/mock_a2dp_codec_config.cc
@@ -19,8 +19,6 @@
* Functions generated:67
*/
-#include <base/logging.h>
-
#include <string>
#include "a2dp_codec_api.h"
diff --git a/system/test/mock/mock_bta_jv_api.cc b/system/test/mock/mock_bta_jv_api.cc
index daf614d3da..bae46bdb15 100644
--- a/system/test/mock/mock_bta_jv_api.cc
+++ b/system/test/mock/mock_bta_jv_api.cc
@@ -21,7 +21,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <cstdint>
#include <memory>
diff --git a/system/test/mock/mock_bta_vc.cc b/system/test/mock/mock_bta_vc.cc
index 05f4fa7c9c..be1acc5a4c 100644
--- a/system/test/mock/mock_bta_vc.cc
+++ b/system/test/mock/mock_bta_vc.cc
@@ -20,7 +20,6 @@
*/
#include <base/functional/bind.h>
-#include <base/logging.h>
#include <base/strings/string_number_conversions.h>
#include <hardware/bt_vc.h>
diff --git a/system/test/mock/mock_btif_profile_storage.h b/system/test/mock/mock_btif_profile_storage.h
index f738e2fbb0..2da84a9ec2 100644
--- a/system/test/mock/mock_btif_profile_storage.h
+++ b/system/test/mock/mock_btif_profile_storage.h
@@ -32,7 +32,6 @@
// for this effort. This compilation unit may compile as-is, or
// may need attention to prune from (or add to ) the inclusion set.
#include <alloca.h>
-#include <base/logging.h>
#include <stdlib.h>
#include <vector>
diff --git a/system/test/mock/mock_common_address_obfuscator.cc b/system/test/mock/mock_common_address_obfuscator.cc
index 0200877c8f..2a1c74b1b0 100644
--- a/system/test/mock/mock_common_address_obfuscator.cc
+++ b/system/test/mock/mock_common_address_obfuscator.cc
@@ -19,7 +19,6 @@
* Functions generated:4
*/
-#include <base/logging.h>
#include <openssl/hmac.h>
#include <string>
diff --git a/system/test/mock/mock_osi_allocator.h b/system/test/mock/mock_osi_allocator.h
index ef905f286b..77c876b0dd 100644
--- a/system/test/mock/mock_osi_allocator.h
+++ b/system/test/mock/mock_osi_allocator.h
@@ -24,7 +24,7 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
+
#include <stdlib.h>
#include <string.h>
diff --git a/system/test/mock/mock_osi_config.h b/system/test/mock/mock_osi_config.h
index d3b884dcd0..672dc1c49f 100644
--- a/system/test/mock/mock_osi_config.h
+++ b/system/test/mock/mock_osi_config.h
@@ -27,7 +27,6 @@
// Original included files, if any
#include <base/files/file_util.h>
-#include <base/logging.h>
#include <fcntl.h>
#include <libgen.h>
#include <stdio.h>
diff --git a/system/test/mock/mock_osi_fixed_queue.h b/system/test/mock/mock_osi_fixed_queue.h
index 5f51faec6a..e8d93ed047 100644
--- a/system/test/mock/mock_osi_fixed_queue.h
+++ b/system/test/mock/mock_osi_fixed_queue.h
@@ -24,7 +24,7 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
+
#include <string.h>
#include "osi/include/fixed_queue.h"
diff --git a/system/test/mock/mock_osi_future.h b/system/test/mock/mock_osi_future.h
index e2b89b9148..13852888fd 100644
--- a/system/test/mock/mock_osi_future.h
+++ b/system/test/mock/mock_osi_future.h
@@ -24,7 +24,7 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
+
#include <bluetooth/log.h>
#include "include/check.h"
diff --git a/system/test/mock/mock_osi_list.h b/system/test/mock/mock_osi_list.h
index 8ee1088615..05c973ba60 100644
--- a/system/test/mock/mock_osi_list.h
+++ b/system/test/mock/mock_osi_list.h
@@ -24,7 +24,6 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
#include "osi/include/allocator.h"
#include "osi/include/list.h"
diff --git a/system/test/mock/mock_osi_ringbuffer.h b/system/test/mock/mock_osi_ringbuffer.h
index 09e4f64242..11f8db34a3 100644
--- a/system/test/mock/mock_osi_ringbuffer.h
+++ b/system/test/mock/mock_osi_ringbuffer.h
@@ -25,7 +25,7 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
+
#include <stdlib.h>
#include "osi/include/ringbuffer.h"
diff --git a/system/test/mock/mock_stack_a2dp_codec_config.cc b/system/test/mock/mock_stack_a2dp_codec_config.cc
index 0d2f73e100..08d56e0efc 100644
--- a/system/test/mock/mock_stack_a2dp_codec_config.cc
+++ b/system/test/mock/mock_stack_a2dp_codec_config.cc
@@ -19,8 +19,6 @@
* Functions generated:67
*/
-#include <base/logging.h>
-
#include <string>
#include "a2dp_codec_api.h"
diff --git a/system/test/mock/mock_stack_avrc_api.cc b/system/test/mock/mock_stack_avrc_api.cc
index 94834bd1ae..c0af90bc9f 100644
--- a/system/test/mock/mock_stack_avrc_api.cc
+++ b/system/test/mock/mock_stack_avrc_api.cc
@@ -19,8 +19,6 @@
* Functions generated:14
*/
-#include <base/logging.h>
-
#include "stack/avrc/avrc_int.h"
#include "stack/include/avrc_api.h"
#include "stack/include/bt_hdr.h"
diff --git a/system/test/mock/mock_stack_avrc_bld_tg.cc b/system/test/mock/mock_stack_avrc_bld_tg.cc
index c65e0fdcd1..5ad36983cc 100644
--- a/system/test/mock/mock_stack_avrc_bld_tg.cc
+++ b/system/test/mock/mock_stack_avrc_bld_tg.cc
@@ -19,8 +19,6 @@
* Functions generated:3
*/
-#include <base/logging.h>
-
#include "avrc_api.h"
#include "avrc_defs.h"
#include "stack/include/bt_hdr.h"
diff --git a/system/test/mock/mock_stack_btm_ble_scanner.cc b/system/test/mock/mock_stack_btm_ble_scanner.cc
index 05fc25701c..5818b1e29a 100644
--- a/system/test/mock/mock_stack_btm_ble_scanner.cc
+++ b/system/test/mock/mock_stack_btm_ble_scanner.cc
@@ -16,7 +16,6 @@
#include <base/functional/bind.h>
#include <base/location.h>
-#include <base/logging.h>
#include <base/memory/weak_ptr.h>
#include <base/strings/string_number_conversions.h>
diff --git a/system/test/mock/mock_stack_btm_devctl.cc b/system/test/mock/mock_stack_btm_devctl.cc
index 374e144790..ef601bda8f 100644
--- a/system/test/mock/mock_stack_btm_devctl.cc
+++ b/system/test/mock/mock_stack_btm_devctl.cc
@@ -20,7 +20,6 @@
*/
#include "test/mock/mock_stack_btm_devctl.h"
-#include <base/logging.h>
#include <stddef.h>
#include <stdlib.h>
diff --git a/system/test/mock/mock_stack_btm_hfp_msbc_decoder.h b/system/test/mock/mock_stack_btm_hfp_msbc_decoder.h
index c9ecdf24fb..53e7d3b80a 100644
--- a/system/test/mock/mock_stack_btm_hfp_msbc_decoder.h
+++ b/system/test/mock/mock_stack_btm_hfp_msbc_decoder.h
@@ -26,7 +26,6 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
#include <cstring>
diff --git a/system/test/mock/mock_stack_btm_inq.h b/system/test/mock/mock_stack_btm_inq.h
index ac1145ac64..139fc36823 100644
--- a/system/test/mock/mock_stack_btm_inq.h
+++ b/system/test/mock/mock_stack_btm_inq.h
@@ -26,7 +26,7 @@
#include <functional>
// Original included files, if any
-#include <base/logging.h>
+
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/system/test/mock/mock_stack_gatt_api.h b/system/test/mock/mock_stack_gatt_api.h
index 51db2c8873..ea487e1b60 100644
--- a/system/test/mock/mock_stack_gatt_api.h
+++ b/system/test/mock/mock_stack_gatt_api.h
@@ -27,7 +27,7 @@
#include <string>
// Original included files, if any
-#include <base/logging.h>
+
#include <base/strings/string_number_conversions.h>
#include <stdio.h>
diff --git a/system/test/mock/mock_stack_l2cap_api.h b/system/test/mock/mock_stack_l2cap_api.h
index 06cb73dfaa..92e22e24cd 100644
--- a/system/test/mock/mock_stack_l2cap_api.h
+++ b/system/test/mock/mock_stack_l2cap_api.h
@@ -25,7 +25,7 @@
#include <vector>
// Original included files, if any
-#include <base/logging.h>
+
#include <base/strings/stringprintf.h>
#include <cstdint>
diff --git a/system/test/mock/mock_stack_rfcomm_port_api.cc b/system/test/mock/mock_stack_rfcomm_port_api.cc
index d8d025cebf..5248ad5665 100644
--- a/system/test/mock/mock_stack_rfcomm_port_api.cc
+++ b/system/test/mock/mock_stack_rfcomm_port_api.cc
@@ -19,8 +19,6 @@
* Functions generated:20
*/
-#include <base/logging.h>
-
#include "port_api.h"
#include "test/common/mock_functions.h"
#include "types/raw_address.h"