diff options
author | 2025-02-25 18:33:10 +0000 | |
---|---|---|
committer | 2025-02-26 19:24:52 +0000 | |
commit | 138659ad3ff2961010b9cacd36fceb36ba73dcce (patch) | |
tree | e0da88f1bad4ae4495d4391f2e9432d1990e829e | |
parent | ffe24b26fa178edbc1dd7ce33af1bce1a87ebf17 (diff) |
Enforce -Wmissing-prototypes
Bug: 369381361
Test: m com.android.bt
Flag: EXEMPT, no logical change
Change-Id: I88e569e1e0b6c04716fa48345c1ede816fb405a3
147 files changed, 508 insertions, 1529 deletions
diff --git a/android/app/jni/com_android_bluetooth_avrcp_target.cpp b/android/app/jni/com_android_bluetooth_avrcp_target.cpp index 35208d9eb5..a2bd48e4a7 100644 --- a/android/app/jni/com_android_bluetooth_avrcp_target.cpp +++ b/android/app/jni/com_android_bluetooth_avrcp_target.cpp @@ -37,9 +37,6 @@ #include "hardware/bluetooth.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::avrcp::Attribute; using bluetooth::avrcp::AttributeEntry; using bluetooth::avrcp::FolderInfo; @@ -321,7 +318,7 @@ static void cleanupNative(JNIEnv* env, jobject /* object */) { sServiceInterface = nullptr; } -jboolean connectDeviceNative(JNIEnv* env, jobject /* object */, jstring address) { +static jboolean connectDeviceNative(JNIEnv* env, jobject /* object */, jstring address) { log::debug(""); std::unique_lock<std::shared_timed_mutex> interface_lock(interface_mutex); if (mServiceCallbacks == nullptr) { @@ -341,7 +338,7 @@ jboolean connectDeviceNative(JNIEnv* env, jobject /* object */, jstring address) return sServiceInterface->ConnectDevice(bdaddr) == true ? JNI_TRUE : JNI_FALSE; } -jboolean disconnectDeviceNative(JNIEnv* env, jobject /* object */, jstring address) { +static jboolean disconnectDeviceNative(JNIEnv* env, jobject /* object */, jstring address) { log::debug(""); std::unique_lock<std::shared_timed_mutex> interface_lock(interface_mutex); if (mServiceCallbacks == nullptr) { diff --git a/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp b/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp index 47db682622..78db0b3a10 100644 --- a/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp +++ b/android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp @@ -43,9 +43,6 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::Uuid; extern bt_interface_t bluetoothInterface; @@ -1025,7 +1022,7 @@ static bt_os_callouts_t sBluetoothOsCallouts = { release_wake_lock_callout, }; -int hal_util_load_bt_library(const bt_interface_t** interface) { +static int hal_util_load_bt_library(const bt_interface_t** interface) { *interface = &bluetoothInterface; return 0; } @@ -2279,7 +2276,7 @@ static jboolean restoreFilterAcceptListNative(JNIEnv* /* env */, jobject /* obj return (ret == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; } -int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) { +static int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) { const JNINativeMethod methods[] = { {"initNative", "(ZZIZ)Z", reinterpret_cast<void*>(initNative)}, {"cleanupNative", "()V", reinterpret_cast<void*>(cleanupNative)}, diff --git a/android/app/jni/com_android_bluetooth_gatt.cpp b/android/app/jni/com_android_bluetooth_gatt.cpp index 357e23f5d0..40b65087fa 100644 --- a/android/app/jni/com_android_bluetooth_gatt.cpp +++ b/android/app/jni/com_android_bluetooth_gatt.cpp @@ -54,9 +54,6 @@ #include "types/bluetooth/uuid.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::Uuid; #define UUID_PARAMS(uuid) uuid_lsb(uuid), uuid_msb(uuid) @@ -248,7 +245,7 @@ static std::shared_mutex callbacks_mutex; * BTA client callbacks */ -void btgattc_register_app_cb(int status, int clientIf, const Uuid& app_uuid) { +static void btgattc_register_app_cb(int status, int clientIf, const Uuid& app_uuid) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -258,7 +255,7 @@ void btgattc_register_app_cb(int status, int clientIf, const Uuid& app_uuid) { UUID_PARAMS(app_uuid)); } -void btgattc_open_cb(int conn_id, int status, int clientIf, const RawAddress& bda) { +static void btgattc_open_cb(int conn_id, int status, int clientIf, const RawAddress& bda) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -270,7 +267,7 @@ void btgattc_open_cb(int conn_id, int status, int clientIf, const RawAddress& bd address.get()); } -void btgattc_close_cb(int conn_id, int status, int clientIf, const RawAddress& bda) { +static void btgattc_close_cb(int conn_id, int status, int clientIf, const RawAddress& bda) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -282,7 +279,7 @@ void btgattc_close_cb(int conn_id, int status, int clientIf, const RawAddress& b address.get()); } -void btgattc_search_complete_cb(int conn_id, int status) { +static void btgattc_search_complete_cb(int conn_id, int status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -292,8 +289,8 @@ void btgattc_search_complete_cb(int conn_id, int status) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onSearchCompleted, conn_id, status); } -void btgattc_register_for_notification_cb(int conn_id, int registered, int status, - uint16_t handle) { +static void btgattc_register_for_notification_cb(int conn_id, int registered, int status, + uint16_t handle) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -304,7 +301,7 @@ void btgattc_register_for_notification_cb(int conn_id, int registered, int statu registered, handle); } -void btgattc_notify_cb(int conn_id, const btgatt_notify_params_t& p_data) { +static void btgattc_notify_cb(int conn_id, const btgatt_notify_params_t& p_data) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -320,7 +317,8 @@ void btgattc_notify_cb(int conn_id, const btgatt_notify_params_t& p_data) { p_data.handle, p_data.is_notify, jb.get()); } -void btgattc_read_characteristic_cb(int conn_id, int status, const btgatt_read_params_t& p_data) { +static void btgattc_read_characteristic_cb(int conn_id, int status, + const btgatt_read_params_t& p_data) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -341,8 +339,8 @@ void btgattc_read_characteristic_cb(int conn_id, int status, const btgatt_read_p p_data.handle, jb.get()); } -void btgattc_write_characteristic_cb(int conn_id, int status, uint16_t handle, uint16_t len, - const uint8_t* value) { +static void btgattc_write_characteristic_cb(int conn_id, int status, uint16_t handle, uint16_t len, + const uint8_t* value) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -356,7 +354,7 @@ void btgattc_write_characteristic_cb(int conn_id, int status, uint16_t handle, u jb.get()); } -void btgattc_execute_write_cb(int conn_id, int status) { +static void btgattc_execute_write_cb(int conn_id, int status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -366,7 +364,8 @@ void btgattc_execute_write_cb(int conn_id, int status) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onExecuteCompleted, conn_id, status); } -void btgattc_read_descriptor_cb(int conn_id, int status, const btgatt_read_params_t& p_data) { +static void btgattc_read_descriptor_cb(int conn_id, int status, + const btgatt_read_params_t& p_data) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -385,8 +384,8 @@ void btgattc_read_descriptor_cb(int conn_id, int status, const btgatt_read_param p_data.handle, jb.get()); } -void btgattc_write_descriptor_cb(int conn_id, int status, uint16_t handle, uint16_t len, - const uint8_t* value) { +static void btgattc_write_descriptor_cb(int conn_id, int status, uint16_t handle, uint16_t len, + const uint8_t* value) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -400,7 +399,7 @@ void btgattc_write_descriptor_cb(int conn_id, int status, uint16_t handle, uint1 jb.get()); } -void btgattc_remote_rssi_cb(int client_if, const RawAddress& bda, int rssi, int status) { +static void btgattc_remote_rssi_cb(int client_if, const RawAddress& bda, int rssi, int status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -413,7 +412,7 @@ void btgattc_remote_rssi_cb(int client_if, const RawAddress& bda, int rssi, int rssi, status); } -void btgattc_configure_mtu_cb(int conn_id, int status, int mtu) { +static void btgattc_configure_mtu_cb(int conn_id, int status, int mtu) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -422,7 +421,7 @@ void btgattc_configure_mtu_cb(int conn_id, int status, int mtu) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onConfigureMTU, conn_id, status, mtu); } -void btgattc_congestion_cb(int conn_id, bool congested) { +static void btgattc_congestion_cb(int conn_id, bool congested) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -431,7 +430,8 @@ void btgattc_congestion_cb(int conn_id, bool congested) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onClientCongestion, conn_id, congested); } -void fillGattDbElementArray(JNIEnv* env, jobject* array, const btgatt_db_element_t* db, int count) { +static void fillGattDbElementArray(JNIEnv* env, jobject* array, const btgatt_db_element_t* db, + int count) { // Because JNI uses a different class loader in the callback context, we // cannot simply get the class. // As a workaround, we have to make sure we obtain an object of the class @@ -494,7 +494,7 @@ void fillGattDbElementArray(JNIEnv* env, jobject* array, const btgatt_db_element } } -void btgattc_get_gatt_db_cb(int conn_id, const btgatt_db_element_t* db, int count) { +static void btgattc_get_gatt_db_cb(int conn_id, const btgatt_db_element_t* db, int count) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -513,7 +513,7 @@ void btgattc_get_gatt_db_cb(int conn_id, const btgatt_db_element_t* db, int coun sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onGetGattDb, conn_id, array.get()); } -void btgattc_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status) { +static void btgattc_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -524,8 +524,8 @@ void btgattc_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status); } -void btgattc_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, uint16_t timeout, - uint8_t status) { +static void btgattc_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, + uint16_t timeout, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -536,7 +536,7 @@ void btgattc_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, u timeout, status); } -void btgattc_service_changed_cb(int conn_id) { +static void btgattc_service_changed_cb(int conn_id) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -546,8 +546,8 @@ void btgattc_service_changed_cb(int conn_id) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onServiceChanged, conn_id); } -void btgattc_subrate_change_cb(int conn_id, uint16_t subrate_factor, uint16_t latency, - uint16_t cont_num, uint16_t timeout, uint8_t status) { +static void btgattc_subrate_change_cb(int conn_id, uint16_t subrate_factor, uint16_t latency, + uint16_t cont_num, uint16_t timeout, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -586,7 +586,7 @@ static const btgatt_client_callbacks_t sGattClientCallbacks = { * BTA server callbacks */ -void btgatts_register_app_cb(int status, int server_if, const Uuid& uuid) { +static void btgatts_register_app_cb(int status, int server_if, const Uuid& uuid) { // TODO(b/356462170): Remove this when we have fixed the bug if (!is_module_started(&rust_module)) { log::error("Rust module isn't started! scan_manager_refactor={}", @@ -602,7 +602,8 @@ void btgatts_register_app_cb(int status, int server_if, const Uuid& uuid) { UUID_PARAMS(uuid)); } -void btgatts_connection_cb(int conn_id, int server_if, int connected, const RawAddress& bda) { +static void btgatts_connection_cb(int conn_id, int server_if, int connected, + const RawAddress& bda) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -614,8 +615,8 @@ void btgatts_connection_cb(int conn_id, int server_if, int connected, const RawA conn_id, server_if); } -void btgatts_service_added_cb(int status, int server_if, const btgatt_db_element_t* service, - size_t service_count) { +static void btgatts_service_added_cb(int status, int server_if, const btgatt_db_element_t* service, + size_t service_count) { // mirror the database in rust, now that it's created. if (status == 0x00 /* SUCCESS */) { auto service_records = rust::Vec<bluetooth::gatt::GattRecord>(); @@ -647,7 +648,7 @@ void btgatts_service_added_cb(int status, int server_if, const btgatt_db_element array.get()); } -void btgatts_service_stopped_cb(int status, int server_if, int srvc_handle) { +static void btgatts_service_stopped_cb(int status, int server_if, int srvc_handle) { bluetooth::gatt::remove_service(server_if, srvc_handle); std::shared_lock<std::shared_mutex> lock(callbacks_mutex); @@ -659,7 +660,7 @@ void btgatts_service_stopped_cb(int status, int server_if, int srvc_handle) { srvc_handle); } -void btgatts_service_deleted_cb(int status, int server_if, int srvc_handle) { +static void btgatts_service_deleted_cb(int status, int server_if, int srvc_handle) { bluetooth::gatt::remove_service(server_if, srvc_handle); std::shared_lock<std::shared_mutex> lock(callbacks_mutex); @@ -671,8 +672,8 @@ void btgatts_service_deleted_cb(int status, int server_if, int srvc_handle) { srvc_handle); } -void btgatts_request_read_characteristic_cb(int conn_id, int trans_id, const RawAddress& bda, - int attr_handle, int offset, bool is_long) { +static void btgatts_request_read_characteristic_cb(int conn_id, int trans_id, const RawAddress& bda, + int attr_handle, int offset, bool is_long) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -684,8 +685,8 @@ void btgatts_request_read_characteristic_cb(int conn_id, int trans_id, const Raw conn_id, trans_id, attr_handle, offset, is_long); } -void btgatts_request_read_descriptor_cb(int conn_id, int trans_id, const RawAddress& bda, - int attr_handle, int offset, bool is_long) { +static void btgatts_request_read_descriptor_cb(int conn_id, int trans_id, const RawAddress& bda, + int attr_handle, int offset, bool is_long) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -697,9 +698,10 @@ void btgatts_request_read_descriptor_cb(int conn_id, int trans_id, const RawAddr trans_id, attr_handle, offset, is_long); } -void btgatts_request_write_characteristic_cb(int conn_id, int trans_id, const RawAddress& bda, - int attr_handle, int offset, bool need_rsp, - bool is_prep, const uint8_t* value, size_t length) { +static void btgatts_request_write_characteristic_cb(int conn_id, int trans_id, + const RawAddress& bda, int attr_handle, + int offset, bool need_rsp, bool is_prep, + const uint8_t* value, size_t length) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -716,9 +718,9 @@ void btgatts_request_write_characteristic_cb(int conn_id, int trans_id, const Ra val.get()); } -void btgatts_request_write_descriptor_cb(int conn_id, int trans_id, const RawAddress& bda, - int attr_handle, int offset, bool need_rsp, bool is_prep, - const uint8_t* value, size_t length) { +static void btgatts_request_write_descriptor_cb(int conn_id, int trans_id, const RawAddress& bda, + int attr_handle, int offset, bool need_rsp, + bool is_prep, const uint8_t* value, size_t length) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -735,8 +737,8 @@ void btgatts_request_write_descriptor_cb(int conn_id, int trans_id, const RawAdd val.get()); } -void btgatts_request_exec_write_cb(int conn_id, int trans_id, const RawAddress& bda, - int exec_write) { +static void btgatts_request_exec_write_cb(int conn_id, int trans_id, const RawAddress& bda, + int exec_write) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -748,7 +750,7 @@ void btgatts_request_exec_write_cb(int conn_id, int trans_id, const RawAddress& trans_id, exec_write); } -void btgatts_response_confirmation_cb(int status, int handle) { +static void btgatts_response_confirmation_cb(int status, int handle) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -757,7 +759,7 @@ void btgatts_response_confirmation_cb(int status, int handle) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onResponseSendCompleted, status, handle); } -void btgatts_indication_sent_cb(int conn_id, int status) { +static void btgatts_indication_sent_cb(int conn_id, int status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -766,7 +768,7 @@ void btgatts_indication_sent_cb(int conn_id, int status) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onNotificationSent, conn_id, status); } -void btgatts_congestion_cb(int conn_id, bool congested) { +static void btgatts_congestion_cb(int conn_id, bool congested) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -775,7 +777,7 @@ void btgatts_congestion_cb(int conn_id, bool congested) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onServerCongestion, conn_id, congested); } -void btgatts_mtu_changed_cb(int conn_id, int mtu) { +static void btgatts_mtu_changed_cb(int conn_id, int mtu) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -784,7 +786,7 @@ void btgatts_mtu_changed_cb(int conn_id, int mtu) { sCallbackEnv->CallVoidMethod(mCallbacksObj, method_onServerMtuChanged, conn_id, mtu); } -void btgatts_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status) { +static void btgatts_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -795,8 +797,8 @@ void btgatts_phy_updated_cb(int conn_id, uint8_t tx_phy, uint8_t rx_phy, uint8_t status); } -void btgatts_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, uint16_t timeout, - uint8_t status) { +static void btgatts_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, + uint16_t timeout, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -807,8 +809,8 @@ void btgatts_conn_updated_cb(int conn_id, uint16_t interval, uint16_t latency, u timeout, status); } -void btgatts_subrate_change_cb(int conn_id, uint16_t subrate_factor, uint16_t latency, - uint16_t cont_num, uint16_t timeout, uint8_t status) { +static void btgatts_subrate_change_cb(int conn_id, uint16_t subrate_factor, uint16_t latency, + uint16_t cont_num, uint16_t timeout, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mCallbacksObj) { @@ -1294,7 +1296,7 @@ static void gattClientUnregisterAppNative(JNIEnv* /* env */, jobject /* object * sGattIf->client->unregister_client(clientIf); } -void btgattc_register_scanner_cb(const Uuid& app_uuid, uint8_t scannerId, uint8_t status) { +static void btgattc_register_scanner_cb(const Uuid& app_uuid, uint8_t scannerId, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1542,7 +1544,8 @@ static void gattSetScanParametersNative(JNIEnv* /* env */, jobject /* object */, scan_window_unit_coded, scan_phy); } -void scan_filter_param_cb(uint8_t client_if, uint8_t avbl_space, uint8_t action, uint8_t status) { +static void scan_filter_param_cb(uint8_t client_if, uint8_t avbl_space, uint8_t action, + uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1794,7 +1797,7 @@ static void gattClientScanFilterClearNative(JNIEnv* /* env */, jobject /* object sScanner->ScanFilterClear(filt_index, base::Bind(&scan_filter_cfg_cb, client_if)); } -void scan_enable_cb(uint8_t client_if, uint8_t action, uint8_t status) { +static void scan_enable_cb(uint8_t client_if, uint8_t action, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1812,7 +1815,7 @@ static void gattClientScanFilterEnableNative(JNIEnv* /* env */, jobject /* objec sScanner->ScanFilterEnable(enable, base::Bind(&scan_enable_cb, client_if)); } -void msft_monitor_add_cb(int filter_index, uint8_t monitor_handle, uint8_t status) { +static void msft_monitor_add_cb(int filter_index, uint8_t monitor_handle, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1822,7 +1825,7 @@ void msft_monitor_add_cb(int filter_index, uint8_t monitor_handle, uint8_t statu monitor_handle, status); } -void msft_monitor_remove_cb(int filter_index, uint8_t status) { +static void msft_monitor_remove_cb(int filter_index, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1832,7 +1835,7 @@ void msft_monitor_remove_cb(int filter_index, uint8_t status) { status); } -void msft_monitor_enable_cb(uint8_t status) { +static void msft_monitor_enable_cb(uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -1981,7 +1984,7 @@ static int gattSubrateRequestNative(JNIEnv* env, jobject /* object */, jint /* c return 0; // BluetoothStatusCodes.SUCCESS } -void batchscan_cfg_storage_cb(uint8_t client_if, uint8_t status) { +static void batchscan_cfg_storage_cb(uint8_t client_if, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { @@ -2003,7 +2006,7 @@ static void gattClientConfigBatchScanStorageNative(JNIEnv* /* env */, jobject /* base::Bind(&batchscan_cfg_storage_cb, client_if)); } -void batchscan_enable_cb(uint8_t client_if, uint8_t status) { +static void batchscan_enable_cb(uint8_t client_if, uint8_t status) { std::shared_lock<std::shared_mutex> lock(callbacks_mutex); CallbackEnv sCallbackEnv(__func__); if (!sCallbackEnv.valid() || !mScanCallbacksObj) { diff --git a/android/app/jni/com_android_bluetooth_le_audio.cpp b/android/app/jni/com_android_bluetooth_le_audio.cpp index 3b0411135c..37d2cde5b8 100644 --- a/android/app/jni/com_android_bluetooth_le_audio.cpp +++ b/android/app/jni/com_android_bluetooth_le_audio.cpp @@ -40,9 +40,6 @@ #include "hardware/bt_le_audio.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::le_audio::BroadcastId; using bluetooth::le_audio::BroadcastState; using bluetooth::le_audio::btle_audio_bits_per_sample_index_t; @@ -132,7 +129,7 @@ static std::shared_timed_mutex callbacks_mutex; static jclass class_LeAudioNativeInterface; -jobject prepareCodecConfigObj(JNIEnv* env, btle_audio_codec_config_t codecConfig) { +static jobject prepareCodecConfigObj(JNIEnv* env, btle_audio_codec_config_t codecConfig) { log::info( "ct: {}, codec_priority: {}, sample_rate: {}, bits_per_sample: {}, " "channel_count: {}, frame_duration: {}, octets_per_frame: {}", @@ -149,8 +146,8 @@ jobject prepareCodecConfigObj(JNIEnv* env, btle_audio_codec_config_t codecConfig return codecConfigObj; } -jobjectArray prepareArrayOfCodecConfigs(JNIEnv* env, - std::vector<btle_audio_codec_config_t> codecConfigs) { +static jobjectArray prepareArrayOfCodecConfigs( + JNIEnv* env, std::vector<btle_audio_codec_config_t> codecConfigs) { jsize i = 0; jobjectArray CodecConfigArray = env->NewObjectArray( (jsize)codecConfigs.size(), android_bluetooth_BluetoothLeAudioCodecConfig.clazz, nullptr); @@ -397,8 +394,8 @@ public: static LeAudioClientCallbacksImpl sLeAudioClientCallbacks; -std::vector<btle_audio_codec_config_t> prepareCodecPreferences(JNIEnv* env, jobject /* object */, - jobjectArray codecConfigArray) { +static std::vector<btle_audio_codec_config_t> prepareCodecPreferences( + JNIEnv* env, jobject /* object */, jobjectArray codecConfigArray) { std::vector<btle_audio_codec_config_t> codec_preferences; int numConfigs = env->GetArrayLength(codecConfigArray); @@ -758,7 +755,7 @@ static std::shared_timed_mutex sBroadcasterCallbacksMutex; #define VEC_UINT8_TO_UINT16(vec) (((vec).data()[1] << 8) + ((vec).data()[0])) -size_t RawPacketSize(const std::map<uint8_t, std::vector<uint8_t>>& values) { +static size_t RawPacketSize(const std::map<uint8_t, std::vector<uint8_t>>& values) { size_t bytes = 0; for (auto const& value : values) { bytes += (/* ltv_len + ltv_type */ 2 + value.second.size()); @@ -766,8 +763,8 @@ size_t RawPacketSize(const std::map<uint8_t, std::vector<uint8_t>>& values) { return bytes; } -jbyteArray prepareRawLtvArray(JNIEnv* env, - const std::map<uint8_t, std::vector<uint8_t>>& metadata) { +static jbyteArray prepareRawLtvArray(JNIEnv* env, + const std::map<uint8_t, std::vector<uint8_t>>& metadata) { auto raw_meta_size = RawPacketSize(metadata); jbyteArray raw_metadata = env->NewByteArray(raw_meta_size); @@ -834,7 +831,7 @@ static jint getOctetsPerFrameOrDefault(const std::map<uint8_t, std::vector<uint8 return VEC_UINT8_TO_UINT16(vec); } -jobject prepareLeAudioCodecConfigMetadataObject( +static jobject prepareLeAudioCodecConfigMetadataObject( JNIEnv* env, const std::map<uint8_t, std::vector<uint8_t>>& metadata) { jlong audio_location = getAudioLocationOrDefault(metadata, -1); jint sampling_frequency = getSamplingFrequencyOrDefault(metadata, 0); @@ -854,7 +851,7 @@ jobject prepareLeAudioCodecConfigMetadataObject( return obj; } -jobject prepareLeBroadcastChannelObject( +static jobject prepareLeBroadcastChannelObject( JNIEnv* env, const bluetooth::le_audio::BasicAudioAnnouncementBisConfig& bis_config) { ScopedLocalRef<jobject> meta_object( env, prepareLeAudioCodecConfigMetadataObject(env, bis_config.codec_specific_params)); @@ -870,7 +867,7 @@ jobject prepareLeBroadcastChannelObject( return obj; } -jobject prepareLeAudioContentMetadataObject( +static jobject prepareLeAudioContentMetadataObject( JNIEnv* env, const std::map<uint8_t, std::vector<uint8_t>>& metadata) { jstring program_info_str = nullptr; if (metadata.count(bluetooth::le_audio::kLeAudioMetadataTypeProgramInfo)) { @@ -922,7 +919,7 @@ jobject prepareLeAudioContentMetadataObject( return obj; } -jobject prepareLeBroadcastChannelListObject( +static jobject prepareLeBroadcastChannelListObject( JNIEnv* env, const std::vector<bluetooth::le_audio::BasicAudioAnnouncementBisConfig>& bis_configs) { jobject array = env->NewObject(java_util_ArrayList.clazz, java_util_ArrayList.constructor); @@ -943,7 +940,7 @@ jobject prepareLeBroadcastChannelListObject( return array; } -jobject prepareLeBroadcastSubgroupObject( +static jobject prepareLeBroadcastSubgroupObject( JNIEnv* env, const bluetooth::le_audio::BasicAudioAnnouncementSubgroup& subgroup) { // Serialize codec ID jlong jlong_codec_id = subgroup.codec_config.codec_id | @@ -979,7 +976,7 @@ jobject prepareLeBroadcastSubgroupObject( channel_list_obj.get()); } -jobject prepareLeBroadcastSubgroupListObject( +static jobject prepareLeBroadcastSubgroupListObject( JNIEnv* env, const std::vector<bluetooth::le_audio::BasicAudioAnnouncementSubgroup>& subgroup_configs) { jobject array = env->NewObject(java_util_ArrayList.clazz, java_util_ArrayList.constructor); @@ -1000,7 +997,7 @@ jobject prepareLeBroadcastSubgroupListObject( return array; } -jobject prepareBluetoothDeviceObject(JNIEnv* env, const RawAddress& addr, int addr_type) { +static jobject prepareBluetoothDeviceObject(JNIEnv* env, const RawAddress& addr, int addr_type) { // The address string has to be uppercase or the BluetoothDevice constructor // will treat it as invalid. auto addr_str = addr.ToString(); @@ -1018,7 +1015,7 @@ jobject prepareBluetoothDeviceObject(JNIEnv* env, const RawAddress& addr, int ad (jint)addr_type); } -jobject prepareBluetoothLeBroadcastMetadataObject( +static jobject prepareBluetoothLeBroadcastMetadataObject( JNIEnv* env, const bluetooth::le_audio::BroadcastMetadata& broadcast_metadata) { ScopedLocalRef<jobject> device_obj( env, @@ -1313,7 +1310,7 @@ static void BroadcasterCleanupNative(JNIEnv* env, jobject /* object */) { } } -std::vector<std::vector<uint8_t>> convertToDataVectors(JNIEnv* env, jobjectArray dataArray) { +static std::vector<std::vector<uint8_t>> convertToDataVectors(JNIEnv* env, jobjectArray dataArray) { jsize arraySize = env->GetArrayLength(dataArray); std::vector<std::vector<uint8_t>> res(arraySize); diff --git a/system/audio/asrc/asrc_resampler_test.cc b/system/audio/asrc/asrc_resampler_test.cc index 19ea04df0f..d2e109ef33 100644 --- a/system/audio/asrc/asrc_resampler_test.cc +++ b/system/audio/asrc/asrc_resampler_test.cc @@ -19,7 +19,6 @@ #include <cstdio> #include <iostream> -// TODO(b/369381361) Enfore -Wmissing-prototypes #pragma GCC diagnostic ignored "-Wmissing-prototypes" bluetooth::common::MessageLoopThread message_loop_thread("main message loop"); diff --git a/system/bta/ag/bta_ag_sco.cc b/system/bta/ag/bta_ag_sco.cc index a8e38c24a7..321e5d284e 100644 --- a/system/bta/ag/bta_ag_sco.cc +++ b/system/bta/ag/bta_ag_sco.cc @@ -75,6 +75,9 @@ using namespace bluetooth; ((uint16_t)(HCI_INP_CODING_LINEAR | HCI_INP_DATA_FMT_2S_COMPLEMENT | HCI_INP_SAMPLE_SIZE_16BIT | \ HCI_AIR_CODING_FORMAT_TRANSPNT)) +static void updateCodecParametersFromProviderInfo(tBTA_AG_UUID_CODEC esco_codec, + enh_esco_params_t& params); + static bool sco_allowed = true; static bool hfp_software_datapath_enabled = false; static RawAddress active_device_addr = {}; @@ -149,9 +152,6 @@ bool bta_ag_sco_is_active_device(const RawAddress& bd_addr) { return !active_device_addr.IsEmpty() && active_device_addr == bd_addr; } -void updateCodecParametersFromProviderInfo(tBTA_AG_UUID_CODEC esco_codec, - enh_esco_params_t& params); - /******************************************************************************* * * Function bta_ag_sco_conn_cback @@ -601,8 +601,8 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) { log::debug("AFTER {}", p_scb->ToString()); } -void updateCodecParametersFromProviderInfo(tBTA_AG_UUID_CODEC esco_codec, - enh_esco_params_t& params) { +static void updateCodecParametersFromProviderInfo(tBTA_AG_UUID_CODEC esco_codec, + enh_esco_params_t& params) { if (bta_ag_is_sco_managed_by_audio() && !sco_config_map.empty()) { auto sco_config_it = sco_config_map.find(esco_codec); if (sco_config_it == sco_config_map.end()) { diff --git a/system/bta/gmap/gmap_client_test.cc b/system/bta/gmap/gmap_client_test.cc index bc497da0a9..9554a8e310 100644 --- a/system/bta/gmap/gmap_client_test.cc +++ b/system/bta/gmap/gmap_client_test.cc @@ -24,6 +24,7 @@ #include "bta/le_audio/le_audio_types.h" #include "fake_osi.h" +#include "osi/include/properties.h" #include "test/mock/mock_osi_properties.h" using bluetooth::le_audio::GmapClient; @@ -31,8 +32,6 @@ using ::testing::_; static constexpr char kGmapEnabledSysProp[] = "bluetooth.profile.gmap.enabled"; -void osi_property_set_bool(const char* key, bool value); - class GmapClientTest : public ::testing::Test { public: RawAddress addr = RawAddress({0x11, 0x22, 0x33, 0x44, 0x55, 0x66}); diff --git a/system/bta/has/has_client_test.cc b/system/bta/has/has_client_test.cc index cf0e63f1cc..527ab2ef93 100644 --- a/system/bta/has/has_client_test.cc +++ b/system/bta/has/has_client_test.cc @@ -39,6 +39,7 @@ #include "hardware/bt_gatt_types.h" #include "has_types.h" #include "mock_csis_client.h" +#include "osi/include/properties.h" #include "stack/gatt/gatt_int.h" #include "stack/include/bt_uuid16.h" #include "stack/include/btm_status.h" @@ -46,7 +47,6 @@ #include "types/bt_transport.h" bool gatt_profile_get_eatt_support(const RawAddress& /*addr*/) { return true; } -void osi_property_set_bool(const char* key, bool value); namespace bluetooth { namespace has { diff --git a/system/bta/le_audio/codec_manager_test.cc b/system/bta/le_audio/codec_manager_test.cc index 54ba7ac195..f8c501600f 100644 --- a/system/bta/le_audio/codec_manager_test.cc +++ b/system/bta/le_audio/codec_manager_test.cc @@ -29,6 +29,7 @@ #include "le_audio/gmap_server.h" #include "le_audio/le_audio_types.h" #include "le_audio_set_configuration_provider.h" +#include "osi/include/properties.h" #include "test/mock/mock_legacy_hci_interface.h" #include "test/mock/mock_main_shim_entry.h" @@ -46,8 +47,6 @@ using bluetooth::le_audio::types::CodecLocation; using bluetooth::le_audio::types::kLeAudioDirectionSink; using bluetooth::le_audio::types::kLeAudioDirectionSource; -void osi_property_set_bool(const char* key, bool value); - static const std::vector<AudioSetConfiguration> offload_capabilities_none(0); const std::vector<AudioSetConfiguration>* offload_capabilities = &offload_capabilities_none; diff --git a/system/bta/le_audio/le_audio_client_test.cc b/system/bta/le_audio/le_audio_client_test.cc index e749c574ba..b8e7eddf72 100644 --- a/system/bta/le_audio/le_audio_client_test.cc +++ b/system/bta/le_audio/le_audio_client_test.cc @@ -51,6 +51,7 @@ #include "mock_csis_client.h" #include "mock_device_groups.h" #include "mock_state_machine.h" +#include "osi/include/properties.h" #include "stack/include/btm_status.h" #include "stack/include/main_thread.h" #include "test/common/mock_functions.h" @@ -103,8 +104,6 @@ constexpr bluetooth::le_audio::types::LeAudioContextType kLeAudioDefaultConfigur static constexpr char kNotifyUpperLayerAboutGroupBeingInIdleDuringCall[] = "persist.bluetooth.leaudio.notify.idle.during.call"; -void osi_property_set_bool(const char* key, bool value); - // Disables most likely false-positives from base::SplitString() extern "C" const char* __asan_default_options(); extern "C" const char* __asan_default_options() { return "detect_container_overflow=0"; } diff --git a/system/bta/le_audio/state_machine_test.cc b/system/bta/le_audio/state_machine_test.cc index 89a5682b9d..7733f7c6ae 100644 --- a/system/bta/le_audio/state_machine_test.cc +++ b/system/bta/le_audio/state_machine_test.cc @@ -58,8 +58,6 @@ using ::testing::Test; extern struct fake_osi_alarm_set_on_mloop fake_osi_alarm_set_on_mloop_; -void osi_property_set_bool(const char* key, bool value); - constexpr uint8_t media_ccid = 0xC0; constexpr auto media_context = LeAudioContextType::MEDIA; diff --git a/system/bta/test/bta_ag_sco_test.cc b/system/bta/test/bta_ag_sco_test.cc index cadf4a9919..16caac7665 100644 --- a/system/bta/test/bta_ag_sco_test.cc +++ b/system/bta/test/bta_ag_sco_test.cc @@ -39,7 +39,7 @@ class BtaAgScoParameterSelectionTest protected: void SetUp() override { test::mock::device_esco_parameters::esco_parameters_for_codec.body = - [this](esco_codec_t codec) { + [this](esco_codec_t codec, bool /* offload */) { this->codec = codec; return enh_esco_params_t{}; }; diff --git a/system/bta/test/bta_ag_test.cc b/system/bta/test/bta_ag_test.cc index 84d2addeb2..5fa3884669 100644 --- a/system/bta/test/bta_ag_test.cc +++ b/system/bta/test/bta_ag_test.cc @@ -74,11 +74,11 @@ protected: bta_ag_cb.p_cback = [](tBTA_AG_EVT /*event*/, tBTA_AG* /*p_data*/) {}; RawAddress::FromString("00:11:22:33:44:55", addr); - test::mock::device_esco_parameters::esco_parameters_for_codec.body = - [this](esco_codec_t codec) { - this->codec = codec; - return enh_esco_params_t{}; - }; + test::mock::device_esco_parameters::esco_parameters_for_codec.body = [this](esco_codec_t codec, + bool /*offload*/) { + this->codec = codec; + return enh_esco_params_t{}; + }; } void TearDown() override { test::mock::device_esco_parameters::esco_parameters_for_codec = {}; diff --git a/system/btcore/src/osi_module.cc b/system/btcore/src/osi_module.cc index 638748fe03..7656801296 100644 --- a/system/btcore/src/osi_module.cc +++ b/system/btcore/src/osi_module.cc @@ -26,12 +26,9 @@ #include "osi/include/osi.h" #include "osi/include/wakelock.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" +static future_t* osi_init(void) { return future_new_immediate(FUTURE_SUCCESS); } -future_t* osi_init(void) { return future_new_immediate(FUTURE_SUCCESS); } - -future_t* osi_clean_up(void) { +static future_t* osi_clean_up(void) { alarm_cleanup(); wakelock_cleanup(); return future_new_immediate(FUTURE_SUCCESS); diff --git a/system/btcore/test/device_class_test.cc b/system/btcore/test/device_class_test.cc index af114ffed5..ed5f9581f0 100644 --- a/system/btcore/test/device_class_test.cc +++ b/system/btcore/test/device_class_test.cc @@ -21,10 +21,8 @@ #include <arpa/inet.h> #include <gtest/gtest.h> -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -::testing::AssertionResult check_bitfield(const char* m_expr, const char* n_expr, int m, int n) { +static ::testing::AssertionResult check_bitfield(const char* m_expr, const char* n_expr, int m, + int n) { if (m == n) { return ::testing::AssertionSuccess(); } diff --git a/system/osi/include/thread_scheduler.h b/system/btif/include/bluetooth.h index e377268897..61bbb12a28 100644 --- a/system/osi/include/thread_scheduler.h +++ b/system/btif/include/bluetooth.h @@ -1,5 +1,5 @@ /* - * Copyright 2021 The Android Open Source Project + * Copyright 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,5 +16,8 @@ #pragma once -bool thread_scheduler_enable_real_time(pid_t pid); -bool thread_scheduler_get_priority_range(int& min, int& max); +int GetAdapterIndex(); + +namespace bluetooth::testing { +void set_hal_cbacks(bt_callbacks_t* callbacks); +} // namespace bluetooth::testing diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc index 11b9d3ed69..1e3db0be50 100644 --- a/system/btif/src/bluetooth.cc +++ b/system/btif/src/bluetooth.cc @@ -53,6 +53,7 @@ #include "bta/include/bta_le_audio_broadcaster_api.h" #include "bta/include/bta_vc_api.h" #include "btif/avrcp/avrcp_service.h" +#include "btif/include/bluetooth.h" #include "btif/include/btif_a2dp.h" #include "btif/include/btif_a2dp_source.h" #include "btif/include/btif_api.h" @@ -133,9 +134,6 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::csis::CsisClientInterface; using bluetooth::has::HasClientInterface; using bluetooth::le_audio::LeAudioBroadcasterInterface; @@ -408,7 +406,7 @@ static void set_adapter_index(int adapter) { global_hci_adapter = adapter; } int GetAdapterIndex() { return global_hci_adapter; } #else int GetAdapterIndex() { return 0; } // Unsupported outside of FLOSS -#endif +#endif // TARGET_FLOSS static int init(bt_callbacks_t* callbacks, bool start_restricted, bool is_common_criteria_mode, int config_compare_result, bool is_atv) { @@ -556,7 +554,7 @@ static int set_adapter_property(const bt_property_t* property) { return BT_STATUS_SUCCESS; } -int get_remote_device_properties(RawAddress* remote_addr) { +static int get_remote_device_properties(RawAddress* remote_addr) { if (!btif_is_enabled()) { return BT_STATUS_NOT_READY; } @@ -565,7 +563,7 @@ int get_remote_device_properties(RawAddress* remote_addr) { return BT_STATUS_SUCCESS; } -int get_remote_device_property(RawAddress* remote_addr, bt_property_type_t type) { +static int get_remote_device_property(RawAddress* remote_addr, bt_property_type_t type) { if (!btif_is_enabled()) { return BT_STATUS_NOT_READY; } @@ -574,7 +572,7 @@ int get_remote_device_property(RawAddress* remote_addr, bt_property_type_t type) return BT_STATUS_SUCCESS; } -int set_remote_device_property(RawAddress* remote_addr, const bt_property_t* property) { +static int set_remote_device_property(RawAddress* remote_addr, const bt_property_t* property) { if (!btif_is_enabled()) { return BT_STATUS_NOT_READY; } @@ -588,7 +586,7 @@ int set_remote_device_property(RawAddress* remote_addr, const bt_property_t* pro return BT_STATUS_SUCCESS; } -int get_remote_services(RawAddress* remote_addr, int transport) { +static int get_remote_services(RawAddress* remote_addr, int transport) { if (!interface_ready()) { return BT_STATUS_NOT_READY; } @@ -998,7 +996,7 @@ static const void* get_profile_interface(const char* profile_id) { return NULL; } -int dut_mode_configure(uint8_t enable) { +static int dut_mode_configure(uint8_t enable) { if (!interface_ready()) { return BT_STATUS_NOT_READY; } @@ -1010,7 +1008,7 @@ int dut_mode_configure(uint8_t enable) { return BT_STATUS_SUCCESS; } -int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) { +static int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) { if (!interface_ready()) { return BT_STATUS_NOT_READY; } @@ -1030,7 +1028,7 @@ int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) { return BT_STATUS_SUCCESS; } -int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len) { +static int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len) { if (!interface_ready()) { return BT_STATUS_NOT_READY; } @@ -1285,7 +1283,7 @@ EXPORT_SYMBOL bt_interface_t bluetoothInterface = { // callback reporting helpers -bt_property_t* property_deep_copy_array(int num_properties, bt_property_t* properties) { +static bt_property_t* property_deep_copy_array(int num_properties, bt_property_t* properties) { bt_property_t* copy = nullptr; if (num_properties > 0) { size_t content_len = 0; @@ -1544,5 +1542,4 @@ void invoke_encryption_change_cb(bt_encryption_change_evt encryption_change) { namespace bluetooth::testing { void set_hal_cbacks(bt_callbacks_t* callbacks) { ::set_hal_cbacks(callbacks); } - } // namespace bluetooth::testing diff --git a/system/device/fuzzer/Android.bp b/system/device/fuzzer/Android.bp index c7a6917898..3b7822ac61 100644 --- a/system/device/fuzzer/Android.bp +++ b/system/device/fuzzer/Android.bp @@ -26,6 +26,9 @@ package { cc_fuzz { name: "btdevice_esco_fuzzer", defaults: ["fluoride_defaults"], + cflags: [ + "-Wno-missing-prototypes", + ], srcs: [ ":TestMockMainShimEntry", "btdevice_esco_fuzzer.cpp", diff --git a/system/device/fuzzer/btdevice_esco_fuzzer.cpp b/system/device/fuzzer/btdevice_esco_fuzzer.cpp index 99b3f78cd8..b79d3527cd 100644 --- a/system/device/fuzzer/btdevice_esco_fuzzer.cpp +++ b/system/device/fuzzer/btdevice_esco_fuzzer.cpp @@ -23,9 +23,6 @@ #include "device/include/interop.h" #include "device/include/interop_config.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace std; constexpr size_t kNumAddressOctets = 6; constexpr size_t kMaxStringLength = 10; diff --git a/system/device/src/interop.cc b/system/device/src/interop.cc index c6f4d30a33..60d90cf6d6 100644 --- a/system/device/src/interop.cc +++ b/system/device/src/interop.cc @@ -47,9 +47,6 @@ #include "osi/include/osi.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; #ifdef __ANDROID__ @@ -792,7 +789,7 @@ static char* trim(char* str) { return str; } -bool token_to_ul(char* token, uint16_t* ul) { +static bool token_to_ul(char* token, uint16_t* ul) { char* e; bool ret_value = false; diff --git a/system/main/shim/acl.cc b/system/main/shim/acl.cc index 695c815275..72d8de8040 100644 --- a/system/main/shim/acl.cc +++ b/system/main/shim/acl.cc @@ -67,9 +67,6 @@ #include "types/ble_address_with_type.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - extern tBTM_CB btm_cb; using namespace bluetooth; diff --git a/system/main/shim/acl.h b/system/main/shim/acl.h index 83f62af604..bbe15d0acf 100644 --- a/system/main/shim/acl.h +++ b/system/main/shim/acl.h @@ -29,6 +29,9 @@ #include "packet/raw_builder.h" #include "types/raw_address.h" +void DumpsysAcl(int fd); +void DumpsysNeighbor(int fd); + namespace bluetooth { namespace shim { diff --git a/system/main/shim/hci_layer.cc b/system/main/shim/hci_layer.cc index 62b3e801ed..2b60141f27 100644 --- a/system/main/shim/hci_layer.cc +++ b/system/main/shim/hci_layer.cc @@ -37,9 +37,6 @@ #include "stack/include/hcimsgs.h" #include "stack/include/main_thread.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; /** @@ -155,16 +152,16 @@ static void subevent_callback(bluetooth::hci::LeMetaEventView le_meta_event_view send_data_upwards.Run(WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &le_meta_event_view)); } -void OnTransmitPacketCommandComplete(command_complete_cb complete_callback, void* context, - bluetooth::hci::CommandCompleteView view) { +static void OnTransmitPacketCommandComplete(command_complete_cb complete_callback, void* context, + bluetooth::hci::CommandCompleteView view) { log::debug("Received cmd complete for {}", bluetooth::hci::OpCodeText(view.GetCommandOpCode())); BT_HDR* response = WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &view); complete_callback(response, context); } -void OnTransmitPacketStatus(command_status_cb status_callback, void* context, - std::unique_ptr<OsiObject> command, - bluetooth::hci::CommandStatusView view) { +static void OnTransmitPacketStatus(command_status_cb status_callback, void* context, + std::unique_ptr<OsiObject> command, + bluetooth::hci::CommandStatusView view) { log::debug("Received cmd status {} for {}", bluetooth::hci::ErrorCodeText(view.GetStatus()), bluetooth::hci::OpCodeText(view.GetCommandOpCode())); uint8_t status = static_cast<uint8_t>(view.GetStatus()); diff --git a/system/main/test/main_shim_test.cc b/system/main/test/main_shim_test.cc index 82bc15bf12..2f4056a381 100644 --- a/system/main/test/main_shim_test.cc +++ b/system/main/test/main_shim_test.cc @@ -40,6 +40,7 @@ #include "hci/address_with_type.h" #include "hci/controller_interface_mock.h" #include "hci/distance_measurement_manager_mock.h" +#include "hci/include/packet_fragmenter.h" #include "hci/le_advertising_manager_mock.h" #include "hci/le_scanning_manager_mock.h" #include "include/hardware/ble_scanner.h" @@ -69,9 +70,6 @@ #include "types/hci_role.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using ::testing::_; using namespace bluetooth; @@ -120,41 +118,40 @@ private: bluetooth::common::TimestamperInMilliseconds timestamper_in_milliseconds; -void mock_on_send_data_upwards(BT_HDR*) {} +static void mock_on_send_data_upwards(BT_HDR*) {} -void mock_on_packets_completed(uint16_t /*handle*/, uint16_t /*num_packets*/) {} +static void mock_on_packets_completed(uint16_t /*handle*/, uint16_t /*num_packets*/) {} -void mock_connection_classic_on_connected(const RawAddress& /*bda*/, uint16_t /*handle*/, - uint8_t /*enc_mode*/, bool /*locally_initiated*/) {} +static void mock_connection_classic_on_connected(const RawAddress& /*bda*/, uint16_t /*handle*/, + uint8_t /*enc_mode*/, bool /*locally_initiated*/) { +} -void mock_connection_classic_on_failed(const RawAddress& /*bda*/, tHCI_STATUS /*status*/, - bool /*locally_initiated*/) {} +static void mock_connection_classic_on_failed(const RawAddress& /*bda*/, tHCI_STATUS /*status*/, + bool /*locally_initiated*/) {} -void mock_connection_classic_on_disconnected(tHCI_STATUS /*status*/, uint16_t handle, - tHCI_STATUS /*reason*/) { +static void mock_connection_classic_on_disconnected(tHCI_STATUS /*status*/, uint16_t handle, + tHCI_STATUS /*reason*/) { ASSERT_TRUE(mock_function_handle_promise_map.find(__func__) != mock_function_handle_promise_map.end()); mock_function_handle_promise_map[__func__].set_value(handle); } -void mock_connection_le_on_connected(const tBLE_BD_ADDR& /*address_with_type*/, uint16_t /*handle*/, - tHCI_ROLE /*role*/, uint16_t /*conn_interval*/, - uint16_t /*conn_latency*/, uint16_t /*conn_timeout*/, - const RawAddress& /*local_rpa*/, - const RawAddress& /*peer_rpa*/, - tBLE_ADDR_TYPE /*peer_addr_type*/, - bool /*can_read_discoverable_characteristics*/) {} -void mock_connection_le_on_failed(const tBLE_BD_ADDR& /*address_with_type*/, uint16_t /*handle*/, - bool /*enhanced*/, tHCI_STATUS /*status*/) {} +static void mock_connection_le_on_connected( + const tBLE_BD_ADDR& /*address_with_type*/, uint16_t /*handle*/, tHCI_ROLE /*role*/, + uint16_t /*conn_interval*/, uint16_t /*conn_latency*/, uint16_t /*conn_timeout*/, + const RawAddress& /*local_rpa*/, const RawAddress& /*peer_rpa*/, + tBLE_ADDR_TYPE /*peer_addr_type*/, bool /*can_read_discoverable_characteristics*/) {} +static void mock_connection_le_on_failed(const tBLE_BD_ADDR& /*address_with_type*/, + uint16_t /*handle*/, bool /*enhanced*/, + tHCI_STATUS /*status*/) {} static std::promise<uint16_t> mock_connection_le_on_disconnected_promise; -void mock_connection_le_on_disconnected(tHCI_STATUS /*status*/, uint16_t handle, - tHCI_STATUS /*reason*/) { +static void mock_connection_le_on_disconnected(tHCI_STATUS /*status*/, uint16_t handle, + tHCI_STATUS /*reason*/) { mock_connection_le_on_disconnected_promise.set_value(handle); } -void mock_link_classic_on_read_remote_extended_features_complete(uint16_t /*handle*/, - uint8_t /*current_page_number*/, - uint8_t /*max_page_number*/, - uint64_t /*features*/) {} +static void mock_link_classic_on_read_remote_extended_features_complete( + uint16_t /*handle*/, uint8_t /*current_page_number*/, uint8_t /*max_page_number*/, + uint64_t /*features*/) {} shim::acl_interface_t acl_interface{ .on_send_data_upwards = mock_on_send_data_upwards, @@ -201,12 +198,7 @@ shim::acl_interface_t acl_interface{ .link.le.on_read_remote_version_information_complete = nullptr, }; -const shim::acl_interface_t& GetMockAclInterface() { return acl_interface; } - -struct hci_packet_parser_t; -const hci_packet_parser_t* hci_packet_parser_get_interface() { return nullptr; } -struct hci_t; -struct packet_fragmenter_t; +static const shim::acl_interface_t& GetMockAclInterface() { return acl_interface; } const packet_fragmenter_t* packet_fragmenter_get_interface() { return nullptr; } template <typename T> @@ -709,7 +701,6 @@ TEST_F(MainShimTest, OnConnectRequest) { acl->OnConnectRequest(kAddress, kCod); } -void DumpsysNeighbor(int fd); TEST_F(MainShimTest, DumpsysNeighbor) { btm_cb.neighbor = {}; diff --git a/system/osi/Android.bp b/system/osi/Android.bp index 23055416f2..519d0594a8 100644 --- a/system/osi/Android.bp +++ b/system/osi/Android.bp @@ -62,7 +62,6 @@ cc_library_static { "src/socket_utils/socket_local_server.cc", "src/stack_power_telemetry.cc", "src/thread.cc", - "src/thread_scheduler.cc", "src/wakelock.cc", // internal source that should not be used outside of libosi diff --git a/system/osi/include/properties.h b/system/osi/include/properties.h index 975574e294..6e13a665d6 100644 --- a/system/osi/include/properties.h +++ b/system/osi/include/properties.h @@ -52,6 +52,7 @@ int32_t osi_property_get_int32(const char* key, int32_t default_value); // returns the value of |key| coerced into a bool. If the property is not set, // then the |default_value| is used. bool osi_property_get_bool(const char* key, bool default_value); +void osi_property_set_bool(const char* key, bool value); // Helper function that returns the value of |key| coerced into a vector of // uint32_t. If the property is not set, then the |default_value| is used. diff --git a/system/osi/src/list.cc b/system/osi/src/list.cc index d361b18ef9..97b5390031 100644 --- a/system/osi/src/list.cc +++ b/system/osi/src/list.cc @@ -4,9 +4,6 @@ #include "osi/include/allocator.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; struct list_node_t { @@ -27,7 +24,7 @@ static list_node_t* list_free_node_(list_t* list, list_node_t* node); // Hidden constructor, only to be used by the hash map for the allocation // tracker. // Behaves the same as |list_new|, except you get to specify the allocator. -list_t* list_new_internal(list_free_cb callback, const allocator_t* zeroed_allocator) { +static list_t* list_new_internal(list_free_cb callback, const allocator_t* zeroed_allocator) { list_t* list = (list_t*)zeroed_allocator->alloc(sizeof(list_t)); if (!list) { return NULL; diff --git a/system/osi/src/stack_power_telemetry.cc b/system/osi/src/stack_power_telemetry.cc index 52d5bfcd2a..678db755da 100644 --- a/system/osi/src/stack_power_telemetry.cc +++ b/system/osi/src/stack_power_telemetry.cc @@ -34,12 +34,9 @@ #include "stack/include/btm_status.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; -time_t get_current_time() { return time(0); } +static time_t get_current_time() { return time(0); } namespace { diff --git a/system/osi/src/thread_scheduler.cc b/system/osi/src/thread_scheduler.cc deleted file mode 100644 index e67b9c662a..0000000000 --- a/system/osi/src/thread_scheduler.cc +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <sched.h> -#include <sys/types.h> - -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -namespace { -constexpr int kRealTimeFifoSchedulingPriority = 1; -} // namespace - -bool thread_scheduler_enable_real_time(pid_t linux_tid) { - struct sched_param rt_params = {.sched_priority = kRealTimeFifoSchedulingPriority}; - return sched_setscheduler(linux_tid, SCHED_FIFO, &rt_params) == 0; -} - -bool thread_scheduler_get_priority_range(int& min, int& max) { - min = sched_get_priority_min(SCHED_FIFO); - max = sched_get_priority_max(SCHED_FIFO); - return (min != -1 && max != -1) ? true : false; -} diff --git a/system/osi/test/alarm_test.cc b/system/osi/test/alarm_test.cc index cf98d2dcdc..14ca9cb056 100644 --- a/system/osi/test/alarm_test.cc +++ b/system/osi/test/alarm_test.cc @@ -27,9 +27,7 @@ #include "osi/include/osi.h" #include "osi/include/wakelock.h" #include "osi/semaphore.h" - -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#include "stack/include/main_thread.h" using base::Closure; using bluetooth::common::MessageLoopThread; diff --git a/system/packet/tests/fuzzers/reject_packet_fuzzer.cc b/system/packet/tests/fuzzers/reject_packet_fuzzer.cc index b06b73f55c..5c0ae1d3c7 100644 --- a/system/packet/tests/fuzzers/reject_packet_fuzzer.cc +++ b/system/packet/tests/fuzzers/reject_packet_fuzzer.cc @@ -22,9 +22,6 @@ #include "avrcp_test_packets.h" #include "packet_test_helper.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace bluetooth { namespace avrcp { diff --git a/system/profile/avrcp/Android.bp b/system/profile/avrcp/Android.bp index 6ea0ea1abb..b75d6da69b 100644 --- a/system/profile/avrcp/Android.bp +++ b/system/profile/avrcp/Android.bp @@ -98,6 +98,9 @@ cc_fuzz { defaults: [ "fluoride_defaults", ], + cflags: [ + "-Wno-missing-prototypes", + ], srcs: [ "tests/avrcp_device_fuzz/avrcp_device_fuzz.cc", ], diff --git a/system/profile/avrcp/connection_handler.cc b/system/profile/avrcp/connection_handler.cc index 0851b3320b..5e034e2133 100644 --- a/system/profile/avrcp/connection_handler.cc +++ b/system/profile/avrcp/connection_handler.cc @@ -38,9 +38,6 @@ #include "stack/include/sdp_status.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - extern bool btif_av_peer_is_connected_sink(const RawAddress& peer_address); extern bool btif_av_peer_is_connected_source(const RawAddress& peer_address); extern bool btif_av_both_enable(void); @@ -63,7 +60,7 @@ ConnectionHandler* ConnectionHandler::Get() { return instance_; } -bool IsAbsoluteVolumeEnabled(const RawAddress* bdaddr) { +static bool IsAbsoluteVolumeEnabled(const RawAddress* bdaddr) { char volume_disabled[PROPERTY_VALUE_MAX] = {0}; osi_property_get("persist.bluetooth.disableabsvol", volume_disabled, "false"); if (strncmp(volume_disabled, "true", 4) == 0) { diff --git a/system/profile/avrcp/device.cc b/system/profile/avrcp/device.cc index d094108d8a..dbf67e60ca 100644 --- a/system/profile/avrcp/device.cc +++ b/system/profile/avrcp/device.cc @@ -23,6 +23,7 @@ #include "abstract_message_loop.h" #include "avrcp_common.h" +#include "btif/include/btif_av.h" #include "internal_include/stack_config.h" #include "packet/avrcp/avrcp_reject_packet.h" #include "packet/avrcp/general_reject_packet.h" @@ -36,13 +37,6 @@ #include "packet/avrcp/set_player_application_setting_value.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -extern bool btif_av_peer_is_connected_sink(const RawAddress& peer_address); -extern bool btif_av_both_enable(void); -extern bool btif_av_src_sink_coexist_enabled(void); - template <> struct std::formatter<bluetooth::avrcp::PlayState> : enum_formatter<bluetooth::avrcp::PlayState> {}; @@ -90,7 +84,7 @@ void Device::SetBipClientStatus(bool connected) { bool Device::HasBipClient() const { return has_bip_client_; } -void filter_cover_art(SongInfo& s) { +static void filter_cover_art(SongInfo& s) { for (auto it = s.attributes.begin(); it != s.attributes.end(); it++) { if (it->attribute() == Attribute::DEFAULT_COVER_ART) { s.attributes.erase(it); @@ -1395,8 +1389,8 @@ void Device::GetMediaPlayerListResponse(uint8_t label, std::shared_ptr<GetFolder send_message(label, true, std::move(builder)); } -std::set<AttributeEntry> filter_attributes_requested(const SongInfo& song, - const std::vector<Attribute>& attrs) { +static std::set<AttributeEntry> filter_attributes_requested(const SongInfo& song, + const std::vector<Attribute>& attrs) { std::set<AttributeEntry> result; for (const auto& attr : attrs) { if (song.attributes.find(attr) != song.attributes.end()) { diff --git a/system/profile/avrcp/tests/avrcp_connection_handler_test.cc b/system/profile/avrcp/tests/avrcp_connection_handler_test.cc index 54f78edcd4..45a10722ae 100644 --- a/system/profile/avrcp/tests/avrcp_connection_handler_test.cc +++ b/system/profile/avrcp/tests/avrcp_connection_handler_test.cc @@ -23,14 +23,12 @@ #include "avrcp_internal.h" #include "avrcp_test_helper.h" +#include "btif/include/btif_av.h" #include "connection_handler.h" #include "sdpdefs.h" #include "stack/include/sdp_status.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using ::testing::_; using ::testing::DoAll; using ::testing::MockFunction; diff --git a/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc b/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc index 3bfce3f1fa..39a6d776ea 100644 --- a/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc +++ b/system/profile/avrcp/tests/avrcp_device_fuzz/avrcp_device_fuzz.cc @@ -21,9 +21,6 @@ #include "packet_test_helper.h" #include "pass_through_packet.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool btif_av_src_sink_coexist_enabled(void) { return true; } namespace bluetooth { diff --git a/system/profile/avrcp/tests/avrcp_device_test.cc b/system/profile/avrcp/tests/avrcp_device_test.cc index 204a1e7548..209920817b 100644 --- a/system/profile/avrcp/tests/avrcp_device_test.cc +++ b/system/profile/avrcp/tests/avrcp_device_test.cc @@ -24,15 +24,13 @@ #include "avrcp_packet.h" #include "avrcp_test_helper.h" +#include "btif/include/btif_av.h" #include "device.h" #include "internal_include/stack_config.h" #include "tests/avrcp/avrcp_test_packets.h" #include "tests/packet_test_helper.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool btif_av_src_sink_coexist_enabled(void) { return true; } namespace bluetooth { @@ -52,7 +50,7 @@ using ::testing::NiceMock; using ::testing::Return; using ::testing::SaveArg; -bool get_pts_avrcp_test(void) { return false; } +static bool get_pts_avrcp_test(void) { return false; } const stack_config_t interface = {get_pts_avrcp_test, nullptr, diff --git a/system/stack/Android.bp b/system/stack/Android.bp index 13d7984359..96915e3a5a 100644 --- a/system/stack/Android.bp +++ b/system/stack/Android.bp @@ -1422,6 +1422,7 @@ cc_test { "libprotobuf-cpp-lite", ], static_libs: [ + "bluetooth_flags_c_lib", "libFraunhoferAAC", "libbase", "libbluetooth-types", diff --git a/system/stack/btm/btm_sec.cc b/system/stack/btm/btm_sec.cc index 2ee496e5e5..e181349129 100644 --- a/system/stack/btm/btm_sec.cc +++ b/system/stack/btm/btm_sec.cc @@ -1979,7 +1979,7 @@ void btm_create_conn_cancel_complete(uint8_t status, const RawAddress bd_addr) { * Returns void * ******************************************************************************/ -void btm_sec_check_pending_reqs(void) { +static void btm_sec_check_pending_reqs(void) { if (btm_sec_cb.pairing_state == BTM_PAIR_STATE_IDLE) { /* First, resubmit L2CAP requests */ if (btm_sec_cb.sec_req_pending) { diff --git a/system/stack/l2cap/l2c_int.h b/system/stack/l2cap/l2c_int.h index 639cee872e..c1bffc1533 100644 --- a/system/stack/l2cap/l2c_int.h +++ b/system/stack/l2cap/l2c_int.h @@ -758,6 +758,7 @@ bool l2cu_initialize_fixed_ccb(tL2C_LCB* p_lcb, uint16_t fixed_cid); void l2cu_no_dynamic_ccbs(tL2C_LCB* p_lcb); void l2cu_process_fixed_chnl_resp(tL2C_LCB* p_lcb); bool l2cu_is_ccb_active(tL2C_CCB* p_ccb); +void l2cu_set_lcb_handle(tL2C_LCB& p_lcb, uint16_t handle); tL2CAP_CONN le_result_to_l2c_conn(tL2CAP_LE_RESULT_CODE result); /* Functions provided for Broadcom Aware diff --git a/system/stack/sdp/sdp_api.cc b/system/stack/sdp/sdp_api.cc index 2380b76043..c7bdf76a31 100644 --- a/system/stack/sdp/sdp_api.cc +++ b/system/stack/sdp/sdp_api.cc @@ -1113,8 +1113,6 @@ bluetooth::legacy::stack::sdp::get_legacy_stack_sdp_api() { return &api_; } -extern void BTA_SdpDumpsys(int fd); - #define DUMPSYS_TAG "shim::legacy::sdp" namespace { diff --git a/system/test/common/jni_thread.cc b/system/test/common/jni_thread.cc index db1520d36b..ca26fa39da 100644 --- a/system/test/common/jni_thread.cc +++ b/system/test/common/jni_thread.cc @@ -21,9 +21,6 @@ #include <map> -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - std::queue<base::OnceClosure> do_in_jni_thread_task_queue; void run_one_jni_thread_task() { @@ -39,9 +36,3 @@ void run_all_jni_thread_task() { run_one_jni_thread_task(); } } - -void reset_mock_jni_thread_queue() { - while (do_in_jni_thread_task_queue.size()) { - do_in_jni_thread_task_queue.pop(); - } -} diff --git a/system/test/common/main_handler.cc b/system/test/common/main_handler.cc index c6e792c4dc..b55c94a250 100644 --- a/system/test/common/main_handler.cc +++ b/system/test/common/main_handler.cc @@ -14,6 +14,8 @@ * limitations under the License. */ +#include "main_handler.h" + #include <base/functional/bind.h> #include <base/functional/callback_forward.h> #include <base/location.h> @@ -28,9 +30,6 @@ #include "common/postable_context.h" #include "include/hardware/bluetooth.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using bluetooth::common::MessageLoopThread; using BtMainClosure = std::function<void()>; diff --git a/system/test/common/stack_config.cc b/system/test/common/stack_config.cc index c1bc7e7ae7..0bf74fa2e3 100644 --- a/system/test/common/stack_config.cc +++ b/system/test/common/stack_config.cc @@ -22,36 +22,36 @@ #include <cstdarg> #include <cstring> -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" +#include "hci/include/packet_fragmenter.h" +#include "internal_include/stack_config.h" -const std::string kSmpOptions("mock smp options"); -const std::string kBroadcastAudioConfigOptions("mock broadcast audio config options"); -bool get_pts_avrcp_test(void) { return false; } -bool get_pts_secure_only_mode(void) { return false; } -bool get_pts_conn_updates_disabled(void) { return false; } -bool get_pts_crosskey_sdp_disable(void) { return false; } -const std::string* get_pts_smp_options(void) { return &kSmpOptions; } -int get_pts_smp_failure_case(void) { return 123; } -bool get_pts_force_eatt_for_notifications(void) { return false; } -bool get_pts_connect_eatt_unconditionally(void) { return false; } -bool get_pts_connect_eatt_before_encryption(void) { return false; } -bool get_pts_unencrypt_broadcast(void) { return false; } -bool get_pts_eatt_peripheral_collision_support(void) { return false; } -bool get_pts_use_eatt_for_all_services(void) { return false; } -bool get_pts_force_le_audio_multiple_contexts_metadata(void) { return false; } -bool get_pts_l2cap_ecoc_upper_tester(void) { return false; } -int get_pts_l2cap_ecoc_min_key_size(void) { return -1; } -int get_pts_l2cap_ecoc_initial_chan_cnt(void) { return -1; } -bool get_pts_l2cap_ecoc_connect_remaining(void) { return false; } -int get_pts_l2cap_ecoc_send_num_of_sdu(void) { return -1; } -bool get_pts_l2cap_ecoc_reconfigure(void) { return false; } -const std::string* get_pts_broadcast_audio_config_options(void) { +static const std::string kSmpOptions("mock smp options"); +static const std::string kBroadcastAudioConfigOptions("mock broadcast audio config options"); +static bool get_pts_avrcp_test(void) { return false; } +static bool get_pts_secure_only_mode(void) { return false; } +static bool get_pts_conn_updates_disabled(void) { return false; } +static bool get_pts_crosskey_sdp_disable(void) { return false; } +static const std::string* get_pts_smp_options(void) { return &kSmpOptions; } +static int get_pts_smp_failure_case(void) { return 123; } +static bool get_pts_force_eatt_for_notifications(void) { return false; } +static bool get_pts_connect_eatt_unconditionally(void) { return false; } +static bool get_pts_connect_eatt_before_encryption(void) { return false; } +static bool get_pts_unencrypt_broadcast(void) { return false; } +static bool get_pts_eatt_peripheral_collision_support(void) { return false; } +static bool get_pts_use_eatt_for_all_services(void) { return false; } +static bool get_pts_force_le_audio_multiple_contexts_metadata(void) { return false; } +static bool get_pts_l2cap_ecoc_upper_tester(void) { return false; } +static int get_pts_l2cap_ecoc_min_key_size(void) { return -1; } +static int get_pts_l2cap_ecoc_initial_chan_cnt(void) { return -1; } +static bool get_pts_l2cap_ecoc_connect_remaining(void) { return false; } +static int get_pts_l2cap_ecoc_send_num_of_sdu(void) { return -1; } +static bool get_pts_l2cap_ecoc_reconfigure(void) { return false; } +static const std::string* get_pts_broadcast_audio_config_options(void) { return &kBroadcastAudioConfigOptions; } -bool get_pts_le_audio_disable_ases_before_stopping(void) { return false; } +static bool get_pts_le_audio_disable_ases_before_stopping(void) { return false; } struct config_t; -config_t* get_all(void) { return nullptr; } +static config_t* get_all(void) { return nullptr; } struct packet_fragmenter_t; const packet_fragmenter_t* packet_fragmenter_get_interface() { return nullptr; } diff --git a/system/test/common/sync_main_handler.cc b/system/test/common/sync_main_handler.cc index 1b6219e761..8bbefb4ff9 100644 --- a/system/test/common/sync_main_handler.cc +++ b/system/test/common/sync_main_handler.cc @@ -14,14 +14,13 @@ * limitations under the License. */ +#include "test/common/sync_main_handler.h" + #include <chrono> #include <future> #include "stack/include/main_thread.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - constexpr int sync_timeout_in_ms = 3000; void sync_main_handler() { diff --git a/system/test/fake/fake_looper.cc b/system/test/fake/fake_looper.cc index b7d94dd849..123ba7768b 100644 --- a/system/test/fake/fake_looper.cc +++ b/system/test/fake/fake_looper.cc @@ -27,10 +27,7 @@ #include "osi/include/allocator.h" #include "test/fake/fake_thread.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -pid_t get_thread_id() { +static pid_t get_thread_id() { #if defined(OS_MACOSX) return pthread_mach_thread_np(pthread_self()); #elif defined(OS_LINUX) diff --git a/system/test/headless/headless.cc b/system/test/headless/headless.cc index d257b28e6d..753edd15fd 100644 --- a/system/test/headless/headless.cc +++ b/system/test/headless/headless.cc @@ -32,9 +32,6 @@ #include "test/headless/messenger.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // // Aggregate disparate variables from callback API into unified single structure // @@ -69,12 +66,13 @@ std::mutex adapter_state_mutex_; std::condition_variable adapter_state_cv_; bt_state_t bt_state_{BT_STATE_OFF}; -void adapter_state_changed(bt_state_t state) { +static void adapter_state_changed(bt_state_t state) { std::unique_lock<std::mutex> lck(adapter_state_mutex_); bt_state_ = state; adapter_state_cv_.notify_all(); } -void adapter_properties(bt_status_t status, int num_properties, ::bt_property_t* properties) { +static void adapter_properties(bt_status_t status, int num_properties, + ::bt_property_t* properties) { const size_t num_callbacks = interface_api_callback_map_.size(); auto callback_list = interface_api_callback_map_.find(__func__); if (callback_list != interface_api_callback_map_.end()) { @@ -87,8 +85,8 @@ void adapter_properties(bt_status_t status, int num_properties, ::bt_property_t* bt_status_text(status), num_properties, std::format_ptr(properties)); } -void remote_device_properties(bt_status_t status, RawAddress* bd_addr, int num_properties, - ::bt_property_t* properties) { +static void remote_device_properties(bt_status_t status, RawAddress* bd_addr, int num_properties, + ::bt_property_t* properties) { log::assert_that(bd_addr != nullptr, "assert failed: bd_addr != nullptr"); const size_t num_callbacks = interface_api_callback_map_.size(); auto callback_list = interface_api_callback_map_.find(__func__); @@ -104,7 +102,7 @@ void remote_device_properties(bt_status_t status, RawAddress* bd_addr, int num_p } // Aggregate disparate variables from callback API into unified single structure -void device_found(int num_properties, ::bt_property_t* properties) { +static void device_found(int num_properties, ::bt_property_t* properties) { [[maybe_unused]] const size_t num_callbacks = interface_api_callback_map_.size(); auto callback_list = interface_api_callback_map_.find(__func__); if (callback_list != interface_api_callback_map_.end()) { @@ -117,7 +115,7 @@ void device_found(int num_properties, ::bt_property_t* properties) { std::format_ptr(properties)); } -void discovery_state_changed(bt_discovery_state_t state) { +static void discovery_state_changed(bt_discovery_state_t state) { auto callback_list = interface_api_callback_map_.find(__func__); if (callback_list != interface_api_callback_map_.end()) { for (auto callback : callback_list->second) { @@ -128,40 +126,42 @@ void discovery_state_changed(bt_discovery_state_t state) { } /** Bluetooth Legacy PinKey Request callback */ -void pin_request([[maybe_unused]] RawAddress* remote_bd_addr, [[maybe_unused]] bt_bdname_t* bd_name, - [[maybe_unused]] uint32_t cod, [[maybe_unused]] bool min_16_digit) { +static void pin_request([[maybe_unused]] RawAddress* remote_bd_addr, + [[maybe_unused]] bt_bdname_t* bd_name, [[maybe_unused]] uint32_t cod, + [[maybe_unused]] bool min_16_digit) { log::info(""); } -void ssp_request([[maybe_unused]] RawAddress* remote_bd_addr, - [[maybe_unused]] bt_ssp_variant_t pairing_variant, - [[maybe_unused]] uint32_t pass_key) { +static void ssp_request([[maybe_unused]] RawAddress* remote_bd_addr, + [[maybe_unused]] bt_ssp_variant_t pairing_variant, + [[maybe_unused]] uint32_t pass_key) { log::info(""); } /** Bluetooth Bond state changed callback */ /* Invoked in response to create_bond, cancel_bond or remove_bond */ -void bond_state_changed([[maybe_unused]] bt_status_t status, - [[maybe_unused]] RawAddress* remote_bd_addr, - [[maybe_unused]] bt_bond_state_t state, [[maybe_unused]] int fail_reason) { +static void bond_state_changed([[maybe_unused]] bt_status_t status, + [[maybe_unused]] RawAddress* remote_bd_addr, + [[maybe_unused]] bt_bond_state_t state, + [[maybe_unused]] int fail_reason) { log::info(""); } -void address_consolidate([[maybe_unused]] RawAddress* main_bd_addr, - [[maybe_unused]] RawAddress* secondary_bd_addr) { +static void address_consolidate([[maybe_unused]] RawAddress* main_bd_addr, + [[maybe_unused]] RawAddress* secondary_bd_addr) { log::info(""); } -void le_address_associate([[maybe_unused]] RawAddress* main_bd_addr, - [[maybe_unused]] RawAddress* secondary_bd_addr, - [[maybe_unused]] uint8_t identity_address_type) { +static void le_address_associate([[maybe_unused]] RawAddress* main_bd_addr, + [[maybe_unused]] RawAddress* secondary_bd_addr, + [[maybe_unused]] uint8_t identity_address_type) { log::info(""); } /** Bluetooth ACL connection state changed callback */ -void acl_state_changed(bt_status_t status, RawAddress* remote_bd_addr, bt_acl_state_t state, - int transport_link_type, bt_hci_error_code_t hci_reason, - bt_conn_direction_t direction, uint16_t acl_handle) { +static void acl_state_changed(bt_status_t status, RawAddress* remote_bd_addr, bt_acl_state_t state, + int transport_link_type, bt_hci_error_code_t hci_reason, + bt_conn_direction_t direction, uint16_t acl_handle) { log::assert_that(remote_bd_addr != nullptr, "assert failed: remote_bd_addr != nullptr"); const size_t num_callbacks = interface_api_callback_map_.size(); auto callback_list = interface_api_callback_map_.find(__func__); @@ -178,33 +178,34 @@ void acl_state_changed(bt_status_t status, RawAddress* remote_bd_addr, bt_acl_st } /** Bluetooth Link Quality Report callback */ -void link_quality_report([[maybe_unused]] uint64_t timestamp, [[maybe_unused]] int report_id, - [[maybe_unused]] int rssi, [[maybe_unused]] int snr, - [[maybe_unused]] int retransmission_count, - [[maybe_unused]] int packets_not_receive_count, - [[maybe_unused]] int negative_acknowledgement_count) { +static void link_quality_report([[maybe_unused]] uint64_t timestamp, [[maybe_unused]] int report_id, + [[maybe_unused]] int rssi, [[maybe_unused]] int snr, + [[maybe_unused]] int retransmission_count, + [[maybe_unused]] int packets_not_receive_count, + [[maybe_unused]] int negative_acknowledgement_count) { log::info(""); } /** Switch buffer size callback */ -void switch_buffer_size([[maybe_unused]] bool is_low_latency_buffer_size) { log::info(""); } +static void switch_buffer_size([[maybe_unused]] bool is_low_latency_buffer_size) { log::info(""); } /** Switch codec callback */ -void switch_codec([[maybe_unused]] bool is_low_latency_buffer_size) { log::info(""); } +static void switch_codec([[maybe_unused]] bool is_low_latency_buffer_size) { log::info(""); } -void thread_event([[maybe_unused]] bt_cb_thread_evt evt) { log::info(""); } +static void thread_event([[maybe_unused]] bt_cb_thread_evt evt) { log::info(""); } -void dut_mode_recv([[maybe_unused]] uint16_t opcode, [[maybe_unused]] uint8_t* buf, - [[maybe_unused]] uint8_t len) { +static void dut_mode_recv([[maybe_unused]] uint16_t opcode, [[maybe_unused]] uint8_t* buf, + [[maybe_unused]] uint8_t len) { log::info(""); } -void le_test_mode([[maybe_unused]] bt_status_t status, [[maybe_unused]] uint16_t num_packets) { +static void le_test_mode([[maybe_unused]] bt_status_t status, + [[maybe_unused]] uint16_t num_packets) { log::info(""); } -void energy_info([[maybe_unused]] bt_activity_energy_info* energy_info, - [[maybe_unused]] bt_uid_traffic_t* uid_data) { +static void energy_info([[maybe_unused]] bt_activity_energy_info* energy_info, + [[maybe_unused]] bt_uid_traffic_t* uid_data) { log::info(""); } @@ -233,12 +234,12 @@ bt_callbacks_t bt_callbacks{ // HAL HARDWARE CALLBACKS // OS CALLOUTS -int acquire_wake_lock_co([[maybe_unused]] const char* lock_name) { +static int acquire_wake_lock_co([[maybe_unused]] const char* lock_name) { log::info(""); return 1; } -int release_wake_lock_co([[maybe_unused]] const char* lock_name) { +static int release_wake_lock_co([[maybe_unused]] const char* lock_name) { log::info(""); return 0; } diff --git a/system/test/headless/log.cc b/system/test/headless/log.cc index a14368bb2a..0ed78bd8ba 100644 --- a/system/test/headless/log.cc +++ b/system/test/headless/log.cc @@ -14,6 +14,8 @@ * limitations under the License. */ +#include "log.h" + #include <chrono> #include <ctime> #include <string> @@ -22,9 +24,6 @@ #include "internal_include/bt_trace.h" #include "stack/btm/btm_int_types.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - std::chrono::system_clock::time_point _prev = std::chrono::system_clock::now(); extern tBTM_CB btm_cb; diff --git a/system/test/headless/messenger.cc b/system/test/headless/messenger.cc index 4e84ad1c49..5dc2e94c6e 100644 --- a/system/test/headless/messenger.cc +++ b/system/test/headless/messenger.cc @@ -26,9 +26,6 @@ #include "test/headless/interface.h" #include "test/headless/log.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth::test::headless; using namespace std::chrono_literals; @@ -96,7 +93,7 @@ bool await_callback(Context& context) { namespace bluetooth::test::headless { -void messenger_stats() { +static void messenger_stats() { // LOG_CONSOLE("%30s cnt:%zu", "device_found", // discovered::device_found_.size()); LOG_CONSOLE("%30s cnt:%zu", // "remote_device_properties", diff --git a/system/test/headless/read/name.cc b/system/test/headless/read/name.cc index 0dc5aa38b7..e37e0760c0 100644 --- a/system/test/headless/read/name.cc +++ b/system/test/headless/read/name.cc @@ -29,12 +29,9 @@ #include "test/headless/headless.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - std::promise<tBTM_REMOTE_DEV_NAME> promise_; -void RemoteNameCallback(const tBTM_REMOTE_DEV_NAME* data) { promise_.set_value(*data); } +static void RemoteNameCallback(const tBTM_REMOTE_DEV_NAME* data) { promise_.set_value(*data); } int bluetooth::test::headless::Name::Run() { if (options_.loop_ < 1) { diff --git a/system/test/headless/util.cc b/system/test/headless/util.cc index 8c18a3893f..0e6d479df2 100644 --- a/system/test/headless/util.cc +++ b/system/test/headless/util.cc @@ -14,14 +14,13 @@ * limitations under the License. */ +#include "test/headless/util.h" + #include <string> #include "include/hardware/bluetooth.h" #include "osi/include/properties.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool is_android_running() { #ifdef __ANDROID__ char value[PROPERTY_VALUE_MAX]; diff --git a/system/test/mock/mock_audio_hal_interface_a2dp_encoding.cc b/system/test/mock/mock_audio_hal_interface_a2dp_encoding.cc index d5ccf7984c..b97a346e16 100644 --- a/system/test/mock/mock_audio_hal_interface_a2dp_encoding.cc +++ b/system/test/mock/mock_audio_hal_interface_a2dp_encoding.cc @@ -34,9 +34,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace audio_hal_interface_a2dp_encoding { diff --git a/system/test/mock/mock_bluetooth_interface.cc b/system/test/mock/mock_bluetooth_interface.cc index 2dda1267b1..c2fb27cb40 100644 --- a/system/test/mock/mock_bluetooth_interface.cc +++ b/system/test/mock/mock_bluetooth_interface.cc @@ -17,14 +17,12 @@ #include <cstdint> #include <future> +#include "btif/include/btif_common.h" #include "btif/include/stack_manager_t.h" #include "hardware/bluetooth.h" #include "stack/include/bt_octets.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void invoke_adapter_state_changed_cb(bt_state_t /* state */) {} void invoke_adapter_properties_cb(bt_status_t /* status */, int /* num_properties */, bt_property_t* /* properties */) {} diff --git a/system/test/mock/mock_bta_ag_api.cc b/system/test/mock/mock_bta_ag_api.cc index f59d2e4ed5..00a32ad0f2 100644 --- a/system/test/mock/mock_bta_ag_api.cc +++ b/system/test/mock/mock_bta_ag_api.cc @@ -27,12 +27,10 @@ #include <vector> #include "bta/include/bta_ag_api.h" +#include "bta/include/bta_ag_swb_aptx.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - tBTA_STATUS BTA_AgEnable(tBTA_AG_CBACK* /* p_cback */) { inc_func_call_count(__func__); return BTA_SUCCESS; diff --git a/system/test/mock/mock_bta_ag_sco.cc b/system/test/mock/mock_bta_ag_sco.cc index b290955c6a..7e853a64fc 100644 --- a/system/test/mock/mock_bta_ag_sco.cc +++ b/system/test/mock/mock_bta_ag_sco.cc @@ -27,9 +27,6 @@ #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Original usings using HfpInterface = bluetooth::audio::hfp::HfpClientInterface; using namespace bluetooth; @@ -64,7 +61,6 @@ struct bta_ag_set_sco_allowed bta_ag_set_sco_allowed; struct bta_ag_set_sco_offload_enabled bta_ag_set_sco_offload_enabled; struct bta_ag_stream_suspended bta_ag_stream_suspended; struct bta_clear_active_device bta_clear_active_device; -struct updateCodecParametersFromProviderInfo updateCodecParametersFromProviderInfo; } // namespace bta_ag_sco } // namespace mock @@ -181,10 +177,5 @@ void bta_clear_active_device() { inc_func_call_count(__func__); test::mock::bta_ag_sco::bta_clear_active_device(); } -void updateCodecParametersFromProviderInfo(tBTA_AG_UUID_CODEC esco_codec, - enh_esco_params_t& params) { - inc_func_call_count(__func__); - test::mock::bta_ag_sco::updateCodecParametersFromProviderInfo(esco_codec, params); -} // Mocked functions complete // END mockcify generation diff --git a/system/test/mock/mock_bta_ag_sco.h b/system/test/mock/mock_bta_ag_sco.h index 11f40a758a..f83d9de537 100644 --- a/system/test/mock/mock_bta_ag_sco.h +++ b/system/test/mock/mock_bta_ag_sco.h @@ -293,18 +293,6 @@ struct bta_clear_active_device { }; extern struct bta_clear_active_device bta_clear_active_device; -// Name: updateCodecParametersFromProviderInfo -// Params: tBTA_AG_UUID_CODEC esco_codec, enh_esco_params_t& params -// Return: void -struct updateCodecParametersFromProviderInfo { - std::function<void(tBTA_AG_UUID_CODEC esco_codec, enh_esco_params_t& params)> body{ - [](tBTA_AG_UUID_CODEC /* esco_codec */, enh_esco_params_t& /* params */) {}}; - void operator()(tBTA_AG_UUID_CODEC esco_codec, enh_esco_params_t& params) { - body(esco_codec, params); - } -}; -extern struct updateCodecParametersFromProviderInfo updateCodecParametersFromProviderInfo; - } // namespace bta_ag_sco } // namespace mock } // namespace test diff --git a/system/test/mock/mock_bta_ar.cc b/system/test/mock/mock_bta_ar.cc index b0b181e6d8..3c9961f3cc 100644 --- a/system/test/mock/mock_bta_ar.cc +++ b/system/test/mock/mock_bta_ar.cc @@ -21,14 +21,12 @@ #include <cstdint> +#include "bta/include/bta_ar_api.h" #include "bta/sys/bta_sys.h" #include "stack/include/avdt_api.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void bta_ar_dereg_avct() { inc_func_call_count(__func__); } void bta_ar_dereg_avdt() { inc_func_call_count(__func__); } void bta_ar_dereg_avrc(uint16_t /* service_uuid */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_bta_av_ci.cc b/system/test/mock/mock_bta_av_ci.cc index 07da047861..9bc0f119b1 100644 --- a/system/test/mock/mock_bta_av_ci.cc +++ b/system/test/mock/mock_bta_av_ci.cc @@ -20,11 +20,9 @@ */ #include "bta/include/bta_av_api.h" +#include "bta/include/bta_av_ci.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void bta_av_ci_setconfig(tBTA_AV_HNDL /* bta_av_handle */, uint8_t /* err_code */, uint8_t /* category */, bool /* recfg_needed */, uint8_t /* avdt_handle */) { diff --git a/system/test/mock/mock_bta_dm_act.cc b/system/test/mock/mock_bta_dm_act.cc index 9f2686d4fd..65f70c0621 100644 --- a/system/test/mock/mock_bta_dm_act.cc +++ b/system/test/mock/mock_bta_dm_act.cc @@ -26,14 +26,16 @@ #include <cstdint> +#include "bta/dm/bta_dm_act.h" +#include "bta/dm/bta_dm_device_search.h" +#include "bta/dm/bta_dm_sec_int.h" +#include "bta/include/bta_dm_acl.h" +#include "bta/include/bta_dm_api.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_dm_act { @@ -74,7 +76,6 @@ struct bta_dm_process_remove_device bta_dm_process_remove_device; struct bta_dm_remove_device bta_dm_remove_device; struct bta_dm_remote_key_missing bta_dm_remote_key_missing; struct bta_dm_on_encryption_change bta_dm_on_encryption_change; -struct bta_dm_rm_cback bta_dm_rm_cback; struct bta_dm_set_dev_name bta_dm_set_dev_name; struct bta_dm_set_encryption bta_dm_set_encryption; @@ -206,7 +207,7 @@ void bta_dm_enable(tBTA_DM_SEC_CBACK* p_sec_cback) { inc_func_call_count(__func__); test::mock::bta_dm_act::bta_dm_enable(p_sec_cback); } -void bta_dm_encrypt_cback(const RawAddress* bd_addr, tBT_TRANSPORT transport, void* p_ref_data, +void bta_dm_encrypt_cback(RawAddress bd_addr, tBT_TRANSPORT transport, void* p_ref_data, tBTM_STATUS result) { inc_func_call_count(__func__); test::mock::bta_dm_act::bta_dm_encrypt_cback(bd_addr, transport, p_ref_data, result); @@ -235,11 +236,6 @@ void bta_dm_on_encryption_change(bt_encryption_change_evt encryption_change) { inc_func_call_count(__func__); test::mock::bta_dm_act::bta_dm_on_encryption_change(encryption_change); } -void bta_dm_rm_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, - const RawAddress& peer_addr) { - inc_func_call_count(__func__); - test::mock::bta_dm_act::bta_dm_rm_cback(status, id, app_id, peer_addr); -} void bta_dm_set_dev_name(const std::vector<uint8_t>& name) { inc_func_call_count(__func__); test::mock::bta_dm_act::bta_dm_set_dev_name(name); diff --git a/system/test/mock/mock_bta_dm_act.h b/system/test/mock/mock_bta_dm_act.h index df329a53af..ec81b0e62b 100644 --- a/system/test/mock/mock_bta_dm_act.h +++ b/system/test/mock/mock_bta_dm_act.h @@ -28,6 +28,7 @@ #include <cstdint> #include "bta/dm/bta_dm_disc_int.h" +#include "bta/dm/bta_dm_int.h" #include "bta/dm/bta_dm_sec_int.h" #include "types/raw_address.h" @@ -372,11 +373,11 @@ extern struct bta_dm_enable bta_dm_enable; // Params: const RawAddress* bd_addr, tBT_TRANSPORT transport, void* p_ref_data, // tBTM_STATUS result Return: void struct bta_dm_encrypt_cback { - std::function<void(const RawAddress* bd_addr, tBT_TRANSPORT transport, void* p_ref_data, + std::function<void(RawAddress bd_addr, tBT_TRANSPORT transport, void* p_ref_data, tBTM_STATUS result)> - body{[](const RawAddress* /* bd_addr */, tBT_TRANSPORT /* transport */, - void* /* p_ref_data */, tBTM_STATUS /* result */) {}}; - void operator()(const RawAddress* bd_addr, tBT_TRANSPORT transport, void* p_ref_data, + body{[](RawAddress /* bd_addr */, tBT_TRANSPORT /* transport */, void* /* p_ref_data */, + tBTM_STATUS /* result */) {}}; + void operator()(RawAddress bd_addr, tBT_TRANSPORT transport, void* p_ref_data, tBTM_STATUS result) { body(bd_addr, transport, p_ref_data, result); } @@ -440,21 +441,6 @@ struct bta_dm_on_encryption_change { }; extern struct bta_dm_on_encryption_change bta_dm_on_encryption_change; -// Name: bta_dm_rm_cback -// Params: tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, const -// RawAddress& peer_addr Return: void -struct bta_dm_rm_cback { - std::function<void(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, - const RawAddress& peer_addr)> - body{[](tBTA_SYS_CONN_STATUS /* status */, uint8_t /* id */, uint8_t /* app_id */, - const RawAddress& /* peer_addr */) {}}; - void operator()(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, - const RawAddress& peer_addr) { - body(status, id, app_id, peer_addr); - } -}; -extern struct bta_dm_rm_cback bta_dm_rm_cback; - // Name: bta_dm_search_cancel_cmpl // Params: // Return: void diff --git a/system/test/mock/mock_bta_dm_api.cc b/system/test/mock/mock_bta_dm_api.cc index 2d8129d0a5..1bf8009749 100644 --- a/system/test/mock/mock_bta_dm_api.cc +++ b/system/test/mock/mock_bta_dm_api.cc @@ -25,6 +25,8 @@ #include <cstdint> +#include "bta/include/bta_api.h" +#include "bta/include/bta_sec_api.h" #include "hci/le_rand_callback.h" #include "test/common/mock_functions.h" @@ -32,9 +34,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_dm_api { @@ -113,8 +112,8 @@ void BTA_DmAddBleKey(const RawAddress& bd_addr, tBTA_LE_KEY_VALUE* p_le_key, inc_func_call_count(__func__); test::mock::bta_dm_api::BTA_DmAddBleKey(bd_addr, p_le_key, key_type); } -void BTA_DmAddDevice(const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey& link_key, - uint8_t key_type, uint8_t pin_length) { +void BTA_DmAddDevice(RawAddress bd_addr, DEV_CLASS dev_class, LinkKey link_key, uint8_t key_type, + uint8_t pin_length) { inc_func_call_count(__func__); test::mock::bta_dm_api::BTA_DmAddDevice(bd_addr, dev_class, link_key, key_type, pin_length); } @@ -205,10 +204,10 @@ void BTA_DmDisconnectAllAcls() { inc_func_call_count(__func__); test::mock::bta_dm_api::BTA_DmDisconnectAllAcls(); } -void BTA_DmDiscover(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback, +void BTA_DmDiscover(const RawAddress& bd_addr, service_discovery_callbacks cbacks, tBT_TRANSPORT transport) { inc_func_call_count(__func__); - test::mock::bta_dm_api::BTA_DmDiscover(bd_addr, p_cback, transport); + test::mock::bta_dm_api::BTA_DmDiscover(bd_addr, cbacks, transport); } bool BTA_DmGetConnectionState(const RawAddress& bd_addr) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_bta_dm_api.h b/system/test/mock/mock_bta_dm_api.h index cbfad950fc..106bcd13bb 100644 --- a/system/test/mock/mock_bta_dm_api.h +++ b/system/test/mock/mock_bta_dm_api.h @@ -79,13 +79,12 @@ extern struct BTA_DmAddBleKey BTA_DmAddBleKey; // Params: const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey& // link_key, uint8_t key_type, uint8_t pin_length Return: void struct BTA_DmAddDevice { - std::function<void(const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey& link_key, - uint8_t key_type, uint8_t pin_length)> - body{[](const RawAddress& /* bd_addr */, DEV_CLASS /* dev_class */, - const LinkKey& /* link_key */, uint8_t /* key_type */, - uint8_t /* pin_length */) {}}; - void operator()(const RawAddress& bd_addr, DEV_CLASS dev_class, const LinkKey& link_key, - uint8_t key_type, uint8_t pin_length) { + std::function<void(RawAddress bd_addr, DEV_CLASS dev_class, LinkKey link_key, uint8_t key_type, + uint8_t pin_length)> + body{[](RawAddress /* bd_addr */, DEV_CLASS /* dev_class */, LinkKey /* link_key */, + uint8_t /* key_type */, uint8_t /* pin_length */) {}}; + void operator()(RawAddress bd_addr, DEV_CLASS dev_class, LinkKey link_key, uint8_t key_type, + uint8_t pin_length) { body(bd_addr, dev_class, link_key, key_type, pin_length); } }; @@ -315,13 +314,13 @@ extern struct BTA_DmDisconnectAllAcls BTA_DmDisconnectAllAcls; // Params: const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback, // tBT_TRANSPORT transport Return: void struct BTA_DmDiscover { - std::function<void(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback, + std::function<void(const RawAddress& bd_addr, service_discovery_callbacks cbacks, tBT_TRANSPORT transport)> - body{[](const RawAddress& /* bd_addr */, tBTA_DM_SEARCH_CBACK* /* p_cback */, + body{[](const RawAddress& /* bd_addr */, service_discovery_callbacks /* cbacks */, tBT_TRANSPORT /* transport */) {}}; - void operator()(const RawAddress& bd_addr, tBTA_DM_SEARCH_CBACK* p_cback, + void operator()(const RawAddress& bd_addr, service_discovery_callbacks cbacks, tBT_TRANSPORT transport) { - body(bd_addr, p_cback, transport); + body(bd_addr, cbacks, transport); } }; extern struct BTA_DmDiscover BTA_DmDiscover; diff --git a/system/test/mock/mock_bta_dm_main.cc b/system/test/mock/mock_bta_dm_main.cc index 4c559cba3c..a7ab35f7ea 100644 --- a/system/test/mock/mock_bta_dm_main.cc +++ b/system/test/mock/mock_bta_dm_main.cc @@ -23,15 +23,13 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_bta_dm_main.h" +#include "bta/include/bta_api.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_dm_main { diff --git a/system/test/mock/mock_bta_gattc_api.cc b/system/test/mock/mock_bta_gattc_api.cc index 6932102e84..126ad69267 100644 --- a/system/test/mock/mock_bta_gattc_api.cc +++ b/system/test/mock/mock_bta_gattc_api.cc @@ -22,6 +22,7 @@ #include <base/functional/bind.h> #include <base/functional/callback.h> +#include "bta/gatt/bta_gattc_int.h" #include "bta/gatt/database.h" #include "bta/include/bta_gatt_api.h" #include "stack/include/gatt_api.h" @@ -30,9 +31,6 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void BTA_GATTC_Disable(void) { inc_func_call_count(__func__); } const gatt::Characteristic* BTA_GATTC_GetCharacteristic(uint16_t /* conn_id */, uint16_t /* handle */) { diff --git a/system/test/mock/mock_bta_gatts_api.cc b/system/test/mock/mock_bta_gatts_api.cc index 3d57cbba78..c34f764acd 100644 --- a/system/test/mock/mock_bta_gatts_api.cc +++ b/system/test/mock/mock_bta_gatts_api.cc @@ -32,9 +32,6 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void BTA_GATTS_Disable(void) { inc_func_call_count(__func__); } void BTA_GATTS_AppDeregister(tGATT_IF /* server_if */) { inc_func_call_count(__func__); } void BTA_GATTS_AppRegister(const bluetooth::Uuid& /* app_uuid */, tBTA_GATTS_CBACK* /* p_cback */, diff --git a/system/test/mock/mock_bta_hh_utils.cc b/system/test/mock/mock_bta_hh_utils.cc index a922421242..f6aee6948c 100644 --- a/system/test/mock/mock_bta_hh_utils.cc +++ b/system/test/mock/mock_bta_hh_utils.cc @@ -30,9 +30,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_hh_utils { @@ -47,7 +44,6 @@ struct bta_hh_read_ssr_param bta_hh_read_ssr_param; struct bta_hh_tod_spt bta_hh_tod_spt; struct bta_hh_trace_dev_db bta_hh_trace_dev_db; struct bta_hh_update_di_info bta_hh_update_di_info; -struct bta_hh_le_is_hh_gatt_if bta_hh_le_is_hh_gatt_if; } // namespace bta_hh_utils } // namespace mock @@ -96,10 +92,5 @@ void bta_hh_update_di_info(tBTA_HH_DEV_CB* p_cb, uint16_t vendor_id, uint16_t pr test::mock::bta_hh_utils::bta_hh_update_di_info(p_cb, vendor_id, product_id, version, flag, ctry_code); } -bool bta_hh_le_is_hh_gatt_if(tGATT_IF client_if) { - inc_func_call_count(__func__); - test::mock::bta_hh_utils::bta_hh_le_is_hh_gatt_if(client_if); - return false; -} // Mocked functions complete // END mockcify generation diff --git a/system/test/mock/mock_bta_hh_utils.h b/system/test/mock/mock_bta_hh_utils.h index a46d616732..172392e832 100644 --- a/system/test/mock/mock_bta_hh_utils.h +++ b/system/test/mock/mock_bta_hh_utils.h @@ -146,17 +146,6 @@ struct bta_hh_update_di_info { }; extern struct bta_hh_update_di_info bta_hh_update_di_info; -// Name: bta_hh_le_is_hh_gatt_if -// Params: tGATT_IF client_if -// Return: bool -struct bta_hh_le_is_hh_gatt_if { - bool return_value{false}; - std::function<bool(tGATT_IF client_if)> body{ - [this](tGATT_IF /* client_if */) { return return_value; }}; - bool operator()(tGATT_IF client_if) { return body(client_if); } -}; -extern struct bta_hh_le_is_hh_gatt_if bta_hh_le_is_hh_gatt_if; - } // namespace bta_hh_utils } // namespace mock } // namespace test diff --git a/system/test/mock/mock_bta_pan_api.cc b/system/test/mock/mock_bta_pan_api.cc index 0e662c5d19..4f353f3aa1 100644 --- a/system/test/mock/mock_bta_pan_api.cc +++ b/system/test/mock/mock_bta_pan_api.cc @@ -25,9 +25,6 @@ #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void BTA_PanClose(uint16_t /* handle */) { inc_func_call_count(__func__); } void BTA_PanDisable(void) { inc_func_call_count(__func__); } void BTA_PanEnable(tBTA_PAN_CBACK /* p_cback */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_bta_sdp_api.cc b/system/test/mock/mock_bta_sdp_api.cc index 966920221a..a0facebc53 100644 --- a/system/test/mock/mock_bta_sdp_api.cc +++ b/system/test/mock/mock_bta_sdp_api.cc @@ -28,16 +28,12 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_sdp_api { // Function state capture and return values, if needed struct BTA_SdpCreateRecordByUser BTA_SdpCreateRecordByUser; -struct BTA_SdpDumpsys BTA_SdpDumpsys; struct BTA_SdpEnable BTA_SdpEnable; struct BTA_SdpRemoveRecordByUser BTA_SdpRemoveRecordByUser; struct BTA_SdpSearch BTA_SdpSearch; @@ -65,10 +61,6 @@ tBTA_SDP_STATUS BTA_SdpCreateRecordByUser(void* user_data) { inc_func_call_count(__func__); return test::mock::bta_sdp_api::BTA_SdpCreateRecordByUser(user_data); } -void BTA_SdpDumpsys(int fd) { - inc_func_call_count(__func__); - test::mock::bta_sdp_api::BTA_SdpDumpsys(fd); -} tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK* p_cback) { inc_func_call_count(__func__); return test::mock::bta_sdp_api::BTA_SdpEnable(p_cback); diff --git a/system/test/mock/mock_bta_sdp_api.h b/system/test/mock/mock_bta_sdp_api.h index 8449e40fe7..b45ac94328 100644 --- a/system/test/mock/mock_bta_sdp_api.h +++ b/system/test/mock/mock_bta_sdp_api.h @@ -49,15 +49,6 @@ struct BTA_SdpCreateRecordByUser { }; extern struct BTA_SdpCreateRecordByUser BTA_SdpCreateRecordByUser; -// Name: BTA_SdpDumpsys -// Params: int fd -// Return: void -struct BTA_SdpDumpsys { - std::function<void(int fd)> body{[](int /* fd */) {}}; - void operator()(int fd) { body(fd); } -}; -extern struct BTA_SdpDumpsys BTA_SdpDumpsys; - // Name: BTA_SdpEnable // Params: tBTA_SDP_DM_CBACK* p_cback // Return: tBTA_SDP_STATUS diff --git a/system/test/mock/mock_bta_sys_conn.cc b/system/test/mock/mock_bta_sys_conn.cc index e8453047a3..4d4348de39 100644 --- a/system/test/mock/mock_bta_sys_conn.cc +++ b/system/test/mock/mock_bta_sys_conn.cc @@ -26,9 +26,6 @@ #include "types/hci_role.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void bta_sys_app_close(tBTA_SYS_ID /* id */, uint8_t /* app_id */, const RawAddress& /* peer_addr */) { inc_func_call_count(__func__); @@ -66,7 +63,7 @@ void bta_sys_reset_sniff(uint8_t /* id */, uint8_t /* app_id */, inc_func_call_count(__func__); } void bta_sys_rm_register(tBTA_SYS_CONN_CBACK* /* p_cback */) { inc_func_call_count(__func__); } -void bta_sys_role_chg_register(tBTA_SYS_CONN_CBACK* /* p_cback */) { +void bta_sys_role_chg_register(tBTA_SYS_ROLE_SWITCH_CBACK* /* p_cback */) { inc_func_call_count(__func__); } void bta_sys_sco_close(tBTA_SYS_ID /* id */, uint8_t /* app_id */, diff --git a/system/test/mock/mock_bta_sys_main.cc b/system/test/mock/mock_bta_sys_main.cc index dd7e10e6ea..63da8a5969 100644 --- a/system/test/mock/mock_bta_sys_main.cc +++ b/system/test/mock/mock_bta_sys_main.cc @@ -30,9 +30,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace bta_sys_main { diff --git a/system/test/mock/mock_btif_av.cc b/system/test/mock/mock_btif_av.cc index 560c5e1a78..8ee4fd05ea 100644 --- a/system/test/mock/mock_btif_av.cc +++ b/system/test/mock/mock_btif_av.cc @@ -32,9 +32,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_av { diff --git a/system/test/mock/mock_btif_bluetooth.cc b/system/test/mock/mock_btif_bluetooth.cc index c101c6ee4d..7a9de6b076 100644 --- a/system/test/mock/mock_btif_bluetooth.cc +++ b/system/test/mock/mock_btif_bluetooth.cc @@ -25,15 +25,13 @@ #include <cstdint> +#include "btif/include/btif_api.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_bluetooth { @@ -42,14 +40,7 @@ namespace btif_bluetooth { struct is_atv_device is_atv_device; struct is_common_criteria_mode is_common_criteria_mode; struct is_restricted_mode is_restricted_mode; -struct dut_mode_configure dut_mode_configure; -struct dut_mode_send dut_mode_send; struct get_common_criteria_config_compare_result get_common_criteria_config_compare_result; -struct get_remote_device_properties get_remote_device_properties; -struct get_remote_device_property get_remote_device_property; -struct get_remote_services get_remote_services; -struct le_test_mode le_test_mode; -struct set_remote_device_property set_remote_device_property; struct invoke_switch_buffer_size_cb invoke_switch_buffer_size_cb; } // namespace btif_bluetooth @@ -69,38 +60,10 @@ bool is_restricted_mode() { inc_func_call_count(__func__); return test::mock::btif_bluetooth::is_restricted_mode(); } -int dut_mode_configure(uint8_t enable) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::dut_mode_configure(enable); -} -int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::dut_mode_send(opcode, buf, len); -} int get_common_criteria_config_compare_result() { inc_func_call_count(__func__); return test::mock::btif_bluetooth::get_common_criteria_config_compare_result(); } -int get_remote_device_properties(RawAddress* remote_addr) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::get_remote_device_properties(remote_addr); -} -int get_remote_device_property(RawAddress* remote_addr, bt_property_type_t type) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::get_remote_device_property(remote_addr, type); -} -int get_remote_services(RawAddress* remote_addr) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::get_remote_services(remote_addr); -} -int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::le_test_mode(opcode, buf, len); -} -int set_remote_device_property(RawAddress* remote_addr, const bt_property_t* property) { - inc_func_call_count(__func__); - return test::mock::btif_bluetooth::set_remote_device_property(remote_addr, property); -} void invoke_switch_buffer_size_cb(bool invoke_switch_buffer_size_cb) { inc_func_call_count(__func__); test::mock::btif_bluetooth::invoke_switch_buffer_size_cb(invoke_switch_buffer_size_cb); diff --git a/system/test/mock/mock_btif_bluetooth.h b/system/test/mock/mock_btif_bluetooth.h index 7ecc1ef832..f3f198dfd5 100644 --- a/system/test/mock/mock_btif_bluetooth.h +++ b/system/test/mock/mock_btif_bluetooth.h @@ -58,23 +58,6 @@ struct is_restricted_mode { bool operator()() { return body(); } }; extern struct is_restricted_mode is_restricted_mode; -// Name: dut_mode_configure -// Params: uint8_t enable -// Returns: int -struct dut_mode_configure { - std::function<int(uint8_t enable)> body{[](uint8_t /* enable */) { return 0; }}; - int operator()(uint8_t enable) { return body(enable); } -}; -extern struct dut_mode_configure dut_mode_configure; -// Name: dut_mode_send -// Params: uint16_t opcode, uint8_t* buf, uint8_t len -// Returns: int -struct dut_mode_send { - std::function<int(uint16_t /* opcode */, uint8_t* /* buf */, uint8_t /* len */)> body{ - [](uint16_t /* opcode */, uint8_t* /* buf */, uint8_t /* len */) { return 0; }}; - int operator()(uint16_t opcode, uint8_t* buf, uint8_t len) { return body(opcode, buf, len); } -}; -extern struct dut_mode_send dut_mode_send; // Name: get_common_criteria_config_compare_result // Params: // Returns: int @@ -83,53 +66,6 @@ struct get_common_criteria_config_compare_result { int operator()() { return body(); } }; extern struct get_common_criteria_config_compare_result get_common_criteria_config_compare_result; -// Name: get_remote_device_properties -// Params: RawAddress* remote_addr -// Returns: int -struct get_remote_device_properties { - std::function<int(RawAddress* remote_addr)> body{[](RawAddress* /* remote_addr */) { return 0; }}; - int operator()(RawAddress* remote_addr) { return body(remote_addr); } -}; -extern struct get_remote_device_properties get_remote_device_properties; -// Name: get_remote_device_property -// Params: RawAddress* remote_addr, bt_property_type_t type -// Returns: int -struct get_remote_device_property { - std::function<int(RawAddress* remote_addr, bt_property_type_t type)> body{ - [](RawAddress* /* remote_addr */, bt_property_type_t /* type */) { return 0; }}; - int operator()(RawAddress* remote_addr, bt_property_type_t type) { - return body(remote_addr, type); - } -}; -extern struct get_remote_device_property get_remote_device_property; -// Name: get_remote_services -// Params: RawAddress* remote_addr -// Returns: int -struct get_remote_services { - std::function<int(RawAddress* remote_addr)> body{[](RawAddress* /* remote_addr */) { return 0; }}; - int operator()(RawAddress* remote_addr) { return body(remote_addr); } -}; -extern struct get_remote_services get_remote_services; -// Name: le_test_mode -// Params: uint16_t opcode, uint8_t* buf, uint8_t len -// Returns: int -struct le_test_mode { - std::function<int(uint16_t opcode, uint8_t* buf, uint8_t len)> body{ - [](uint16_t /* opcode */, uint8_t* /* buf */, uint8_t /* len */) { return 0; }}; - int operator()(uint16_t opcode, uint8_t* buf, uint8_t len) { return body(opcode, buf, len); } -}; -extern struct le_test_mode le_test_mode; -// Name: set_remote_device_property -// Params: RawAddress* remote_addr, const bt_property_t* property -// Returns: int -struct set_remote_device_property { - std::function<int(RawAddress* remote_addr, const bt_property_t* property)> body{ - [](RawAddress* /* remote_addr */, const bt_property_t* /* property */) { return 0; }}; - int operator()(RawAddress* remote_addr, const bt_property_t* property) { - return body(remote_addr, property); - } -}; -extern struct set_remote_device_property set_remote_device_property; // Name: invoke_switch_buffer_size_cb // Params: bool invoke_switch_buffer_size_cb // Returns: void diff --git a/system/test/mock/mock_btif_bqr.cc b/system/test/mock/mock_btif_bqr.cc deleted file mode 100644 index 2a17a7778e..0000000000 --- a/system/test/mock/mock_btif_bqr.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Generated mock file from original source file - * Functions generated:51 - */ - -#include <cstdint> - -#include "test/common/mock_functions.h" - -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -namespace bluetooth { -namespace bqr { - -void DumpLmpLlMessage(uint8_t /* length */, const uint8_t* /* p_event */) { - inc_func_call_count(__func__); -} - -void DumpBtScheduling(uint8_t /* length */, const uint8_t* /* p_event */) { - inc_func_call_count(__func__); -} - -} // namespace bqr -} // namespace bluetooth diff --git a/system/test/mock/mock_btif_bta_pan_co_rx.cc b/system/test/mock/mock_btif_bta_pan_co_rx.cc index 741104b228..1eed716edf 100644 --- a/system/test/mock/mock_btif_bta_pan_co_rx.cc +++ b/system/test/mock/mock_btif_bta_pan_co_rx.cc @@ -25,14 +25,12 @@ #include <cstdint> +#include "bta/include/bta_pan_co.h" #include "test/common/mock_functions.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_bta_pan_co_rx { diff --git a/system/test/mock/mock_btif_co_bta_av_co.cc b/system/test/mock/mock_btif_co_bta_av_co.cc index efa055531f..f596c047a0 100644 --- a/system/test/mock/mock_btif_co_bta_av_co.cc +++ b/system/test/mock/mock_btif_co_bta_av_co.cc @@ -25,15 +25,14 @@ #include <cstdint> +#include "bta/include/bta_av_co.h" +#include "btif/include/btif_av_co.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_co_bta_av_co { diff --git a/system/test/mock/mock_btif_co_bta_dm_co.cc b/system/test/mock/mock_btif_co_bta_dm_co.cc index 656b94cda2..f33bcf4c68 100644 --- a/system/test/mock/mock_btif_co_bta_dm_co.cc +++ b/system/test/mock/mock_btif_co_bta_dm_co.cc @@ -24,14 +24,6 @@ #include "bta/sys/bta_sys.h" #include "internal_include/bte_appl.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - tBTE_APPL_CFG bte_appl_cfg = {BTA_LE_AUTH_REQ_SC_MITM_BOND, // Authentication requirements BTM_IO_CAP_UNKNOWN, BTM_BLE_INITIATOR_KEY_SIZE, BTM_BLE_RESPONDER_KEY_SIZE, BTM_BLE_MAX_KEY_SIZE}; - -bool bta_dm_co_get_compress_memory(tBTA_SYS_ID /* id */, uint8_t** /* memory_p */, - uint32_t* /* memory_size */) { - return true; -} diff --git a/system/test/mock/mock_btif_co_bta_hh_co.cc b/system/test/mock/mock_btif_co_bta_hh_co.cc index 8f9a4ea739..f1a185d99e 100644 --- a/system/test/mock/mock_btif_co_bta_hh_co.cc +++ b/system/test/mock/mock_btif_co_bta_hh_co.cc @@ -27,9 +27,6 @@ #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - int bta_hh_co_write(int /* fd */, uint8_t* /* rpt */, uint16_t /* len */) { inc_func_call_count(__func__); return 0; diff --git a/system/test/mock/mock_btif_config.cc b/system/test/mock/mock_btif_config.cc index 549fe4bf44..72c91c04fc 100644 --- a/system/test/mock/mock_btif_config.cc +++ b/system/test/mock/mock_btif_config.cc @@ -27,15 +27,13 @@ #include <cstdint> #include <string> +#include "btif/include/btif_config.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_config { diff --git a/system/test/mock/mock_btif_core.cc b/system/test/mock/mock_btif_core.cc index 001c5b553f..0d601d2af1 100644 --- a/system/test/mock/mock_btif_core.cc +++ b/system/test/mock/mock_btif_core.cc @@ -24,14 +24,12 @@ #include <cstdint> #include "bta/include/bta_api.h" +#include "btif/include/btif_api.h" #include "btif/include/btif_common.h" #include "include/hardware/bluetooth.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool btif_is_dut_mode() { inc_func_call_count(__func__); return false; diff --git a/system/test/mock/mock_btif_dm.cc b/system/test/mock/mock_btif_dm.cc index cc3bf79edd..9d135c5530 100644 --- a/system/test/mock/mock_btif_dm.cc +++ b/system/test/mock/mock_btif_dm.cc @@ -23,6 +23,7 @@ #include "bta/include/bta_api.h" #include "bta/include/bta_sec_api.h" +#include "btif/include/btif_api.h" #include "include/hardware/bluetooth.h" #include "internal_include/bte_appl.h" #include "stack/include/acl_api_types.h" @@ -31,16 +32,13 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - struct uid_set_t; bool btif_dm_pairing_is_busy() { inc_func_call_count(__func__); return false; } -bool check_cod_hid(const RawAddress& /* remote_bdaddr */) { +bool btif_check_cod_hid(const RawAddress& /* remote_bdaddr */) { inc_func_call_count(__func__); return false; } @@ -71,19 +69,16 @@ void btif_ble_transmitter_test(uint8_t /* tx_freq */, uint8_t /* test_data_len * inc_func_call_count(__func__); } void btif_debug_bond_event_dump(int /* fd */) { inc_func_call_count(__func__); } -void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* /* p_ble_req */, bool /* is_consent */) { - inc_func_call_count(__func__); -} void btif_dm_cancel_bond(const RawAddress /* bd_addr */) { inc_func_call_count(__func__); } void btif_dm_cancel_discovery(void) { inc_func_call_count(__func__); } void btif_dm_cleanup(void) { inc_func_call_count(__func__); } -void btif_dm_create_bond(const RawAddress /* bd_addr */, int /* transport */) { +void btif_dm_create_bond(const RawAddress /* bd_addr */, tBT_TRANSPORT /* transport */) { inc_func_call_count(__func__); } void btif_dm_create_bond_le(const RawAddress /* bd_addr */, tBLE_ADDR_TYPE /* addr_type */) { inc_func_call_count(__func__); } -void btif_dm_create_bond_out_of_band(const RawAddress /* bd_addr */, int /* transport */, +void btif_dm_create_bond_out_of_band(const RawAddress /* bd_addr */, tBT_TRANSPORT /* transport */, const bt_oob_data_t /* p192_data */, const bt_oob_data_t /* p256_data */) { inc_func_call_count(__func__); @@ -95,7 +90,7 @@ void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* /* p_key_mask */, Oc tBTA_BLE_LOCAL_ID_KEYS* /* p_id_keys */) { inc_func_call_count(__func__); } -void btif_dm_get_remote_services(RawAddress /* remote_addr */, const int /* transport */) { +void btif_dm_get_remote_services(RawAddress /* remote_addr */, tBT_TRANSPORT /* transport */) { inc_func_call_count(__func__); } void btif_dm_hh_open_failed(RawAddress* /* bdaddr */) { inc_func_call_count(__func__); } @@ -118,7 +113,6 @@ void btif_dm_proc_io_rsp(const RawAddress& /* bd_addr */, tBTM_IO_CAP /* io_cap inc_func_call_count(__func__); } void btif_dm_read_energy_info() { inc_func_call_count(__func__); } -void btif_dm_remove_ble_bonding_keys(void) { inc_func_call_count(__func__); } void btif_dm_remove_bond(const RawAddress /* bd_addr */) { inc_func_call_count(__func__); } void btif_dm_set_oob_for_io_req(tBTM_OOB_DATA* /* p_has_oob_data */) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_btif_hf.cc b/system/test/mock/mock_btif_hf.cc index b3d9b88d16..b8e9f5057a 100644 --- a/system/test/mock/mock_btif_hf.cc +++ b/system/test/mock/mock_btif_hf.cc @@ -23,15 +23,13 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_btif_hf.h" +#include "btif/include/btif_hf.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_hf { diff --git a/system/test/mock/mock_btif_profile_storage.cc b/system/test/mock/mock_btif_profile_storage.cc index a65103fa8e..3f88e4cd4c 100644 --- a/system/test/mock/mock_btif_profile_storage.cc +++ b/system/test/mock/mock_btif_profile_storage.cc @@ -25,11 +25,10 @@ #include <cstdint> +#include "btif/include/btif_profile_storage.h" +#include "btif/include/btif_storage.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Original usings using bluetooth::Uuid; diff --git a/system/test/mock/mock_btif_sock_l2cap.cc b/system/test/mock/mock_btif_sock_l2cap.cc index 41f19f8cd0..135cd47dac 100644 --- a/system/test/mock/mock_btif_sock_l2cap.cc +++ b/system/test/mock/mock_btif_sock_l2cap.cc @@ -25,11 +25,9 @@ #include <cstdint> +#include "btif/include/btif_sock_l2cap.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Original usings // Mocked internal structures, if any diff --git a/system/test/mock/mock_btif_sock_rfc.cc b/system/test/mock/mock_btif_sock_rfc.cc index 6ca7512418..c22a7bf860 100644 --- a/system/test/mock/mock_btif_sock_rfc.cc +++ b/system/test/mock/mock_btif_sock_rfc.cc @@ -24,11 +24,10 @@ #include <cstdint> +#include "bta/include/bta_jv_co.h" +#include "btif/include/btif_sock_rfc.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Original usings using bluetooth::Uuid; @@ -91,11 +90,14 @@ void btsock_rfc_cleanup(void) { inc_func_call_count(__func__); test::mock::btif_sock_rfc::btsock_rfc_cleanup(); } -bt_status_t btsock_rfc_connect(const RawAddress* bd_addr, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid) { +bt_status_t btsock_rfc_connect(const RawAddress* bd_addr, const bluetooth::Uuid* uuid, int channel, + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size) { inc_func_call_count(__func__); - return test::mock::btif_sock_rfc::btsock_rfc_connect(bd_addr, service_uuid, channel, sock_fd, - flags, app_uid); + return test::mock::btif_sock_rfc::btsock_rfc_connect(bd_addr, uuid, channel, sock_fd, flags, + app_uid, data_path, socket_name, hub_id, + endpoint_id, max_rx_packet_size); } bt_status_t btsock_rfc_control_req(uint8_t dlci, const RawAddress& bd_addr, uint8_t modem_signal, uint8_t break_signal, uint8_t discard_buffers, @@ -113,10 +115,13 @@ bt_status_t btsock_rfc_init(int poll_thread_handle, uid_set_t* set) { return test::mock::btif_sock_rfc::btsock_rfc_init(poll_thread_handle, set); } bt_status_t btsock_rfc_listen(const char* service_name, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid) { + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size) { inc_func_call_count(__func__); return test::mock::btif_sock_rfc::btsock_rfc_listen(service_name, service_uuid, channel, sock_fd, - flags, app_uid); + flags, app_uid, data_path, socket_name, + hub_id, endpoint_id, max_rx_packet_size); } void btsock_rfc_signaled(int fd, int flags, uint32_t id) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_btif_sock_rfc.h b/system/test/mock/mock_btif_sock_rfc.h index 59f296f016..a0d14cb9bc 100644 --- a/system/test/mock/mock_btif_sock_rfc.h +++ b/system/test/mock/mock_btif_sock_rfc.h @@ -30,6 +30,7 @@ #include <functional> #include "btif/include/btif_uid.h" +#include "hardware/bt_sock.h" #include "stack/include/bt_hdr.h" #include "types/bluetooth/uuid.h" #include "types/raw_address.h" @@ -91,14 +92,21 @@ extern struct btsock_rfc_cleanup btsock_rfc_cleanup; // int* sock_fd, int flags, int app_uid Return: bt_status_t struct btsock_rfc_connect { static bt_status_t return_value; - std::function<bt_status_t(const RawAddress* bd_addr, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid)> - body{[](const RawAddress* /* bd_addr */, const Uuid* /* service_uuid */, - int /* channel */, int* /* sock_fd */, int /* flags */, - int /* app_uid */) { return return_value; }}; - bt_status_t operator()(const RawAddress* bd_addr, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid) { - return body(bd_addr, service_uuid, channel, sock_fd, flags, app_uid); + std::function<bt_status_t(const RawAddress* bd_addr, const bluetooth::Uuid* uuid, int channel, + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size)> + body{[](const RawAddress* /*bd_addr*/, const bluetooth::Uuid* /*uuid*/, int /*channel*/, + int* /*sock_fd*/, int /*flags*/, int /*app_uid*/, + btsock_data_path_t /*data_path*/, const char* /*socket_name*/, + uint64_t /*hub_id*/, uint64_t /*endpoint_id*/, + int /*max_rx_packet_size*/) { return return_value; }}; + bt_status_t operator()(const RawAddress* bd_addr, const bluetooth::Uuid* uuid, int channel, + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size) { + return body(bd_addr, uuid, channel, sock_fd, flags, app_uid, data_path, socket_name, hub_id, + endpoint_id, max_rx_packet_size); } }; extern struct btsock_rfc_connect btsock_rfc_connect; @@ -153,12 +161,20 @@ extern struct btsock_rfc_init btsock_rfc_init; struct btsock_rfc_listen { static bt_status_t return_value; std::function<bt_status_t(const char* service_name, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid)> + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size)> body{[](const char* /* service_name */, const Uuid* /* service_uuid */, int /* channel */, - int* /* sock_fd */, int /* flags */, int /* app_uid */) { return return_value; }}; + int* /* sock_fd */, int /* flags */, int /* app_uid */, + btsock_data_path_t /*data_path*/, const char* /*socket_name*/, + uint64_t /*hub_id*/, uint64_t /*endpoint_id*/, + int /*max_rx_packet_size*/) { return return_value; }}; bt_status_t operator()(const char* service_name, const Uuid* service_uuid, int channel, - int* sock_fd, int flags, int app_uid) { - return body(service_name, service_uuid, channel, sock_fd, flags, app_uid); + int* sock_fd, int flags, int app_uid, btsock_data_path_t data_path, + const char* socket_name, uint64_t hub_id, uint64_t endpoint_id, + int max_rx_packet_size) { + return body(service_name, service_uuid, channel, sock_fd, flags, app_uid, data_path, + socket_name, hub_id, endpoint_id, max_rx_packet_size); } }; extern struct btsock_rfc_listen btsock_rfc_listen; diff --git a/system/test/mock/mock_btif_stack_manager.cc b/system/test/mock/mock_btif_stack_manager.cc index bdc4150ca9..e334b911dd 100644 --- a/system/test/mock/mock_btif_stack_manager.cc +++ b/system/test/mock/mock_btif_stack_manager.cc @@ -19,12 +19,10 @@ */ #include "btif/include/core_callbacks.h" +#include "btif/include/stack_manager_t.h" #include "osi/include/future.h" #include "test/common/core_interface.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - static future_t* hack_future; future_t* stack_manager_get_hack_future() { return hack_future; } diff --git a/system/test/mock/mock_btif_storage.cc b/system/test/mock/mock_btif_storage.cc index 427dd20a54..f8b9ab5ff3 100644 --- a/system/test/mock/mock_btif_storage.cc +++ b/system/test/mock/mock_btif_storage.cc @@ -25,11 +25,10 @@ #include <cstdint> +#include "btif/include/btif_api.h" +#include "btif/include/btif_storage.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Original usings using bluetooth::Uuid; @@ -41,7 +40,6 @@ namespace btif_storage { // Function state capture and return values, if needed struct btif_debug_linkkey_type_dump btif_debug_linkkey_type_dump; -struct btif_has_ble_keys btif_has_ble_keys; struct btif_in_fetch_bonded_ble_device btif_in_fetch_bonded_ble_device; struct btif_in_fetch_bonded_device btif_in_fetch_bonded_device; struct btif_split_uuids_string btif_split_uuids_string; @@ -49,7 +47,6 @@ struct btif_storage_add_ble_bonding_key btif_storage_add_ble_bonding_key; struct btif_storage_add_ble_local_key btif_storage_add_ble_local_key; struct btif_storage_add_bonded_device btif_storage_add_bonded_device; struct btif_storage_add_remote_device btif_storage_add_remote_device; -struct btif_storage_get_adapter_prop btif_storage_get_adapter_prop; struct btif_storage_get_adapter_property btif_storage_get_adapter_property; struct btif_storage_get_ble_bonding_key btif_storage_get_ble_bonding_key; struct btif_storage_get_ble_local_key btif_storage_get_ble_local_key; @@ -57,11 +54,9 @@ struct btif_storage_get_gatt_cl_db_hash btif_storage_get_gatt_cl_db_hash; struct btif_storage_get_gatt_cl_supp_feat btif_storage_get_gatt_cl_supp_feat; struct btif_storage_get_remote_addr_type btif_storage_get_remote_addr_type; struct btif_storage_get_remote_device_property btif_storage_get_remote_device_property; -struct btif_storage_get_remote_prop btif_storage_get_remote_prop; struct btif_storage_get_sr_supp_feat btif_storage_get_sr_supp_feat; struct btif_storage_get_stored_remote_name btif_storage_get_stored_remote_name; struct btif_storage_get_cod btif_storage_get_cod; -struct btif_storage_invoke_addr_type_update btif_storage_invoke_addr_type_update; struct btif_storage_is_restricted_device btif_storage_is_restricted_device; struct btif_storage_load_bonded_devices btif_storage_load_bonded_devices; struct btif_storage_load_le_devices btif_storage_load_le_devices; @@ -86,7 +81,6 @@ namespace test { namespace mock { namespace btif_storage { -bool btif_has_ble_keys::return_value = false; bt_status_t btif_in_fetch_bonded_ble_device::return_value = BT_STATUS_SUCCESS; bt_status_t btif_in_fetch_bonded_device::return_value = BT_STATUS_SUCCESS; size_t btif_split_uuids_string::return_value = 0; @@ -94,7 +88,6 @@ bt_status_t btif_storage_add_ble_bonding_key::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_add_ble_local_key::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_add_bonded_device::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_add_remote_device::return_value = BT_STATUS_SUCCESS; -bt_status_t btif_storage_get_adapter_prop::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_get_adapter_property::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_get_ble_bonding_key::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_get_ble_local_key::return_value = BT_STATUS_SUCCESS; @@ -102,7 +95,6 @@ Octet16 btif_storage_get_gatt_cl_db_hash::return_value = {}; uint8_t btif_storage_get_gatt_cl_supp_feat::return_value = 0; bt_status_t btif_storage_get_remote_addr_type::return_value = BT_STATUS_SUCCESS; bt_status_t btif_storage_get_remote_device_property::return_value = BT_STATUS_SUCCESS; -bt_status_t btif_storage_get_remote_prop::return_value = BT_STATUS_SUCCESS; uint8_t btif_storage_get_sr_supp_feat::return_value = 0; bool btif_storage_get_stored_remote_name::return_value = false; bool btif_storage_get_cod::return_value = false; @@ -124,10 +116,6 @@ void btif_debug_linkkey_type_dump(int fd) { inc_func_call_count(__func__); test::mock::btif_storage::btif_debug_linkkey_type_dump(fd); } -bool btif_has_ble_keys(const std::string& bdstr) { - inc_func_call_count(__func__); - return test::mock::btif_storage::btif_has_ble_keys(bdstr); -} bt_status_t btif_in_fetch_bonded_ble_device(const std::string& remote_bd_addr, int add, btif_bonded_devices_t* p_bonded_devices) { inc_func_call_count(__func__); @@ -164,11 +152,6 @@ bt_status_t btif_storage_add_remote_device(const RawAddress* remote_bd_addr, return test::mock::btif_storage::btif_storage_add_remote_device(remote_bd_addr, num_properties, properties); } -bt_status_t btif_storage_get_adapter_prop(bt_property_type_t type, void* buf, int size, - bt_property_t* property) { - inc_func_call_count(__func__); - return test::mock::btif_storage::btif_storage_get_adapter_prop(type, buf, size, property); -} bt_status_t btif_storage_get_adapter_property(bt_property_t* property) { inc_func_call_count(__func__); return test::mock::btif_storage::btif_storage_get_adapter_property(property); @@ -202,12 +185,6 @@ bt_status_t btif_storage_get_remote_device_property(const RawAddress* remote_bd_ return test::mock::btif_storage::btif_storage_get_remote_device_property(remote_bd_addr, property); } -bt_status_t btif_storage_get_remote_prop(RawAddress* remote_addr, bt_property_type_t type, - void* buf, int size, bt_property_t* property) { - inc_func_call_count(__func__); - return test::mock::btif_storage::btif_storage_get_remote_prop(remote_addr, type, buf, size, - property); -} uint8_t btif_storage_get_sr_supp_feat(const RawAddress& bd_addr) { inc_func_call_count(__func__); return test::mock::btif_storage::btif_storage_get_sr_supp_feat(bd_addr); @@ -220,11 +197,6 @@ bool btif_storage_get_cod(const RawAddress& bd_addr, uint32_t* cod) { inc_func_call_count(__func__); return test::mock::btif_storage::btif_storage_get_cod(bd_addr, cod); } -void btif_storage_invoke_addr_type_update(const RawAddress& remote_bd_addr, - const tBLE_ADDR_TYPE& addr_type) { - inc_func_call_count(__func__); - test::mock::btif_storage::btif_storage_invoke_addr_type_update(remote_bd_addr, addr_type); -} bool btif_storage_is_restricted_device(const RawAddress* remote_bd_addr) { inc_func_call_count(__func__); return test::mock::btif_storage::btif_storage_is_restricted_device(remote_bd_addr); diff --git a/system/test/mock/mock_btif_storage.h b/system/test/mock/mock_btif_storage.h index 2df8d149e5..6be7f1200a 100644 --- a/system/test/mock/mock_btif_storage.h +++ b/system/test/mock/mock_btif_storage.h @@ -55,17 +55,6 @@ struct btif_debug_linkkey_type_dump { }; extern struct btif_debug_linkkey_type_dump btif_debug_linkkey_type_dump; -// Name: btif_has_ble_keys -// Params: const std::string& bdstr -// Return: bool -struct btif_has_ble_keys { - static bool return_value; - std::function<bool(const std::string& bdstr)> body{ - [](const std::string& /* bdstr */) { return return_value; }}; - bool operator()(const std::string& bdstr) { return body(bdstr); } -}; -extern struct btif_has_ble_keys btif_has_ble_keys; - // Name: btif_in_fetch_bonded_ble_device // Params: const std::string& remote_bd_addr, int add, btif_bonded_devices_t* // p_bonded_devices Return: bt_status_t @@ -169,20 +158,6 @@ struct btif_storage_add_remote_device { }; extern struct btif_storage_add_remote_device btif_storage_add_remote_device; -// Name: btif_storage_get_adapter_prop -// Params: bt_property_type_t type, void* buf, int size, bt_property_t* property -// Return: bt_status_t -struct btif_storage_get_adapter_prop { - static bt_status_t return_value; - std::function<bt_status_t(bt_property_type_t type, void* buf, int size, bt_property_t* property)> - body{[](bt_property_type_t /* type */, void* /* buf */, int /* size */, - bt_property_t* /* property */) { return return_value; }}; - bt_status_t operator()(bt_property_type_t type, void* buf, int size, bt_property_t* property) { - return body(type, buf, size, property); - } -}; -extern struct btif_storage_get_adapter_prop btif_storage_get_adapter_prop; - // Name: btif_storage_get_adapter_property // Params: bt_property_t* property // Return: bt_status_t @@ -272,22 +247,6 @@ struct btif_storage_get_remote_device_property { }; extern struct btif_storage_get_remote_device_property btif_storage_get_remote_device_property; -// Name: btif_storage_get_remote_prop -// Params: RawAddress* remote_addr, bt_property_type_t type, void* buf, int -// size, bt_property_t* property Return: bt_status_t -struct btif_storage_get_remote_prop { - static bt_status_t return_value; - std::function<bt_status_t(RawAddress* remote_addr, bt_property_type_t type, void* buf, int size, - bt_property_t* property)> - body{[](RawAddress* /* remote_addr */, bt_property_type_t /* type */, void* /* buf */, - int /* size */, bt_property_t* /* property */) { return return_value; }}; - bt_status_t operator()(RawAddress* remote_addr, bt_property_type_t type, void* buf, int size, - bt_property_t* property) { - return body(remote_addr, type, buf, size, property); - } -}; -extern struct btif_storage_get_remote_prop btif_storage_get_remote_prop; - // Name: btif_storage_get_sr_supp_feat // Params: const RawAddress& bd_addr // Return: uint8_t @@ -321,18 +280,6 @@ struct btif_storage_get_cod { }; extern struct btif_storage_get_cod btif_storage_get_cod; -// Name: btif_storage_invoke_addr_type_update -// Params: const RawAddress& remote_bd_addr, const tBLE_ADDR_TYPE& addr_type -// Return: void -struct btif_storage_invoke_addr_type_update { - std::function<void(const RawAddress& remote_bd_addr, const tBLE_ADDR_TYPE& addr_type)> body{ - [](const RawAddress& /* remote_bd_addr */, const tBLE_ADDR_TYPE& /* addr_type */) {}}; - void operator()(const RawAddress& remote_bd_addr, const tBLE_ADDR_TYPE& addr_type) { - body(remote_bd_addr, addr_type); - } -}; -extern struct btif_storage_invoke_addr_type_update btif_storage_invoke_addr_type_update; - // Name: btif_storage_is_restricted_device // Params: const RawAddress* remote_bd_addr // Return: bool diff --git a/system/test/mock/mock_btif_util.cc b/system/test/mock/mock_btif_util.cc index 662fa3fcbc..bfb192409f 100644 --- a/system/test/mock/mock_btif_util.cc +++ b/system/test/mock/mock_btif_util.cc @@ -24,15 +24,13 @@ #include <cstdint> +#include "btif/include/btif_util.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace btif_util { @@ -67,20 +65,20 @@ namespace btif_util { int ascii_2_hex::return_value = 0; uint32_t devclass2uint::return_value = 0; -const char* dump_adapter_scan_mode::return_value = nullptr; -const char* dump_av_audio_state::return_value = nullptr; -const char* dump_av_conn_state::return_value = nullptr; -const char* dump_bt_status::return_value = nullptr; -const char* dump_dm_event::return_value = nullptr; -const char* dump_dm_search_event::return_value = nullptr; -const char* dump_hd_event::return_value = nullptr; -const char* dump_hf_client_event::return_value = nullptr; -const char* dump_hf_event::return_value = nullptr; -const char* dump_property_type::return_value = nullptr; -const char* dump_rc_event::return_value = nullptr; -const char* dump_rc_notification_event_id::return_value = nullptr; -const char* dump_rc_pdu::return_value = nullptr; -const char* dump_thread_evt::return_value = nullptr; +std::string dump_adapter_scan_mode::return_value = ""; +std::string dump_av_audio_state::return_value = ""; +std::string dump_av_conn_state::return_value = ""; +std::string dump_bt_status::return_value = ""; +std::string dump_dm_event::return_value = ""; +std::string dump_dm_search_event::return_value = ""; +std::string dump_hd_event::return_value = ""; +std::string dump_hf_client_event::return_value = ""; +std::string dump_hf_event::return_value = ""; +std::string dump_property_type::return_value = ""; +std::string dump_rc_event::return_value = ""; +std::string dump_rc_notification_event_id::return_value = ""; +std::string dump_rc_pdu::return_value = ""; +std::string dump_thread_evt::return_value = ""; } // namespace btif_util } // namespace mock @@ -95,59 +93,59 @@ uint32_t devclass2uint(const DEV_CLASS dev_class) { inc_func_call_count(__func__); return test::mock::btif_util::devclass2uint(dev_class); } -const char* dump_adapter_scan_mode(bt_scan_mode_t mode) { +std::string dump_adapter_scan_mode(bt_scan_mode_t mode) { inc_func_call_count(__func__); return test::mock::btif_util::dump_adapter_scan_mode(mode); } -const char* dump_av_audio_state(uint16_t event) { +std::string dump_av_audio_state(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_av_audio_state(event); } -const char* dump_av_conn_state(uint16_t event) { +std::string dump_av_conn_state(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_av_conn_state(event); } -const char* dump_bt_status(bt_status_t status) { +std::string dump_bt_status(bt_status_t status) { inc_func_call_count(__func__); return test::mock::btif_util::dump_bt_status(status); } -const char* dump_dm_event(uint16_t event) { +std::string dump_dm_event(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_dm_event(event); } -const char* dump_dm_search_event(uint16_t event) { +std::string dump_dm_search_event(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_dm_search_event(event); } -const char* dump_hd_event(uint16_t event) { +std::string dump_hd_event(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_hd_event(event); } -const char* dump_hf_client_event(uint16_t event) { +std::string dump_hf_client_event(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_hf_client_event(event); } -const char* dump_hf_event(uint16_t event) { +std::string dump_hf_event(uint16_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_hf_event(event); } -const char* dump_property_type(bt_property_type_t type) { +std::string dump_property_type(bt_property_type_t type) { inc_func_call_count(__func__); return test::mock::btif_util::dump_property_type(type); } -const char* dump_rc_event(uint8_t event) { +std::string dump_rc_event(uint8_t event) { inc_func_call_count(__func__); return test::mock::btif_util::dump_rc_event(event); } -const char* dump_rc_notification_event_id(uint8_t event_id) { +std::string dump_rc_notification_event_id(uint8_t event_id) { inc_func_call_count(__func__); return test::mock::btif_util::dump_rc_notification_event_id(event_id); } -const char* dump_rc_pdu(uint8_t pdu) { +std::string dump_rc_pdu(uint8_t pdu) { inc_func_call_count(__func__); return test::mock::btif_util::dump_rc_pdu(pdu); } -const char* dump_thread_evt(bt_cb_thread_evt evt) { +std::string dump_thread_evt(bt_cb_thread_evt evt) { inc_func_call_count(__func__); return test::mock::btif_util::dump_thread_evt(evt); } diff --git a/system/test/mock/mock_btif_util.h b/system/test/mock/mock_btif_util.h index 7dd4188ce0..bd775a8062 100644 --- a/system/test/mock/mock_btif_util.h +++ b/system/test/mock/mock_btif_util.h @@ -66,152 +66,152 @@ extern struct devclass2uint devclass2uint; // Name: dump_adapter_scan_mode // Params: bt_scan_mode_t mode -// Return: const char* +// Return: std::string struct dump_adapter_scan_mode { - static const char* return_value; - std::function<const char*(bt_scan_mode_t mode)> body{ + static std::string return_value; + std::function<std::string(bt_scan_mode_t mode)> body{ [](bt_scan_mode_t /* mode */) { return return_value; }}; - const char* operator()(bt_scan_mode_t mode) { return body(mode); } + std::string operator()(bt_scan_mode_t mode) { return body(mode); } }; extern struct dump_adapter_scan_mode dump_adapter_scan_mode; // Name: dump_av_audio_state // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_av_audio_state { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_av_audio_state dump_av_audio_state; // Name: dump_av_conn_state // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_av_conn_state { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_av_conn_state dump_av_conn_state; // Name: dump_bt_status // Params: bt_status_t status -// Return: const char* +// Return: std::string struct dump_bt_status { - static const char* return_value; - std::function<const char*(bt_status_t status)> body{ + static std::string return_value; + std::function<std::string(bt_status_t status)> body{ [](bt_status_t /* status */) { return return_value; }}; - const char* operator()(bt_status_t status) { return body(status); } + std::string operator()(bt_status_t status) { return body(status); } }; extern struct dump_bt_status dump_bt_status; // Name: dump_dm_event // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_dm_event { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_dm_event dump_dm_event; // Name: dump_dm_search_event // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_dm_search_event { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_dm_search_event dump_dm_search_event; // Name: dump_hd_event // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_hd_event { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_hd_event dump_hd_event; // Name: dump_hf_client_event // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_hf_client_event { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; extern struct dump_hf_client_event dump_hf_client_event; // Name: dump_hf_event // Params: uint16_t event -// Return: const char* +// Return: std::string struct dump_hf_event { - static const char* return_value; - std::function<const char*(uint16_t event)> body{ + static std::string return_value; + std::function<std::string(uint16_t event)> body{ [](uint16_t /* event */) { return return_value; }}; - const char* operator()(uint16_t event) { return body(event); } + std::string operator()(uint16_t event) { return body(event); } }; // Name: dump_property_type // Params: bt_property_type_t type -// Return: const char* +// Return: std::string struct dump_property_type { - static const char* return_value; - std::function<const char*(bt_property_type_t type)> body{ + static std::string return_value; + std::function<std::string(bt_property_type_t type)> body{ [](bt_property_type_t /* type */) { return return_value; }}; - const char* operator()(bt_property_type_t type) { return body(type); } + std::string operator()(bt_property_type_t type) { return body(type); } }; extern struct dump_property_type dump_property_type; // Name: dump_rc_event // Params: uint8_t event -// Return: const char* +// Return: std::string struct dump_rc_event { - static const char* return_value; - std::function<const char*(uint8_t event)> body{[](uint8_t /* event */) { return return_value; }}; - const char* operator()(uint8_t event) { return body(event); } + static std::string return_value; + std::function<std::string(uint8_t event)> body{[](uint8_t /* event */) { return return_value; }}; + std::string operator()(uint8_t event) { return body(event); } }; extern struct dump_rc_event dump_rc_event; // Name: dump_rc_notification_event_id // Params: uint8_t event_id -// Return: const char* +// Return: std::string struct dump_rc_notification_event_id { - static const char* return_value; - std::function<const char*(uint8_t event_id)> body{ + static std::string return_value; + std::function<std::string(uint8_t event_id)> body{ [](uint8_t /* event_id */) { return return_value; }}; - const char* operator()(uint8_t event_id) { return body(event_id); } + std::string operator()(uint8_t event_id) { return body(event_id); } }; extern struct dump_rc_notification_event_id dump_rc_notification_event_id; // Name: dump_rc_pdu // Params: uint8_t pdu -// Return: const char* +// Return: std::string struct dump_rc_pdu { - static const char* return_value; - std::function<const char*(uint8_t pdu)> body{[](uint8_t /* pdu */) { return return_value; }}; - const char* operator()(uint8_t pdu) { return body(pdu); } + static std::string return_value; + std::function<std::string(uint8_t pdu)> body{[](uint8_t /* pdu */) { return return_value; }}; + std::string operator()(uint8_t pdu) { return body(pdu); } }; extern struct dump_rc_pdu dump_rc_pdu; // Name: dump_thread_evt // Params: bt_cb_thread_evt evt -// Return: const char* +// Return: std::string struct dump_thread_evt { - static const char* return_value; - std::function<const char*(bt_cb_thread_evt evt)> body{ + static std::string return_value; + std::function<std::string(bt_cb_thread_evt evt)> body{ [](bt_cb_thread_evt /* evt */) { return return_value; }}; - const char* operator()(bt_cb_thread_evt evt) { return body(evt); } + std::string operator()(bt_cb_thread_evt evt) { return body(evt); } }; extern struct dump_thread_evt dump_thread_evt; diff --git a/system/test/mock/mock_device_esco_parameters.cc b/system/test/mock/mock_device_esco_parameters.cc index 5a9a3ad263..c38d546de8 100644 --- a/system/test/mock/mock_device_esco_parameters.cc +++ b/system/test/mock/mock_device_esco_parameters.cc @@ -23,13 +23,11 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_device_esco_parameters.h" +#include "device/include/esco_parameters.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace device_esco_parameters { @@ -42,14 +40,9 @@ struct esco_parameters_for_codec esco_parameters_for_codec; } // namespace test // Mocked functions, if any -enh_esco_params_t esco_parameters_for_codec(esco_codec_t codec) { - inc_func_call_count(__func__); - return test::mock::device_esco_parameters::esco_parameters_for_codec(codec); -} - -enh_esco_params_t esco_parameters_for_codec(esco_codec_t codec, bool /* b */) { +enh_esco_params_t esco_parameters_for_codec(esco_codec_t codec, bool offload) { inc_func_call_count(__func__); - return test::mock::device_esco_parameters::esco_parameters_for_codec(codec); + return test::mock::device_esco_parameters::esco_parameters_for_codec(codec, offload); } // Mocked functions complete // END mockcify generation diff --git a/system/test/mock/mock_device_esco_parameters.h b/system/test/mock/mock_device_esco_parameters.h index 92e5ad085d..327f2ddc92 100644 --- a/system/test/mock/mock_device_esco_parameters.h +++ b/system/test/mock/mock_device_esco_parameters.h @@ -38,9 +38,9 @@ namespace device_esco_parameters { // Return: enh_esco_params_t struct esco_parameters_for_codec { enh_esco_params_t return_value{}; - std::function<enh_esco_params_t(esco_codec_t codec)> body{ - [this](esco_codec_t /* codec */) { return return_value; }}; - enh_esco_params_t operator()(esco_codec_t codec) { return body(codec); } + std::function<enh_esco_params_t(esco_codec_t codec, bool offload)> body{ + [this](esco_codec_t /* codec */, bool /* offload */) { return return_value; }}; + enh_esco_params_t operator()(esco_codec_t codec, bool offload) { return body(codec, offload); } }; extern struct esco_parameters_for_codec esco_parameters_for_codec; diff --git a/system/test/mock/mock_device_interop.cc b/system/test/mock/mock_device_interop.cc index 0f7a0a27e5..ae65e50634 100644 --- a/system/test/mock/mock_device_interop.cc +++ b/system/test/mock/mock_device_interop.cc @@ -25,15 +25,13 @@ #include <cstdint> #include "device/include/interop.h" +#include "device/include/interop_config.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace device_interop { @@ -70,7 +68,6 @@ struct interop_match_addr_or_name interop_match_addr_or_name; struct interop_match_manufacturer interop_match_manufacturer; struct interop_match_name interop_match_name; struct interop_match_vendor_product_ids interop_match_vendor_product_ids; -struct token_to_ul token_to_ul; } // namespace device_interop } // namespace mock @@ -103,7 +100,6 @@ bool interop_match_addr_or_name::return_value = false; bool interop_match_manufacturer::return_value = false; bool interop_match_name::return_value = false; bool interop_match_vendor_product_ids::return_value = false; -bool token_to_ul::return_value = false; } // namespace device_interop } // namespace mock @@ -257,9 +253,5 @@ bool interop_match_vendor_product_ids(const interop_feature_t feature, uint16_t return test::mock::device_interop::interop_match_vendor_product_ids(feature, vendor_id, product_id); } -bool token_to_ul(char* token, uint16_t* ul) { - inc_func_call_count(__func__); - return test::mock::device_interop::token_to_ul(token, ul); -} // Mocked functions complete // END mockcify generation diff --git a/system/test/mock/mock_device_interop.h b/system/test/mock/mock_device_interop.h index ecb08d79fb..79193f3525 100644 --- a/system/test/mock/mock_device_interop.h +++ b/system/test/mock/mock_device_interop.h @@ -460,17 +460,6 @@ struct interop_match_vendor_product_ids { }; extern struct interop_match_vendor_product_ids interop_match_vendor_product_ids; -// Name: token_to_ul -// Params: char* token, uint16_t* ul -// Return: bool -struct token_to_ul { - static bool return_value; - std::function<bool(char* token, uint16_t* ul)> body{ - [](char* /* token */, uint16_t* /* ul */) { return return_value; }}; - bool operator()(char* token, uint16_t* ul) { return body(token, ul); } -}; -extern struct token_to_ul token_to_ul; - } // namespace device_interop } // namespace mock } // namespace test diff --git a/system/test/mock/mock_device_iot_config.cc b/system/test/mock/mock_device_iot_config.cc index 61308a883a..9f01127d48 100644 --- a/system/test/mock/mock_device_iot_config.cc +++ b/system/test/mock/mock_device_iot_config.cc @@ -19,11 +19,9 @@ #include <cstdint> #include <string> +#include "device/include/device_iot_config.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace device_iot_config { diff --git a/system/test/mock/mock_jni_thread.cc b/system/test/mock/mock_jni_thread.cc index eb8b6db093..afc1a28570 100644 --- a/system/test/mock/mock_jni_thread.cc +++ b/system/test/mock/mock_jni_thread.cc @@ -28,9 +28,6 @@ #include "test/common/jni_thread.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool is_on_jni_thread() { inc_func_call_count(__func__); return false; @@ -46,8 +43,3 @@ bt_status_t do_in_jni_thread(base::OnceClosure task) { do_in_jni_thread_task_queue.push(std::move(task)); return BT_STATUS_SUCCESS; } -bt_status_t do_in_jni_thread(const base::Location& /* from_here */, base::OnceClosure task) { - inc_func_call_count(__func__); - do_in_jni_thread_task_queue.push(std::move(task)); - return BT_STATUS_SUCCESS; -} diff --git a/system/test/mock/mock_main_shim_acl.cc b/system/test/mock/mock_main_shim_acl.cc index 14bc02eb49..a98e809ad0 100644 --- a/system/test/mock/mock_main_shim_acl.cc +++ b/system/test/mock/mock_main_shim_acl.cc @@ -33,13 +33,8 @@ #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; -void DumpsysL2cap(int /* fd */) { inc_func_call_count(__func__); } - void DumpsysAcl(int /* fd */) { inc_func_call_count(__func__); } void DumpsysNeighbor(int /* fd */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_main_shim_acl_interface.cc b/system/test/mock/mock_main_shim_acl_interface.cc index 2ba6014443..b2f1d47af4 100644 --- a/system/test/mock/mock_main_shim_acl_interface.cc +++ b/system/test/mock/mock_main_shim_acl_interface.cc @@ -16,14 +16,10 @@ #include "main/shim/acl_interface.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace bluetooth { namespace shim { -namespace legacy { -acl_interface_t acl_interface_ = { +static acl_interface_t acl_interface_ = { .on_send_data_upwards = nullptr, .on_packets_completed = nullptr, @@ -72,6 +68,5 @@ acl_interface_t acl_interface_ = { const acl_interface_t& GetAclInterface() { return acl_interface_; } -} // namespace legacy } // namespace shim } // namespace bluetooth diff --git a/system/test/mock/mock_main_shim_hci_layer.cc b/system/test/mock/mock_main_shim_hci_layer.cc index c02f009333..97d6c6e801 100644 --- a/system/test/mock/mock_main_shim_hci_layer.cc +++ b/system/test/mock/mock_main_shim_hci_layer.cc @@ -31,9 +31,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace bluetooth::shim { namespace testing { const hci_t* test_interface = nullptr; @@ -48,8 +45,6 @@ namespace mock { namespace main_shim_hci_layer { // Function state capture and return values, if needed -struct OnTransmitPacketCommandComplete OnTransmitPacketCommandComplete; -struct OnTransmitPacketStatus OnTransmitPacketStatus; struct hci_on_reset_complete hci_on_reset_complete; struct hci_on_shutting_down hci_on_shutting_down; @@ -64,23 +59,6 @@ namespace main_shim_hci_layer {} // namespace main_shim_hci_layer } // namespace mock } // namespace test -// Mocked functions, if any -namespace cpp { -void OnTransmitPacketCommandComplete(command_complete_cb complete_callback, void* context, - bluetooth::hci::CommandCompleteView view) { - inc_func_call_count(__func__); - test::mock::main_shim_hci_layer::OnTransmitPacketCommandComplete(complete_callback, context, - view); -} -void OnTransmitPacketStatus(command_status_cb status_callback, void* context, - std::unique_ptr<OsiObject> command, - bluetooth::hci::CommandStatusView view) { - inc_func_call_count(__func__); - test::mock::main_shim_hci_layer::OnTransmitPacketStatus(status_callback, context, - std::move(command), view); -} -} // namespace cpp - void bluetooth::shim::hci_on_reset_complete() { inc_func_call_count(__func__); test::mock::main_shim_hci_layer::hci_on_reset_complete(); diff --git a/system/test/mock/mock_main_shim_hci_layer.h b/system/test/mock/mock_main_shim_hci_layer.h index 7973bece5d..b46e525a9c 100644 --- a/system/test/mock/mock_main_shim_hci_layer.h +++ b/system/test/mock/mock_main_shim_hci_layer.h @@ -54,39 +54,6 @@ namespace test { namespace mock { namespace main_shim_hci_layer { -// Shared state between mocked functions and tests -// Name: OnTransmitPacketCommandComplete -// Params: command_complete_cb complete_callback, void* context, -// bluetooth::hci::CommandCompleteView view Return: void -struct OnTransmitPacketCommandComplete { - std::function<void(command_complete_cb complete_callback, void* context, - bluetooth::hci::CommandCompleteView view)> - body{[](command_complete_cb /* complete_callback */, void* /* context */, - bluetooth::hci::CommandCompleteView /* view */) {}}; - void operator()(command_complete_cb complete_callback, void* context, - bluetooth::hci::CommandCompleteView view) { - body(complete_callback, context, view); - } -}; -extern struct OnTransmitPacketCommandComplete OnTransmitPacketCommandComplete; - -// Name: OnTransmitPacketStatus -// Params: command_status_cb status_callback, void* context, -// std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view -// Return: void -struct OnTransmitPacketStatus { - std::function<void(command_status_cb status_callback, void* context, - std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view)> - body{[](command_status_cb /* status_callback */, void* /* context */, - std::unique_ptr<OsiObject> /* command */, - bluetooth::hci::CommandStatusView /* view */) {}}; - void operator()(command_status_cb status_callback, void* context, - std::unique_ptr<OsiObject> command, bluetooth::hci::CommandStatusView view) { - body(status_callback, context, std::move(command), view); - } -}; -extern struct OnTransmitPacketStatus OnTransmitPacketStatus; - // Name: hci_layer_get_interface // Params: // Return: const hci_t* diff --git a/system/test/mock/mock_osi_future.cc b/system/test/mock/mock_osi_future.cc index c7c98a3ac7..d1b5e1b946 100644 --- a/system/test/mock/mock_osi_future.cc +++ b/system/test/mock/mock_osi_future.cc @@ -27,9 +27,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_future { @@ -37,7 +34,6 @@ namespace osi_future { // Function state capture and return values, if needed struct future_await future_await; struct future_new future_new; -struct future_new_named future_new_named; struct future_new_immediate future_new_immediate; struct future_ready future_ready; @@ -54,10 +50,6 @@ future_t* future_new(void) { inc_func_call_count(__func__); return test::mock::osi_future::future_new(); } -future_t* future_new_named(const char* name) { - inc_func_call_count(__func__); - return test::mock::osi_future::future_new_named(name); -} future_t* future_new_immediate(void* value) { inc_func_call_count(__func__); return test::mock::osi_future::future_new_immediate(value); diff --git a/system/test/mock/mock_osi_future.h b/system/test/mock/mock_osi_future.h index bb4ab1f610..e2fa5aad9b 100644 --- a/system/test/mock/mock_osi_future.h +++ b/system/test/mock/mock_osi_future.h @@ -57,17 +57,6 @@ struct future_new { }; extern struct future_new future_new; -// Name: future_new_named -// Params: const char* name -// Return: future_t* -struct future_new_named { - future_t* return_value{0}; - std::function<future_t*(const char* name)> body{ - [this](const char* /* name */) { return return_value; }}; - future_t* operator()(const char* name) { return body(name); } -}; -extern struct future_new_named future_new_named; - // Name: future_new_immediate // Params: void* value // Return: future_t* diff --git a/system/test/mock/mock_osi_list.cc b/system/test/mock/mock_osi_list.cc index 2aa2bfd462..c081aa5fd3 100644 --- a/system/test/mock/mock_osi_list.cc +++ b/system/test/mock/mock_osi_list.cc @@ -27,9 +27,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_list { @@ -49,7 +46,6 @@ struct list_insert_after list_insert_after; struct list_is_empty list_is_empty; struct list_length list_length; struct list_new list_new; -struct list_new_internal list_new_internal; struct list_next list_next; struct list_node list_node; struct list_prepend list_prepend; @@ -116,10 +112,6 @@ list_t* list_new(list_free_cb callback) { inc_func_call_count(__func__); return test::mock::osi_list::list_new(callback); } -list_t* list_new_internal(list_free_cb callback, const allocator_t* zeroed_allocator) { - inc_func_call_count(__func__); - return test::mock::osi_list::list_new_internal(callback, zeroed_allocator); -} list_node_t* list_next(const list_node_t* node) { inc_func_call_count(__func__); return test::mock::osi_list::list_next(node); diff --git a/system/test/mock/mock_osi_list.h b/system/test/mock/mock_osi_list.h index 86813a8adc..6f727953b4 100644 --- a/system/test/mock/mock_osi_list.h +++ b/system/test/mock/mock_osi_list.h @@ -193,21 +193,6 @@ struct list_new { }; extern struct list_new list_new; -// Name: list_new_internal -// Params: list_free_cb callback, const allocator_t* zeroed_allocator -// Return: list_t* -struct list_new_internal { - list_t* return_value{0}; - std::function<list_t*(list_free_cb callback, const allocator_t* zeroed_allocator)> body{ - [this](list_free_cb /* callback */, const allocator_t* /* zeroed_allocator */) { - return return_value; - }}; - list_t* operator()(list_free_cb callback, const allocator_t* zeroed_allocator) { - return body(callback, zeroed_allocator); - } -}; -extern struct list_new_internal list_new_internal; - // Name: list_next // Params: const list_node_t* node // Return: list_node_t* diff --git a/system/test/mock/mock_osi_mutex.cc b/system/test/mock/mock_osi_mutex.cc index ff8aa0afb2..e7e1db9ef8 100644 --- a/system/test/mock/mock_osi_mutex.cc +++ b/system/test/mock/mock_osi_mutex.cc @@ -23,13 +23,11 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_osi_mutex.h" +#include "osi/include/mutex.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_mutex { diff --git a/system/test/mock/mock_osi_properties.cc b/system/test/mock/mock_osi_properties.cc index f22b3e0e1d..28c0891f7c 100644 --- a/system/test/mock/mock_osi_properties.cc +++ b/system/test/mock/mock_osi_properties.cc @@ -26,13 +26,11 @@ #include <cstdint> #include <vector> +#include "osi/include/properties.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_properties { diff --git a/system/test/mock/mock_osi_properties.h b/system/test/mock/mock_osi_properties.h index ad1c29c8d3..bbdeb61474 100644 --- a/system/test/mock/mock_osi_properties.h +++ b/system/test/mock/mock_osi_properties.h @@ -24,9 +24,6 @@ #include <cstdint> #include <functional> -// Original included files, if any -#include <cutils/properties.h> - // Mocked compile conditionals, if any namespace test { diff --git a/system/test/mock/mock_osi_socket.cc b/system/test/mock/mock_osi_socket.cc index 7daa32c5e2..e605356954 100644 --- a/system/test/mock/mock_osi_socket.cc +++ b/system/test/mock/mock_osi_socket.cc @@ -23,13 +23,11 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_osi_socket.h" +#include "osi/include/socket_utils/sockets.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_socket { diff --git a/system/test/mock/mock_osi_thread_scheduler.cc b/system/test/mock/mock_osi_thread_scheduler.cc deleted file mode 100644 index a248efc327..0000000000 --- a/system/test/mock/mock_osi_thread_scheduler.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Generated mock file from original source file - * Functions generated:2 - * - * mockcify.pl ver 0.3.0 - */ -// Mock include file to share data between tests and mock -#include "test/mock/mock_osi_thread_scheduler.h" - -#include "test/common/mock_functions.h" - -// Mocked internal structures, if any - -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - -namespace test { -namespace mock { -namespace osi_thread_scheduler { - -// Function state capture and return values, if needed -struct thread_scheduler_enable_real_time thread_scheduler_enable_real_time; -struct thread_scheduler_get_priority_range thread_scheduler_get_priority_range; - -} // namespace osi_thread_scheduler -} // namespace mock -} // namespace test - -// Mocked functions, if any -bool thread_scheduler_enable_real_time(pid_t linux_tid) { - inc_func_call_count(__func__); - return test::mock::osi_thread_scheduler::thread_scheduler_enable_real_time(linux_tid); -} -bool thread_scheduler_get_priority_range(int& min, int& max) { - inc_func_call_count(__func__); - return test::mock::osi_thread_scheduler::thread_scheduler_get_priority_range(min, max); -} -// Mocked functions complete -// END mockcify generation diff --git a/system/test/mock/mock_osi_thread_scheduler.h b/system/test/mock/mock_osi_thread_scheduler.h deleted file mode 100644 index f80f84b069..0000000000 --- a/system/test/mock/mock_osi_thread_scheduler.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * Generated mock file from original source file - * Functions generated:2 - * - * mockcify.pl ver 0.3.0 - */ - -#include <sys/types.h> - -#include <functional> - -// Original included files, if any - -// Mocked compile conditionals, if any - -namespace test { -namespace mock { -namespace osi_thread_scheduler { - -// Shared state between mocked functions and tests -// Name: osi_enable_real_time_scheduling -// Params: pid_t linux_tid -// Return: bool -struct thread_scheduler_enable_real_time { - bool return_value{false}; - std::function<bool(pid_t linux_tid)> body{[this](pid_t /* linux_tid */) { return return_value; }}; - bool operator()(pid_t linux_tid) { return body(linux_tid); } -}; -extern struct thread_scheduler_enable_real_time thread_scheduler_enable_real_time; - -// Name: osi_fifo_scheduing_priority_range -// Params: int& min, int& max -// Return: bool -struct thread_scheduler_get_priority_range { - bool return_value{false}; - std::function<bool(int& min, int& max)> body{ - [this](int& /* min */, int& /* max */) { return return_value; }}; - bool operator()(int& min, int& max) { return body(min, max); } -}; -extern struct thread_scheduler_get_priority_range thread_scheduler_get_priority_range; - -} // namespace osi_thread_scheduler -} // namespace mock -} // namespace test - -// END mockcify generation diff --git a/system/test/mock/mock_osi_wakelock.cc b/system/test/mock/mock_osi_wakelock.cc index b2805a7cba..5a5759a16e 100644 --- a/system/test/mock/mock_osi_wakelock.cc +++ b/system/test/mock/mock_osi_wakelock.cc @@ -23,13 +23,11 @@ // Mock include file to share data between tests and mock #include "test/mock/mock_osi_wakelock.h" +#include "osi/include/wakelock.h" #include "test/common/mock_functions.h" // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace osi_wakelock { diff --git a/system/test/mock/mock_stack_a2dp_sbc.cc b/system/test/mock/mock_stack_a2dp_sbc.cc index 7423ae79cb..71c0dd24ff 100644 --- a/system/test/mock/mock_stack_a2dp_sbc.cc +++ b/system/test/mock/mock_stack_a2dp_sbc.cc @@ -25,15 +25,13 @@ #include <cstdint> #include <string> +#include "stack/include/a2dp_sbc.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_a2dp_sbc { diff --git a/system/test/mock/mock_stack_avrc_apt.cc b/system/test/mock/mock_stack_avrc_apt.cc index 2380d1756e..6922da47cf 100644 --- a/system/test/mock/mock_stack_avrc_apt.cc +++ b/system/test/mock/mock_stack_avrc_apt.cc @@ -24,15 +24,13 @@ #include <cstdint> +#include "stack/include/avrc_api.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_avrc_apt { diff --git a/system/test/mock/mock_stack_avrc_utils.cc b/system/test/mock/mock_stack_avrc_utils.cc index b4eca59731..6953823feb 100644 --- a/system/test/mock/mock_stack_avrc_utils.cc +++ b/system/test/mock/mock_stack_avrc_utils.cc @@ -24,15 +24,14 @@ #include <cstdint> +#include "stack/avrc/avrc_int.h" +#include "stack/include/avrc_api.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_avrc_utils { diff --git a/system/test/mock/mock_stack_btm_ble.cc b/system/test/mock/mock_stack_btm_ble.cc index 620b9e252c..f9dcac4673 100644 --- a/system/test/mock/mock_stack_btm_ble.cc +++ b/system/test/mock/mock_stack_btm_ble.cc @@ -25,7 +25,10 @@ #include <cstdint> #include <optional> +#include "stack/btm/btm_ble_int.h" #include "stack/include/btm_api_types.h" +#include "stack/include/btm_ble_api.h" +#include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_status.h" #include "test/common/mock_functions.h" @@ -33,9 +36,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_ble { @@ -70,10 +70,6 @@ struct btm_ble_ltk_request_reply btm_ble_ltk_request_reply; struct btm_ble_read_sec_key_size btm_ble_read_sec_key_size; struct btm_ble_reset_id btm_ble_reset_id; struct btm_ble_set_encryption btm_ble_set_encryption; -struct btm_ble_set_keep_rfu_in_auth_req btm_ble_set_keep_rfu_in_auth_req; -struct btm_ble_set_no_disc_if_pair_fail btm_ble_set_no_disc_if_pair_fail; -struct btm_ble_set_test_local_sign_cntr_value btm_ble_set_test_local_sign_cntr_value; -struct btm_ble_set_test_mac_value btm_ble_set_test_mac_value; struct btm_ble_start_encrypt btm_ble_start_encrypt; struct btm_ble_start_sec_check btm_ble_start_sec_check; struct btm_ble_test_command_complete btm_ble_test_command_complete; @@ -243,22 +239,6 @@ tBTM_STATUS btm_ble_set_encryption(const RawAddress& bd_addr, tBTM_BLE_SEC_ACT s inc_func_call_count(__func__); return test::mock::stack_btm_ble::btm_ble_set_encryption(bd_addr, sec_act, link_role); } -void btm_ble_set_keep_rfu_in_auth_req(bool keep_rfu) { - inc_func_call_count(__func__); - test::mock::stack_btm_ble::btm_ble_set_keep_rfu_in_auth_req(keep_rfu); -} -void btm_ble_set_no_disc_if_pair_fail(bool disable_disc) { - inc_func_call_count(__func__); - test::mock::stack_btm_ble::btm_ble_set_no_disc_if_pair_fail(disable_disc); -} -void btm_ble_set_test_local_sign_cntr_value(bool enable, uint32_t test_local_sign_cntr) { - inc_func_call_count(__func__); - test::mock::stack_btm_ble::btm_ble_set_test_local_sign_cntr_value(enable, test_local_sign_cntr); -} -void btm_ble_set_test_mac_value(bool enable, uint8_t* p_test_mac_val) { - inc_func_call_count(__func__); - test::mock::stack_btm_ble::btm_ble_set_test_mac_value(enable, p_test_mac_val); -} tBTM_STATUS btm_ble_start_encrypt(const RawAddress& bda, bool use_stk, Octet16* p_stk) { inc_func_call_count(__func__); return test::mock::stack_btm_ble::btm_ble_start_encrypt(bda, use_stk, p_stk); diff --git a/system/test/mock/mock_stack_btm_ble.h b/system/test/mock/mock_stack_btm_ble.h index 9c1b14d014..aed50358e2 100644 --- a/system/test/mock/mock_stack_btm_ble.h +++ b/system/test/mock/mock_stack_btm_ble.h @@ -414,46 +414,6 @@ struct btm_ble_set_encryption { }; extern struct btm_ble_set_encryption btm_ble_set_encryption; -// Name: btm_ble_set_keep_rfu_in_auth_req -// Params: bool keep_rfu -// Return: void -struct btm_ble_set_keep_rfu_in_auth_req { - std::function<void(bool)> body{[](bool /* keep_rfu */) {}}; - void operator()(bool keep_rfu) { body(keep_rfu); } -}; -extern struct btm_ble_set_keep_rfu_in_auth_req btm_ble_set_keep_rfu_in_auth_req; - -// Name: btm_ble_set_no_disc_if_pair_fail -// Params: bool disable_disc -// Return: void -struct btm_ble_set_no_disc_if_pair_fail { - std::function<void(bool)> body{[](bool /* disable_disc */) {}}; - void operator()(bool disable_disc) { body(disable_disc); } -}; -extern struct btm_ble_set_no_disc_if_pair_fail btm_ble_set_no_disc_if_pair_fail; - -// Name: btm_ble_set_test_local_sign_cntr_value -// Params: bool enable, uint32_t test_local_sign_cntr -// Return: void -struct btm_ble_set_test_local_sign_cntr_value { - std::function<void(bool enable, uint32_t test_local_sign_cntr)> body{ - [](bool /* enable */, uint32_t /* test_local_sign_cntr */) {}}; - void operator()(bool enable, uint32_t test_local_sign_cntr) { - body(enable, test_local_sign_cntr); - } -}; -extern struct btm_ble_set_test_local_sign_cntr_value btm_ble_set_test_local_sign_cntr_value; - -// Name: btm_ble_set_test_mac_value -// Params: bool enable, uint8_t* p_test_mac_val -// Return: void -struct btm_ble_set_test_mac_value { - std::function<void(bool enable, uint8_t* p_test_mac_val)> body{ - [](bool /* enable */, uint8_t* /* p_test_mac_val */) {}}; - void operator()(bool enable, uint8_t* p_test_mac_val) { body(enable, p_test_mac_val); } -}; -extern struct btm_ble_set_test_mac_value btm_ble_set_test_mac_value; - // Name: btm_ble_start_encrypt // Params: const RawAddress& bda, bool use_stk, Octet16* p_stk // Return: tBTM_STATUS diff --git a/system/test/mock/mock_stack_btm_ble_addr.cc b/system/test/mock/mock_stack_btm_ble_addr.cc index 2a52fb57ea..5f7998d1fc 100644 --- a/system/test/mock/mock_stack_btm_ble_addr.cc +++ b/system/test/mock/mock_stack_btm_ble_addr.cc @@ -25,6 +25,9 @@ // Original included files, if any +#include "stack/btm/btm_ble_int.h" +#include "stack/include/btm_ble_addr.h" +#include "stack/include/btm_ble_privacy.h" #include "test/common/mock_functions.h" #include "types/ble_address_with_type.h" #include "types/raw_address.h" @@ -32,9 +35,6 @@ // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_ble_addr { diff --git a/system/test/mock/mock_stack_btm_ble_gap.cc b/system/test/mock/mock_stack_btm_ble_gap.cc index e14ad5116b..1eafc5f416 100644 --- a/system/test/mock/mock_stack_btm_ble_gap.cc +++ b/system/test/mock/mock_stack_btm_ble_gap.cc @@ -27,6 +27,7 @@ #include "stack/btm/btm_ble_int.h" #include "stack/btm/btm_ble_int_types.h" #include "stack/include/bt_dev_class.h" +#include "stack/include/btm_ble_api.h" #include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" #include "stack/include/rnr_interface.h" @@ -34,9 +35,6 @@ #include "types/ble_address_with_type.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using StartSyncCb = base::Callback<void( uint8_t /*status*/, uint16_t /*sync_handle*/, uint8_t /*advertising_sid*/, uint8_t /*address_type*/, RawAddress /*address*/, uint8_t /*phy*/, uint16_t /*interval*/)>; @@ -104,10 +102,6 @@ void BTM_BleGetDynamicAudioBuffer( void BTM_BleGetVendorCapabilities(tBTM_BLE_VSC_CB* /* p_cmn_vsc_cb */) { inc_func_call_count(__func__); } -void BTM_BleSetScanParams(uint32_t /* scan_interval */, uint32_t /* scan_window */, - tBLE_SCAN_MODE /* scan_mode */, base::Callback<void(uint8_t)> /* cb */) { - inc_func_call_count(__func__); -} void btm_ble_decrement_link_topology_mask(uint8_t /* link_role */) { inc_func_call_count(__func__); } @@ -150,7 +144,8 @@ void btm_ble_write_adv_enable_complete(uint8_t* /* p */, uint16_t /* evt_len */) } void btm_send_hci_set_scan_params(uint8_t /* scan_type */, uint16_t /* scan_int_1m */, uint16_t /* scan_win_1m */, uint16_t /* scan_int_coded */, - uint16_t /* scan_win_coded */, tBLE_ADDR_TYPE /* addr_type_own */, + uint16_t /* scan_win_coded */, uint8_t /* scan_phy */, + tBLE_ADDR_TYPE /* addr_type_own */, uint8_t /* scan_filter_policy */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_stack_btm_ble_privacy.cc b/system/test/mock/mock_stack_btm_ble_privacy.cc index 7781d9cc75..4c523b12e8 100644 --- a/system/test/mock/mock_stack_btm_ble_privacy.cc +++ b/system/test/mock/mock_stack_btm_ble_privacy.cc @@ -25,14 +25,13 @@ // Original included files, if any +#include "stack/include/ble_hci_link_interface.h" +#include "stack/include/btm_ble_privacy.h" #include "test/common/mock_functions.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_ble_privacy { @@ -42,8 +41,6 @@ struct btm_ble_clear_resolving_list_complete btm_ble_clear_resolving_list_comple struct btm_ble_add_resolving_list_entry_complete btm_ble_add_resolving_list_entry_complete; struct btm_ble_remove_resolving_list_entry_complete btm_ble_remove_resolving_list_entry_complete; struct btm_ble_read_resolving_list_entry_complete btm_ble_read_resolving_list_entry_complete; -struct btm_ble_remove_resolving_list_entry btm_ble_remove_resolving_list_entry; -struct btm_ble_clear_resolving_list btm_ble_clear_resolving_list; struct btm_ble_read_resolving_list_entry btm_ble_read_resolving_list_entry; struct btm_ble_resolving_list_load_dev btm_ble_resolving_list_load_dev; struct btm_ble_resolving_list_remove_dev btm_ble_resolving_list_remove_dev; @@ -70,14 +67,6 @@ void btm_ble_read_resolving_list_entry_complete(const uint8_t* p, uint16_t evt_l inc_func_call_count(__func__); test::mock::stack_btm_ble_privacy::btm_ble_read_resolving_list_entry_complete(p, evt_len); } -tBTM_STATUS btm_ble_remove_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) { - inc_func_call_count(__func__); - return test::mock::stack_btm_ble_privacy::btm_ble_remove_resolving_list_entry(p_dev_rec); -} -void btm_ble_clear_resolving_list(void) { - inc_func_call_count(__func__); - test::mock::stack_btm_ble_privacy::btm_ble_clear_resolving_list(); -} bool btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) { inc_func_call_count(__func__); return test::mock::stack_btm_ble_privacy::btm_ble_read_resolving_list_entry(p_dev_rec); diff --git a/system/test/mock/mock_stack_btm_ble_privacy.h b/system/test/mock/mock_stack_btm_ble_privacy.h index 357e7adf3d..2cc88fac60 100644 --- a/system/test/mock/mock_stack_btm_ble_privacy.h +++ b/system/test/mock/mock_stack_btm_ble_privacy.h @@ -71,23 +71,6 @@ struct btm_ble_read_resolving_list_entry_complete { void operator()(const uint8_t* p, uint16_t evt_len) { body(p, evt_len); } }; extern struct btm_ble_read_resolving_list_entry_complete btm_ble_read_resolving_list_entry_complete; -// Name: btm_ble_remove_resolving_list_entry -// Params: tBTM_SEC_DEV_REC* p_dev_rec -// Returns: tBTM_STATUS -struct btm_ble_remove_resolving_list_entry { - std::function<tBTM_STATUS(tBTM_SEC_DEV_REC* p_dev_rec)> body{ - [](tBTM_SEC_DEV_REC* /* p_dev_rec */) { return tBTM_STATUS::BTM_SUCCESS; }}; - tBTM_STATUS operator()(tBTM_SEC_DEV_REC* p_dev_rec) { return body(p_dev_rec); } -}; -extern struct btm_ble_remove_resolving_list_entry btm_ble_remove_resolving_list_entry; -// Name: btm_ble_clear_resolving_list -// Params: void -// Returns: void -struct btm_ble_clear_resolving_list { - std::function<void(void)> body{[](void) {}}; - void operator()(void) { body(); } -}; -extern struct btm_ble_clear_resolving_list btm_ble_clear_resolving_list; // Name: btm_ble_read_resolving_list_entry // Params: tBTM_SEC_DEV_REC* p_dev_rec // Returns: bool diff --git a/system/test/mock/mock_stack_btm_dev.cc b/system/test/mock/mock_stack_btm_dev.cc index 60f88b0d6e..779d482219 100644 --- a/system/test/mock/mock_stack_btm_dev.cc +++ b/system/test/mock/mock_stack_btm_dev.cc @@ -28,13 +28,12 @@ #include "stack/btm/btm_dev.h" #include "stack/include/bt_octets.h" +#include "stack/include/btm_ble_addr.h" #include "stack/include/btm_client_interface.h" +#include "stack/include/btm_sec_api.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_dev { @@ -96,8 +95,6 @@ void btm_consolidate_dev(tBTM_SEC_DEV_REC* /* p_target_rec */) { inc_func_call_c void btm_dev_consolidate_existing_connections(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); } -void BTM_SecDump(const std::string& /* label */) { inc_func_call_count(__func__); } -void BTM_SecDumpDev(const RawAddress& /* bd_addr */) { inc_func_call_count(__func__); } std::vector<tBTM_SEC_DEV_REC*> btm_get_sec_dev_rec() { inc_func_call_count(__func__); return {}; diff --git a/system/test/mock/mock_stack_btm_devctl.cc b/system/test/mock/mock_stack_btm_devctl.cc index da8d8b2053..82a7f3f275 100644 --- a/system/test/mock/mock_stack_btm_devctl.cc +++ b/system/test/mock/mock_stack_btm_devctl.cc @@ -23,15 +23,15 @@ #include <stddef.h> #include <stdlib.h> +#include "stack/btm/internal/btm_api.h" #include "stack/include/bt_dev_class.h" #include "stack/include/btm_api_types.h" +#include "stack/include/btm_sec_api.h" #include "stack/include/btm_status.h" +#include "stack/include/dev_hci_link_interface.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - tBTM_STATUS BTM_DeleteStoredLinkKey(const RawAddress* /* bd_addr */, tBTM_CMPL_CB* /* p_cb */) { inc_func_call_count(__func__); return tBTM_STATUS::BTM_SUCCESS; diff --git a/system/test/mock/mock_stack_btm_hfp_lc3_encoder.cc b/system/test/mock/mock_stack_btm_hfp_lc3_encoder.cc index d2ed992484..ef5d533dcc 100644 --- a/system/test/mock/mock_stack_btm_hfp_lc3_encoder.cc +++ b/system/test/mock/mock_stack_btm_hfp_lc3_encoder.cc @@ -26,15 +26,13 @@ #ifndef __clang_analyzer__ +#include "stack/include/hfp_lc3_encoder.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_hfp_lc3_encoder { diff --git a/system/test/mock/mock_stack_btm_hfp_msbc_decoder.cc b/system/test/mock/mock_stack_btm_hfp_msbc_decoder.cc index dea537f621..92ef9ec1ef 100644 --- a/system/test/mock/mock_stack_btm_hfp_msbc_decoder.cc +++ b/system/test/mock/mock_stack_btm_hfp_msbc_decoder.cc @@ -24,15 +24,13 @@ #include <cstdint> +#include "stack/include/hfp_msbc_decoder.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_hfp_msbc_decoder { diff --git a/system/test/mock/mock_stack_btm_hfp_msbc_encoder.cc b/system/test/mock/mock_stack_btm_hfp_msbc_encoder.cc index 3c38e66754..f963bf9691 100644 --- a/system/test/mock/mock_stack_btm_hfp_msbc_encoder.cc +++ b/system/test/mock/mock_stack_btm_hfp_msbc_encoder.cc @@ -27,15 +27,13 @@ #ifndef __clang_analyzer__ +#include "stack/include/hfp_msbc_encoder.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_hfp_msbc_encoder { diff --git a/system/test/mock/mock_stack_btm_inq.cc b/system/test/mock/mock_stack_btm_inq.cc index ed99d05e6f..4c1f49a7e2 100644 --- a/system/test/mock/mock_stack_btm_inq.cc +++ b/system/test/mock/mock_stack_btm_inq.cc @@ -24,16 +24,16 @@ #include <cstdint> +#include "stack/btm/internal/btm_api.h" +#include "stack/include/btm_inq.h" #include "stack/include/btm_status.h" +#include "stack/include/inq_hci_link_interface.h" #include "test/common/mock_functions.h" // Original usings // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_inq { @@ -48,7 +48,6 @@ struct BTM_SetConnectability BTM_SetConnectability; struct BTM_SetDiscoverability BTM_SetDiscoverability; struct BTM_SetInquiryMode BTM_SetInquiryMode; struct BTM_StartInquiry BTM_StartInquiry; -struct btm_clr_inq_db btm_clr_inq_db; struct btm_clr_inq_result_flt btm_clr_inq_result_flt; struct btm_inq_db_find btm_inq_db_find; struct btm_inq_db_new btm_inq_db_new; @@ -116,10 +115,6 @@ tBTM_STATUS BTM_StartInquiry(tBTM_INQ_RESULTS_CB* p_results_cb, tBTM_CMPL_CB* p_ inc_func_call_count(__func__); return test::mock::stack_btm_inq::BTM_StartInquiry(p_results_cb, p_cmpl_cb); } -void btm_clr_inq_db(const RawAddress* p_bda) { - inc_func_call_count(__func__); - test::mock::stack_btm_inq::btm_clr_inq_db(p_bda); -} void btm_clr_inq_result_flt(void) { inc_func_call_count(__func__); test::mock::stack_btm_inq::btm_clr_inq_result_flt(); diff --git a/system/test/mock/mock_stack_btm_inq.h b/system/test/mock/mock_stack_btm_inq.h index 4c0acd08a4..68b9665dff 100644 --- a/system/test/mock/mock_stack_btm_inq.h +++ b/system/test/mock/mock_stack_btm_inq.h @@ -143,15 +143,6 @@ struct BTM_StartInquiry { }; extern struct BTM_StartInquiry BTM_StartInquiry; -// Name: btm_clr_inq_db -// Params: const RawAddress* p_bda -// Return: void -struct btm_clr_inq_db { - std::function<void(const RawAddress* p_bda)> body{[](const RawAddress* /* p_bda */) {}}; - void operator()(const RawAddress* p_bda) { body(p_bda); } -}; -extern struct btm_clr_inq_db btm_clr_inq_db; - // Name: btm_clr_inq_result_flt // Params: void // Return: void diff --git a/system/test/mock/mock_stack_btm_interface.cc b/system/test/mock/mock_stack_btm_interface.cc index 2361ce1307..44c542081d 100644 --- a/system/test/mock/mock_stack_btm_interface.cc +++ b/system/test/mock/mock_stack_btm_interface.cc @@ -18,6 +18,9 @@ * Generated mock file from original source file */ +#include "mock_stack_btm_interface.h" + +#include "stack/include/btm_ble_api.h" #include "stack/include/btm_ble_api_types.h" #include "stack/include/btm_ble_sec_api_types.h" #include "stack/include/btm_client_interface.h" @@ -26,9 +29,6 @@ #include "types/bt_transport.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - // Test accessible feature page uint8_t hci_feature_bytes_per_page[HCI_FEATURE_BYTES_PER_PAGE] = {}; diff --git a/system/test/mock/mock_stack_btm_main.cc b/system/test/mock/mock_stack_btm_main.cc index e188d0d89c..3dce60a6f4 100644 --- a/system/test/mock/mock_stack_btm_main.cc +++ b/system/test/mock/mock_stack_btm_main.cc @@ -21,13 +21,12 @@ #include <string> +#include "stack/include/btm_client_interface.h" +#include "stack/include/btm_log_history.h" #include "test/common/mock_functions.h" #include "types/ble_address_with_type.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - void BTM_LogHistory(const std::string& /* tag */, const RawAddress& /* bd_addr */, const std::string& /* msg */) { inc_func_call_count(__func__); diff --git a/system/test/mock/mock_stack_btm_sco.cc b/system/test/mock/mock_stack_btm_sco.cc index 0128227349..7012a3cfa3 100644 --- a/system/test/mock/mock_stack_btm_sco.cc +++ b/system/test/mock/mock_stack_btm_sco.cc @@ -24,15 +24,14 @@ #include "device/include/esco_parameters.h" #include "hci/class_of_device.h" #include "stack/btm/btm_sco.h" +#include "stack/btm/internal/btm_api.h" #include "stack/include/btm_api_types.h" #include "stack/include/btm_status.h" #include "stack/include/hci_error_code.h" +#include "stack/include/sco_hci_link_interface.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - const RawAddress* BTM_ReadScoBdAddr(uint16_t /* sco_inx */) { inc_func_call_count(__func__); return nullptr; diff --git a/system/test/mock/mock_stack_btm_sec.cc b/system/test/mock/mock_stack_btm_sec.cc index 4ca3189b30..ca943498fe 100644 --- a/system/test/mock/mock_stack_btm_sec.cc +++ b/system/test/mock/mock_stack_btm_sec.cc @@ -25,6 +25,8 @@ #include <cstdint> #include <string> +#include "stack/btm/btm_sec.h" +#include "stack/include/btm_ble_sec_api.h" #include "stack/include/btm_sec_api_types.h" #include "stack/include/btm_status.h" #include "test/common/mock_functions.h" @@ -34,9 +36,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_btm_sec { @@ -74,7 +73,6 @@ struct btm_rem_oob_req btm_rem_oob_req; struct btm_sec_abort_access_req btm_sec_abort_access_req; struct btm_sec_auth_complete btm_sec_auth_complete; struct btm_sec_bond_by_transport btm_sec_bond_by_transport; -struct btm_sec_check_pending_reqs btm_sec_check_pending_reqs; struct btm_sec_clear_ble_keys btm_sec_clear_ble_keys; struct btm_sec_conn_req btm_sec_conn_req; struct btm_sec_connected btm_sec_connected; @@ -124,7 +122,7 @@ bool BTM_SecIsLeSecurityPending::return_value = false; bool BTM_SecRegister::return_value = false; tBTM_STATUS BTM_SetEncryption::return_value = tBTM_STATUS::BTM_SUCCESS; bool BTM_SetSecurityLevel::return_value = false; -const DEV_CLASS btm_get_dev_class::return_value = kDevClassEmpty; +DEV_CLASS btm_get_dev_class::return_value = kDevClassEmpty; tBTM_STATUS btm_sec_bond_by_transport::return_value = tBTM_STATUS::BTM_SUCCESS; tBTM_STATUS btm_sec_disconnect::return_value = tBTM_STATUS::BTM_SUCCESS; bool btm_sec_is_a_bonded_dev::return_value = false; @@ -238,7 +236,7 @@ void btm_create_conn_cancel_complete(uint8_t status, const RawAddress bd_addr) { inc_func_call_count(__func__); test::mock::stack_btm_sec::btm_create_conn_cancel_complete(status, bd_addr); } -const DEV_CLASS btm_get_dev_class(const RawAddress& bda) { +DEV_CLASS btm_get_dev_class(const RawAddress& bda) { inc_func_call_count(__func__); return test::mock::stack_btm_sec::btm_get_dev_class(bda); } @@ -275,10 +273,6 @@ tBTM_STATUS btm_sec_bond_by_transport(const RawAddress& bd_addr, tBLE_ADDR_TYPE inc_func_call_count(__func__); return test::mock::stack_btm_sec::btm_sec_bond_by_transport(bd_addr, addr_type, transport); } -void btm_sec_check_pending_reqs(void) { - inc_func_call_count(__func__); - test::mock::stack_btm_sec::btm_sec_check_pending_reqs(); -} void btm_sec_clear_ble_keys(tBTM_SEC_DEV_REC* p_dev_rec) { inc_func_call_count(__func__); test::mock::stack_btm_sec::btm_sec_clear_ble_keys(p_dev_rec); diff --git a/system/test/mock/mock_stack_btm_sec.h b/system/test/mock/mock_stack_btm_sec.h index 688ab5dca1..a54782c9fb 100644 --- a/system/test/mock/mock_stack_btm_sec.h +++ b/system/test/mock/mock_stack_btm_sec.h @@ -345,10 +345,10 @@ extern struct btm_create_conn_cancel_complete btm_create_conn_cancel_complete; // Params: const RawAddress& bda // Return: DEV_CLASS struct btm_get_dev_class { - static const DEV_CLASS return_value; - std::function<const DEV_CLASS(const RawAddress& bda)> body{ + static DEV_CLASS return_value; + std::function<DEV_CLASS(const RawAddress& bda)> body{ [](const RawAddress& /* bda */) { return return_value; }}; - const DEV_CLASS operator()(const RawAddress& bda) { return body(bda); } + DEV_CLASS operator()(const RawAddress& bda) { return body(bda); } }; extern struct btm_get_dev_class btm_get_dev_class; @@ -439,15 +439,6 @@ struct btm_sec_bond_by_transport { }; extern struct btm_sec_bond_by_transport btm_sec_bond_by_transport; -// Name: btm_sec_check_pending_reqs -// Params: void -// Return: void -struct btm_sec_check_pending_reqs { - std::function<void(void)> body{[](void) {}}; - void operator()(void) { body(); } -}; -extern struct btm_sec_check_pending_reqs btm_sec_check_pending_reqs; - // Name: btm_sec_clear_ble_keys // Params: tBTM_SEC_DEV_REC* p_dev_rec // Return: void diff --git a/system/test/mock/mock_stack_hcic_hciblecmds.cc b/system/test/mock/mock_stack_hcic_hciblecmds.cc index b44bbff0a4..0a130b2024 100644 --- a/system/test/mock/mock_stack_hcic_hciblecmds.cc +++ b/system/test/mock/mock_stack_hcic_hciblecmds.cc @@ -28,9 +28,6 @@ // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_hcic_hciblecmds { @@ -69,7 +66,6 @@ struct btsnd_hcic_ble_set_periodic_advertising_receive_enable btsnd_hcic_ble_set_periodic_advertising_receive_enable; struct btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params; -struct btsnd_hcic_ble_set_privacy_mode btsnd_hcic_ble_set_privacy_mode; struct btsnd_hcic_ble_set_rand_priv_addr_timeout btsnd_hcic_ble_set_rand_priv_addr_timeout; struct btsnd_hcic_ble_set_scan_enable btsnd_hcic_ble_set_scan_enable; struct btsnd_hcic_ble_set_scan_params btsnd_hcic_ble_set_scan_params; @@ -227,12 +223,6 @@ void btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params( test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params( conn_handle, mode, skip, sync_timeout, cte_type, std::move(cb)); } -void btsnd_hcic_ble_set_privacy_mode(uint8_t addr_type_peer, const RawAddress& bda_peer, - uint8_t privacy_type) { - inc_func_call_count(__func__); - test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_set_privacy_mode(addr_type_peer, bda_peer, - privacy_type); -} void btsnd_hcic_ble_set_rand_priv_addr_timeout(uint16_t rpa_timeout) { inc_func_call_count(__func__); test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_set_rand_priv_addr_timeout(rpa_timeout); diff --git a/system/test/mock/mock_stack_hcic_hciblecmds.h b/system/test/mock/mock_stack_hcic_hciblecmds.h index c9855165f1..cbecbc4aee 100644 --- a/system/test/mock/mock_stack_hcic_hciblecmds.h +++ b/system/test/mock/mock_stack_hcic_hciblecmds.h @@ -371,19 +371,6 @@ struct btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params { extern struct btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params btsnd_hcic_ble_set_periodic_advertising_sync_transfer_params; -// Name: btsnd_hcic_ble_set_privacy_mode -// Params: uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t -// privacy_type Return: void -struct btsnd_hcic_ble_set_privacy_mode { - std::function<void(uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t privacy_type)> - body{[](uint8_t /* addr_type_peer */, const RawAddress& /* bda_peer */, - uint8_t /* privacy_type */) {}}; - void operator()(uint8_t addr_type_peer, const RawAddress& bda_peer, uint8_t privacy_type) { - body(addr_type_peer, bda_peer, privacy_type); - } -}; -extern struct btsnd_hcic_ble_set_privacy_mode btsnd_hcic_ble_set_privacy_mode; - // Name: btsnd_hcic_ble_set_rand_priv_addr_timeout // Params: uint16_t rpa_timeout // Return: void diff --git a/system/test/mock/mock_stack_l2cap_api.cc b/system/test/mock/mock_stack_l2cap_api.cc index de117f06a9..2d81fdeca3 100644 --- a/system/test/mock/mock_stack_l2cap_api.cc +++ b/system/test/mock/mock_stack_l2cap_api.cc @@ -24,14 +24,13 @@ // Original included files, if any +#include "stack/include/l2cap_module.h" +#include "stack/l2cap/internal/l2c_api.h" #include "test/common/mock_functions.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_l2cap_api { diff --git a/system/test/mock/mock_stack_l2cap_ble.cc b/system/test/mock/mock_stack_l2cap_ble.cc index 6224446eb0..0ddc91c917 100644 --- a/system/test/mock/mock_stack_l2cap_ble.cc +++ b/system/test/mock/mock_stack_l2cap_ble.cc @@ -25,15 +25,14 @@ // Original included files, if any +#include "stack/include/l2cap_controller_interface.h" +#include "stack/include/l2cap_hci_link_interface.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_l2cap_ble { diff --git a/system/test/mock/mock_stack_l2cap_main.cc b/system/test/mock/mock_stack_l2cap_main.cc index 606551fb98..8f6dcae4b3 100644 --- a/system/test/mock/mock_stack_l2cap_main.cc +++ b/system/test/mock/mock_stack_l2cap_main.cc @@ -20,12 +20,11 @@ */ #include "stack/include/bt_hdr.h" +#include "stack/include/l2cap_acl_interface.h" +#include "stack/include/l2cap_module.h" #include "stack/l2cap/l2c_int.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - tL2CAP_DW_RESULT l2c_data_write(uint16_t /* cid */, BT_HDR* /* p_data */, uint16_t /* flags */) { inc_func_call_count(__func__); return tL2CAP_DW_RESULT::FAILED; diff --git a/system/test/mock/mock_stack_l2cap_utils.cc b/system/test/mock/mock_stack_l2cap_utils.cc index f485c111e4..cca521601e 100644 --- a/system/test/mock/mock_stack_l2cap_utils.cc +++ b/system/test/mock/mock_stack_l2cap_utils.cc @@ -22,13 +22,13 @@ #include <cstdint> #include "stack/include/bt_hdr.h" +#include "stack/include/l2cap_controller_interface.h" +#include "stack/include/l2cap_hci_link_interface.h" +#include "stack/include/l2cap_security_interface.h" #include "stack/l2cap/l2c_int.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - bool l2c_is_cmd_rejected(uint8_t /* cmd_code */, uint8_t /* signal_id */, tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); return false; @@ -37,10 +37,6 @@ bool l2cu_create_conn_le(tL2C_LCB* /* p_lcb */) { inc_func_call_count(__func__); return false; } -bool l2cu_create_conn_le(tL2C_LCB* /* p_lcb */, uint8_t /* initiating_phys */) { - inc_func_call_count(__func__); - return false; -} bool l2cu_initialize_fixed_ccb(tL2C_LCB* /* p_lcb */, uint16_t /* fixed_cid */) { inc_func_call_count(__func__); return false; @@ -201,7 +197,7 @@ void l2cu_send_peer_config_rsp(tL2C_CCB* /* p_ccb */, tL2CAP_CFG_INFO* /* p_cfg inc_func_call_count(__func__); } void l2cu_send_peer_connect_req(tL2C_CCB* /* p_ccb */) { inc_func_call_count(__func__); } -void l2cu_send_peer_connect_rsp(tL2C_CCB* /* p_ccb */, uint16_t /* result */, +void l2cu_send_peer_connect_rsp(tL2C_CCB* /* p_ccb */, tL2CAP_CONN /* result */, uint16_t /* status */) { inc_func_call_count(__func__); } @@ -230,7 +226,7 @@ void l2cu_send_peer_info_rsp(tL2C_LCB* /* p_lcb */, uint8_t /* remote_id */, void l2cu_set_acl_hci_header(BT_HDR* /* p_buf */, tL2C_CCB* /* p_ccb */) { inc_func_call_count(__func__); } -void l2cu_set_lcb_handle(struct t_l2c_linkcb& /* p_lcb */, uint16_t /* handle */) { +void l2cu_set_lcb_handle(tL2C_LCB& /* p_lcb */, uint16_t /* handle */) { inc_func_call_count(__func__); } void l2cu_set_non_flushable_pbf(bool /* is_supported */) { inc_func_call_count(__func__); } diff --git a/system/test/mock/mock_stack_metrics_logging.cc b/system/test/mock/mock_stack_metrics_logging.cc index 751fcc3794..ff2cee4472 100644 --- a/system/test/mock/mock_stack_metrics_logging.cc +++ b/system/test/mock/mock_stack_metrics_logging.cc @@ -29,15 +29,13 @@ #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h> #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h> +#include "stack/include/stack_metrics_logging.h" #include "test/common/mock_functions.h" #include "types/raw_address.h" // Mocked compile conditionals, if any // Mocked internal structures, if any -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace test { namespace mock { namespace stack_metrics_logging { @@ -56,13 +54,6 @@ struct log_le_connection_status log_le_connection_status; struct log_le_device_in_accept_list log_le_device_in_accept_list; struct log_le_connection_lifecycle log_le_connection_lifecycle; struct log_le_connection_completion log_le_connection_completion; -struct log_le_connection_rejected log_le_connection_rejected; -struct log_hfp_ag_version log_hfp_ag_version; -struct log_hfp_hf_version log_hfp_hf_version; -struct log_hfp_rfcomm_channel_fail log_hfp_rfcomm_channel_fail; -struct log_hfp_rfcomm_collision_fail log_hfp_rfcomm_collision_fail; -struct log_hfp_rfcomm_ag_open_fail log_hfp_rfcomm_ag_open_fail; -struct log_hfp_slc_fail log_hfp_slc_fail; } // namespace stack_metrics_logging } // namespace mock @@ -105,16 +96,6 @@ void log_sdp_attribute(const RawAddress& address, uint16_t protocol_uuid, uint16 attribute_size, attribute_value); } void log_manufacturer_info(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) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_manufacturer_info(address, source_type, source_name, - manufacturer, model, hardware_version, - software_version); -} -void log_manufacturer_info(const RawAddress& address, android::bluetooth::AddressTypeEnum address_type, android::bluetooth::DeviceInfoSrcEnum source_type, const std::string& source_name, const std::string& manufacturer, @@ -167,39 +148,4 @@ void log_le_connection_completion(bluetooth::hci::Address address, bluetooth::hc test::mock::stack_metrics_logging::log_le_connection_completion(address, reason, is_locally_initiated); } - -void log_le_connection_rejected(bluetooth::hci::Address address) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_le_connection_rejected(address); -} - -void log_hfp_ag_version(bluetooth::hci::Address address, uint16_t version) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_ag_version(address, version); -} - -void log_hfp_hf_version(bluetooth::hci::Address address, uint16_t version) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_hf_version(address, version); -} - -void log_hfp_rfcomm_channel_fail(bluetooth::hci::Address address) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_rfcomm_channel_fail(address); -} - -void log_hfp_rfcomm_collision_fail(bluetooth::hci::Address address) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_rfcomm_collision_fail(address); -} - -void log_hfp_rfcomm_ag_open_fail(bluetooth::hci::Address address) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_rfcomm_ag_open_fail(address); -} - -void log_hfp_slc_fail(bluetooth::hci::Address address) { - inc_func_call_count(__func__); - test::mock::stack_metrics_logging::log_hfp_slc_fail(address); -} // END mockcify generation diff --git a/system/test/mock/mock_stack_metrics_logging.h b/system/test/mock/mock_stack_metrics_logging.h index d807c1f761..40212e60ea 100644 --- a/system/test/mock/mock_stack_metrics_logging.h +++ b/system/test/mock/mock_stack_metrics_logging.h @@ -247,58 +247,6 @@ struct log_le_connection_completion { }; extern struct log_le_connection_completion log_le_connection_completion; -// Name: log_le_connection_rejected -struct log_le_connection_rejected { - std::function<void(bluetooth::hci::Address)> body{[](bluetooth::hci::Address /* address */) {}}; - void operator()(bluetooth::hci::Address address) { body(address); } -}; - -extern struct log_le_connection_rejected log_le_connection_rejected; - -// Name: log_hfp_ag_version -struct log_hfp_ag_version { - std::function<void(bluetooth::hci::Address, uint16_t)> body{ - [](bluetooth::hci::Address /* address */, uint16_t /* version */) {}}; - void operator()(bluetooth::hci::Address address, uint16_t version) { body(address, version); } -}; -extern struct log_hfp_ag_version log_hfp_ag_version; - -// Name: log_hfp_hf_version -struct log_hfp_hf_version { - std::function<void(bluetooth::hci::Address, uint16_t)> body{ - [](bluetooth::hci::Address /* address */, uint16_t /* version */) {}}; - void operator()(bluetooth::hci::Address address, uint16_t version) { body(address, version); } -}; -extern struct log_hfp_hf_version log_hfp_hf_version; - -// Name: log_hfp_rfcomm_channel_fail -struct log_hfp_rfcomm_channel_fail { - std::function<void(bluetooth::hci::Address)> body{[](bluetooth::hci::Address /* address */) {}}; - void operator()(bluetooth::hci::Address address) { body(address); } -}; -extern struct log_hfp_rfcomm_channel_fail log_hfp_rfcomm_channel_fail; - -// Name: log_hfp_rfcomm_collision_fail -struct log_hfp_rfcomm_collision_fail { - std::function<void(bluetooth::hci::Address)> body{[](bluetooth::hci::Address /* address */) {}}; - void operator()(bluetooth::hci::Address address) { body(address); } -}; -extern struct log_hfp_rfcomm_collision_fail log_hfp_rfcomm_collision_fail; - -// Name: log_hfp_rfcomm_ag_open_fail -struct log_hfp_rfcomm_ag_open_fail { - std::function<void(bluetooth::hci::Address)> body{[](bluetooth::hci::Address /* address */) {}}; - void operator()(bluetooth::hci::Address address) { body(address); } -}; -extern struct log_hfp_rfcomm_ag_open_fail log_hfp_rfcomm_ag_open_fail; - -// Name: log_hfp_slc_fail -struct log_hfp_slc_fail { - std::function<void(bluetooth::hci::Address)> body{[](bluetooth::hci::Address /* address */) {}}; - void operator()(bluetooth::hci::Address address) { body(address); } -}; -extern struct log_hfp_slc_fail log_hfp_slc_fail; - } // namespace stack_metrics_logging } // namespace mock } // namespace test diff --git a/system/test/mock/mock_stack_security_client_interface.cc b/system/test/mock/mock_stack_security_client_interface.cc index 5ccb5e31df..3930c1a281 100644 --- a/system/test/mock/mock_stack_security_client_interface.cc +++ b/system/test/mock/mock_stack_security_client_interface.cc @@ -19,9 +19,6 @@ #include "stack/include/security_client_callbacks.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - namespace { // Initialize the working btm client interface to the default @@ -42,6 +39,6 @@ const SecurityClientInterface& get_security_client_interface() { return *mock_security_client_interface; } -void set_security_client_interface(SecurityClientInterface* interface) { - mock_security_client_interface = interface; +void set_security_client_interface(SecurityClientInterface& interface) { + mock_security_client_interface = &interface; } diff --git a/system/test/mock/mock_udrv_ulinux_uipc.cc b/system/test/mock/mock_udrv_ulinux_uipc.cc index daa7cc7f7c..6ecd0bdd1f 100644 --- a/system/test/mock/mock_udrv_ulinux_uipc.cc +++ b/system/test/mock/mock_udrv_ulinux_uipc.cc @@ -24,9 +24,6 @@ #include "test/common/mock_functions.h" #include "udrv/include/uipc.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - std::unique_ptr<tUIPC_STATE> mock_uipc_init_ret; uint32_t mock_uipc_read_ret; bool mock_uipc_send_ret; @@ -41,10 +38,6 @@ bool UIPC_Send(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, uint16_t /* msg inc_func_call_count(__func__); return mock_uipc_send_ret; } -int uipc_start_main_server_thread(tUIPC_STATE& /* uipc */) { - inc_func_call_count(__func__); - return 0; -} std::unique_ptr<tUIPC_STATE> UIPC_Init() { inc_func_call_count(__func__); return std::move(mock_uipc_init_ret); @@ -64,8 +57,3 @@ bool UIPC_Ioctl(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */, uint32_t /* re return false; } void UIPC_Close(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */) { inc_func_call_count(__func__); } -void uipc_close_locked(tUIPC_STATE& /* uipc */, tUIPC_CH_ID /* ch_id */) { - inc_func_call_count(__func__); -} -void uipc_main_cleanup(tUIPC_STATE& /* uipc */) { inc_func_call_count(__func__); } -void uipc_stop_main_server_thread(tUIPC_STATE& /* uipc */) { inc_func_call_count(__func__); } diff --git a/system/test/stub/osi.cc b/system/test/stub/osi.cc index c087497528..5177f86803 100644 --- a/system/test/stub/osi.cc +++ b/system/test/stub/osi.cc @@ -34,17 +34,19 @@ #include "osi/include/future.h" #include "osi/include/hash_map_utils.h" #include "osi/include/list.h" +#include "osi/include/mutex.h" +#include "osi/include/properties.h" #include "osi/include/reactor.h" #include "osi/include/ringbuffer.h" #include "osi/include/socket.h" +#include "osi/include/socket_utils/socket_local.h" +#include "osi/include/socket_utils/sockets.h" #include "osi/include/thread.h" #include "osi/include/wakelock.h" #include "osi/src/compat.cc" // For strlcpy #include "test/common/fake_osi.h" #include "test/common/mock_functions.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" #pragma GCC diagnostic ignored "-Wunused-parameter" OsiObject::OsiObject(void* ptr) : ptr_(ptr) {} @@ -511,10 +513,6 @@ list_t* list_new(list_free_cb callback) { inc_func_call_count(__func__); return nullptr; } -list_t* list_new_internal(list_free_cb callback, const allocator_t* zeroed_allocator) { - inc_func_call_count(__func__); - return nullptr; -} size_t list_length(const list_t* list) { inc_func_call_count(__func__); return 0; diff --git a/system/udrv/ulinux/uipc.cc b/system/udrv/ulinux/uipc.cc index d0d7de0fbb..c3444d4b57 100644 --- a/system/udrv/ulinux/uipc.cc +++ b/system/udrv/ulinux/uipc.cc @@ -47,9 +47,6 @@ #include "osi/include/osi.h" #include "osi/include/socket_utils/sockets.h" -// TODO(b/369381361) Enfore -Wmissing-prototypes -#pragma GCC diagnostic ignored "-Wmissing-prototypes" - using namespace bluetooth; /***************************************************************************** @@ -223,7 +220,7 @@ static int uipc_main_init(tUIPC_STATE& uipc) { return 0; } -void uipc_main_cleanup(tUIPC_STATE& uipc) { +static void uipc_main_cleanup(tUIPC_STATE& uipc) { int i; log::debug("uipc_main_cleanup"); @@ -433,7 +430,7 @@ static int uipc_close_ch_locked(tUIPC_STATE& uipc, tUIPC_CH_ID ch_id) { return 0; } -void uipc_close_locked(tUIPC_STATE& uipc, tUIPC_CH_ID ch_id) { +static void uipc_close_locked(tUIPC_STATE& uipc, tUIPC_CH_ID ch_id) { if (uipc.ch[ch_id].srvfd == UIPC_DISCONNECTED) { log::debug("CHANNEL {} ALREADY CLOSED", ch_id); return; @@ -499,7 +496,7 @@ static void* uipc_read_task(void* arg) { return nullptr; } -int uipc_start_main_server_thread(tUIPC_STATE& uipc) { +static int uipc_start_main_server_thread(tUIPC_STATE& uipc) { uipc.running = 1; if (pthread_create(&uipc.tid, (const pthread_attr_t*)NULL, uipc_read_task, &uipc) != 0) { @@ -511,7 +508,7 @@ int uipc_start_main_server_thread(tUIPC_STATE& uipc) { } /* blocking call */ -void uipc_stop_main_server_thread(tUIPC_STATE& uipc) { +static void uipc_stop_main_server_thread(tUIPC_STATE& uipc) { /* request shutdown of read thread */ { std::lock_guard<std::recursive_mutex> lock(uipc.mutex); |