diff options
-rw-r--r-- | system/common/Android.bp | 4 | ||||
-rw-r--r-- | system/common/benchmark/thread_performance_benchmark.cc | 6 | ||||
-rw-r--r-- | system/common/message_loop_thread_unittest.cc | 4 | ||||
-rw-r--r-- | system/common/metrics_linux.cc | 159 | ||||
-rw-r--r-- | system/common/test/thread_performance_test.cc | 2 | ||||
-rw-r--r-- | system/gd/Android.bp | 1 | ||||
-rw-r--r-- | system/gd/os/fake_timer/fake_timerfd.cc | 3 |
7 files changed, 94 insertions, 85 deletions
diff --git a/system/common/Android.bp b/system/common/Android.bp index 73170b1eec..f50de9f23e 100644 --- a/system/common/Android.bp +++ b/system/common/Android.bp @@ -59,7 +59,6 @@ cc_library_static { "libbt-platform-protos-lite", "libbt_shim_bridge", ], - cflags: ["-Wno-unused-parameter"], } cc_test { @@ -118,7 +117,6 @@ cc_test { cfi: false, }, header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } cc_test { @@ -149,7 +147,6 @@ cc_test { "libosi", ], header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } cc_benchmark { @@ -177,5 +174,4 @@ cc_benchmark { "libosi", ], header_libs: ["libbluetooth_headers"], - cflags: ["-Wno-unused-parameter"], } diff --git a/system/common/benchmark/thread_performance_benchmark.cc b/system/common/benchmark/thread_performance_benchmark.cc index 1a9828d394..cfad3627b9 100644 --- a/system/common/benchmark/thread_performance_benchmark.cc +++ b/system/common/benchmark/thread_performance_benchmark.cc @@ -48,15 +48,15 @@ void pthread_callback_batch(void* context) { } } -void callback_sequential(void* context) { g_counter_promise->set_value(); } +void callback_sequential(void* /* context */) { g_counter_promise->set_value(); } -void callback_sequential_queue(fixed_queue_t* queue, void* context) { +void callback_sequential_queue(fixed_queue_t* queue, void* /* context */) { 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) { +void callback_batch(fixed_queue_t* queue, void* /* data */) { bluetooth::log::assert_that(queue != nullptr, "assert failed: queue != nullptr"); fixed_queue_dequeue(queue); g_counter++; diff --git a/system/common/message_loop_thread_unittest.cc b/system/common/message_loop_thread_unittest.cc index 21f05f68c2..8b6d598aaf 100644 --- a/system/common/message_loop_thread_unittest.cc +++ b/system/common/message_loop_thread_unittest.cc @@ -324,10 +324,10 @@ TEST_F(MessageLoopThreadTest, test_post_twice) { int counter = 0; message_loop_thread.StartUp(); message_loop_thread.Post(base::BindOnce( - [](MessageLoopThread* thread, int* counter) { ASSERT_EQ((*counter)++, 0); }, + [](MessageLoopThread* /* thread */, int* counter) { ASSERT_EQ((*counter)++, 0); }, &message_loop_thread, &counter)); message_loop_thread.Post(base::BindOnce( - [](MessageLoopThread* thread, int* counter) { ASSERT_EQ((*counter)++, 1); }, + [](MessageLoopThread* /* thread */, int* counter) { ASSERT_EQ((*counter)++, 1); }, &message_loop_thread, &counter)); message_loop_thread.ShutDown(); ASSERT_EQ(counter, 2); diff --git a/system/common/metrics_linux.cc b/system/common/metrics_linux.cc index 0f715fbd95..13795f764d 100644 --- a/system/common/metrics_linux.cc +++ b/system/common/metrics_linux.cc @@ -18,58 +18,60 @@ #include <bluetooth/log.h> -#include "leaky_bonded_queue.h" -#include "metrics.h" +#include "common/metrics.h" #include "types/raw_address.h" namespace bluetooth { namespace common { -void A2dpSessionMetrics::Update(const A2dpSessionMetrics& metrics) {} +void A2dpSessionMetrics::Update(const A2dpSessionMetrics& /* metrics */) {} -bool A2dpSessionMetrics::operator==(const A2dpSessionMetrics& rhs) const { +bool A2dpSessionMetrics::operator==(const A2dpSessionMetrics& /* rhs */) const { log::info("UNIMPLEMENTED"); return true; } struct BluetoothMetricsLogger::impl { - impl(size_t max_bluetooth_session, size_t max_pair_event, size_t max_wake_event, - size_t max_scan_event) {} + impl(size_t /* max_bluetooth_session */, size_t /* max_pair_event */, size_t /* max_wake_event */, + size_t /* max_scan_event */) {} }; BluetoothMetricsLogger::BluetoothMetricsLogger() : pimpl_(new impl(kMaxNumBluetoothSession, kMaxNumPairEvent, kMaxNumWakeEvent, kMaxNumScanEvent)) {} -void BluetoothMetricsLogger::LogPairEvent(uint32_t disconnect_reason, uint64_t timestamp_ms, - uint32_t device_class, device_type_t device_type) {} +void BluetoothMetricsLogger::LogPairEvent(uint32_t /* disconnect_reason */, + uint64_t /* timestamp_ms */, uint32_t /* device_class */, + device_type_t /* device_type */) {} -void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t type, const std::string& requestor, - const std::string& name, uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogWakeEvent(wake_event_type_t /* type */, + const std::string& /* requestor */, + const std::string& /* name */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogScanEvent(bool start, const std::string& initiator, - scan_tech_t type, uint32_t results, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogScanEvent(bool /* start */, const std::string& /* initiator */, + scan_tech_t /* type */, uint32_t /* results */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionStart(connection_tech_t connection_tech_type, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogBluetoothSessionStart(connection_tech_t /* connection_tech_type */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionEnd(disconnect_reason_t disconnect_reason, - uint64_t timestamp_ms) {} +void BluetoothMetricsLogger::LogBluetoothSessionEnd(disconnect_reason_t /* disconnect_reason */, + uint64_t /* timestamp_ms */) {} -void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t device_class, - device_type_t device_type) {} +void BluetoothMetricsLogger::LogBluetoothSessionDeviceInfo(uint32_t /* device_class */, + device_type_t /* device_type */) {} -void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& a2dp_session_metrics) {} +void BluetoothMetricsLogger::LogA2dpSession(const A2dpSessionMetrics& /* a2dp_session_metrics */) {} -void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID service_id) {} +void BluetoothMetricsLogger::LogHeadsetProfileRfcConnection(tBTA_SERVICE_ID /* service_id */) {} -void BluetoothMetricsLogger::WriteString(std::string* serialized) {} +void BluetoothMetricsLogger::WriteString(std::string* /* serialized */) {} -void BluetoothMetricsLogger::WriteBase64String(std::string* serialized) {} +void BluetoothMetricsLogger::WriteBase64String(std::string* /* serialized */) {} -void BluetoothMetricsLogger::WriteBase64(int fd) {} +void BluetoothMetricsLogger::WriteBase64(int /* fd */) {} void BluetoothMetricsLogger::CutoffSession() {} @@ -81,71 +83,82 @@ void BluetoothMetricsLogger::ResetLog() {} void BluetoothMetricsLogger::Reset() {} -void LogClassicPairingEvent(const RawAddress& address, uint16_t handle, uint32_t hci_cmd, - uint16_t hci_event, uint16_t cmd_status, uint16_t reason_code, - int64_t event_value) {} +void LogClassicPairingEvent(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* hci_cmd */, uint16_t /* hci_event */, + uint16_t /* cmd_status */, uint16_t /* reason_code */, + int64_t /* event_value */) {} -void LogSocketConnectionState(const RawAddress& address, int port, int type, - android::bluetooth::SocketConnectionstateEnum connection_state, - int64_t tx_bytes, int64_t rx_bytes, int uid, int server_port, - android::bluetooth::SocketRoleEnum socket_role) {} +void LogSocketConnectionState(const RawAddress& /* address */, int /* port */, int /* type */, + android::bluetooth::SocketConnectionstateEnum /* connection_state */, + int64_t /* tx_bytes */, int64_t /* rx_bytes */, int /* uid */, + int /* server_port */, + android::bluetooth::SocketRoleEnum /* socket_role */) {} -void LogHciTimeoutEvent(uint32_t hci_cmd) {} +void LogHciTimeoutEvent(uint32_t /* hci_cmd */) {} -void LogA2dpAudioUnderrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, - int num_missing_pcm_bytes) {} +void LogA2dpAudioUnderrunEvent(const RawAddress& /* address */, + uint64_t /* encoding_interval_millis */, + int /* num_missing_pcm_bytes */) {} -void LogA2dpAudioOverrunEvent(const RawAddress& address, uint64_t encoding_interval_millis, - int num_dropped_buffers, int num_dropped_encoded_frames, - int num_dropped_encoded_bytes) {} +void LogA2dpAudioOverrunEvent(const RawAddress& /* address */, + uint64_t /* encoding_interval_millis */, + int /* num_dropped_buffers */, int /* num_dropped_encoded_frames */, + int /* num_dropped_encoded_bytes */) {} -void LogA2dpPlaybackEvent(const RawAddress& address, int playback_state, int audio_coding_mode) {} +void LogA2dpPlaybackEvent(const RawAddress& /* address */, int /* playback_state */, + int /* audio_coding_mode */) {} -void LogBluetoothHalCrashReason(const RawAddress& address, uint32_t error_code, - uint32_t vendor_error_code) {} +void LogBluetoothHalCrashReason(const RawAddress& /* address */, uint32_t /* error_code */, + uint32_t /* vendor_error_code */) {} -void LogReadRssiResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, - int8_t rssi) {} +void LogReadRssiResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, int8_t /* rssi */) {} -void LogReadFailedContactCounterResult(const RawAddress& address, uint16_t handle, - uint32_t cmd_status, int32_t failed_contact_counter) {} +void LogReadFailedContactCounterResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, + int32_t /* failed_contact_counter */) {} -void LogReadTxPowerLevelResult(const RawAddress& address, uint16_t handle, uint32_t cmd_status, - int32_t transmit_power_level) {} +void LogReadTxPowerLevelResult(const RawAddress& /* address */, uint16_t /* handle */, + uint32_t /* cmd_status */, int32_t /* transmit_power_level */) {} -void LogRemoteVersionInfo(uint16_t handle, uint8_t status, uint8_t version, - uint16_t manufacturer_name, uint16_t subversion) {} +void LogRemoteVersionInfo(uint16_t /* handle */, uint8_t /* status */, uint8_t /* version */, + uint16_t /* manufacturer_name */, uint16_t /* subversion */) {} -void LogLinkLayerConnectionEvent(const RawAddress* address, uint32_t connection_handle, - android::bluetooth::DirectionEnum direction, uint16_t link_type, - uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event, - uint16_t cmd_status, uint16_t reason_code) {} +void LogLinkLayerConnectionEvent(const RawAddress* /* address */, uint32_t /* connection_handle */, + android::bluetooth::DirectionEnum /* direction */, + uint16_t /* link_type */, uint32_t /* hci_cmd */, + uint16_t /* hci_event */, uint16_t /* hci_ble_event */, + uint16_t /* cmd_status */, uint16_t /* reason_code */) {} -void LogManufacturerInfo(const RawAddress& address, - android::bluetooth::DeviceInfoSrcEnum source_type, - const std::string& source_name, const std::string& manufacturer, - const std::string& model, const std::string& hardware_version, - const std::string& software_version) {} +void LogManufacturerInfo(const RawAddress& /* address */, + android::bluetooth::DeviceInfoSrcEnum /* source_type */, + const std::string& /* source_name */, + /* const */ std::string& /* manufacturer */, + const std::string& /* model */, const std::string& /* hardware_version */, + const std::string& /* software_version */) {} -void LogSdpAttribute(const RawAddress& address, uint16_t protocol_uuid, uint16_t attribute_id, - size_t attribute_size, const char* attribute_value) {} +void LogSdpAttribute(const RawAddress& /* address */, uint16_t /* protocol_uuid */, + uint16_t /* attribute_id */, size_t /* attribute_size */, + const char* /* attribute_value */) {} -void LogSmpPairingEvent(const RawAddress& address, uint8_t smp_cmd, - android::bluetooth::DirectionEnum direction, uint8_t smp_fail_reason) {} +void LogSmpPairingEvent(const RawAddress& /* address */, uint8_t /* smp_cmd */, + android::bluetooth::DirectionEnum /* direction */, + uint8_t /* smp_fail_reason */) {} void LogLeAudioConnectionSessionReported( - int32_t group_size, int32_t group_metric_id, int64_t connection_duration_nanos, - const std::vector<int64_t>& device_connecting_offset_nanos, - const std::vector<int64_t>& device_connected_offset_nanos, - const std::vector<int64_t>& device_connection_duration_nanos, - const std::vector<int32_t>& device_connection_status, - const std::vector<int32_t>& device_disconnection_status, - const std::vector<RawAddress>& device_address, - const std::vector<int64_t>& streaming_offset_nanos, - const std::vector<int64_t>& streaming_duration_nanos, - const std::vector<int32_t>& streaming_context_type) {} - -void LogLeAudioBroadcastSessionReported(int64_t duration_nanos) {} + int32_t /* group_size */, int32_t /* group_metric_id */, + int64_t /* connection_duration_nanos */, + const std::vector<int64_t>& /* device_connecting_offset_nanos */, + const std::vector<int64_t>& /* device_connected_offset_nanos */, + const std::vector<int64_t>& /* device_connection_duration_nanos */, + const std::vector<int32_t>& /* device_connection_status */, + const std::vector<int32_t>& /* device_disconnection_status */, + const std::vector<RawAddress>& /* device_address */, + const std::vector<int64_t>& /* streaming_offset_nanos */, + const std::vector<int64_t>& /* streaming_duration_nanos */, + const std::vector<int32_t>& /* streaming_context_type */) {} + +void LogLeAudioBroadcastSessionReported(int64_t /* duration_nanos */) {} } // namespace common diff --git a/system/common/test/thread_performance_test.cc b/system/common/test/thread_performance_test.cc index 6696486270..4eed2fdf10 100644 --- a/system/common/test/thread_performance_test.cc +++ b/system/common/test/thread_performance_test.cc @@ -39,7 +39,7 @@ using namespace bluetooth; static int g_counter = 0; static std::unique_ptr<std::promise<void>> g_counter_promise = nullptr; -void callback_batch(fixed_queue_t* queue, void* data) { +void callback_batch(fixed_queue_t* queue, void* /* data */) { if (queue != nullptr) { fixed_queue_dequeue(queue); } diff --git a/system/gd/Android.bp b/system/gd/Android.bp index 9105949c2b..ddc8eafe53 100644 --- a/system/gd/Android.bp +++ b/system/gd/Android.bp @@ -34,7 +34,6 @@ cc_defaults { "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", "-DGOOGLE_PROTOBUF_NO_RTTI", "-DLOG_NDEBUG=0", - "-Wno-unused-result", "-fvisibility=hidden", ], header_libs: ["jni_headers"], diff --git a/system/gd/os/fake_timer/fake_timerfd.cc b/system/gd/os/fake_timer/fake_timerfd.cc index ea6dbabb24..400a92743c 100644 --- a/system/gd/os/fake_timer/fake_timerfd.cc +++ b/system/gd/os/fake_timer/fake_timerfd.cc @@ -19,6 +19,7 @@ #include <sys/eventfd.h> #include <unistd.h> +#include <cstdint> #include <map> namespace bluetooth { @@ -117,7 +118,7 @@ static bool fire_next_event(uint64_t new_clock) { } to_fire->active = is_periodic; uint64_t value = 1; - write(to_fire->fd, &value, sizeof(uint64_t)); + (void)write(to_fire->fd, &value, sizeof(uint64_t)); return true; } |