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

Commit 0d4e6e2f authored by Chris Manton's avatar Chris Manton
Browse files

Revert "Revert "Remove unused mocks""

This reverts commit 53962abc.
Bug: 191431228
Tag: #refactor
Test: gd/cert/run

Reason for revert: probably works

Change-Id: I57a7b73944ff5f8c4744eb4f761e6955fce09ee5
parent b627908c
Loading
Loading
Loading
Loading
+0 −96
Original line number Diff line number Diff line
/*
 * Copyright 2020 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:17
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <stddef.h>
#include "bt_common.h"
#include "bta/include/bta_api.h"
#include "bta/include/utl.h"
#include "bta/sys/bta_sys.h"
#include "bta/sys/bta_sys_int.h"
#include "osi/include/osi.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

void bta_sys_app_close(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_app_open(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_busy(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_collision_register(uint8_t bta_id, tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_conn_close(uint8_t id, uint8_t app_id,
                        const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_conn_open(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_idle(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_notify_collision(const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_notify_role_chg(const RawAddress& peer_addr, uint8_t new_role,
                             tHCI_STATUS hci_status) {
  mock_function_count_map[__func__]++;
}
void bta_sys_pm_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_rm_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_role_chg_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_close(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_open(uint8_t id, uint8_t app_id, const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_register(tBTA_SYS_CONN_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_unuse(uint8_t id, uint8_t app_id,
                       const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
void bta_sys_sco_use(UNUSED_ATTR uint8_t id, uint8_t app_id,
                     const RawAddress& peer_addr) {
  mock_function_count_map[__func__]++;
}
+0 −167
Original line number Diff line number Diff line
/*
 * Copyright 2020 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 <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <cstdint>
#include "bta/include/bta_api.h"
#include "include/hardware/bluetooth.h"
#include "types/bt_transport.h"
#include "types/raw_address.h"

struct uid_set_t;

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

bool btif_dm_pairing_is_busy() {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_cod(const RawAddress* remote_bdaddr, uint32_t cod) {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_cod_hid(const RawAddress* remote_bdaddr) {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_cod_hid(const RawAddress& remote_bdaddr) {
  mock_function_count_map[__func__]++;
  return false;
}
bool check_sdp_bl(const RawAddress* remote_bdaddr) {
  mock_function_count_map[__func__]++;
  return false;
}
bt_status_t btif_dm_get_adapter_property(bt_property_t* prop) {
  mock_function_count_map[__func__]++;
  return BT_STATUS_SUCCESS;
}
bt_status_t btif_in_execute_service_request(tBTA_SERVICE_ID service_id,
                                            bool b_enable) {
  mock_function_count_map[__func__]++;
  return BT_STATUS_SUCCESS;
}
uint16_t btif_dm_get_connection_state(const RawAddress* bd_addr) {
  mock_function_count_map[__func__]++;
  return 0;
}
void BTIF_dm_disable() { mock_function_count_map[__func__]++; }
void BTIF_dm_enable() { mock_function_count_map[__func__]++; }
void BTIF_dm_on_hw_error() { mock_function_count_map[__func__]++; }
void BTIF_dm_report_inquiry_status_change(uint8_t status) {
  mock_function_count_map[__func__]++;
}
void bte_dm_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data) {
  mock_function_count_map[__func__]++;
}
void btif_ble_receiver_test(uint8_t rx_freq) {
  mock_function_count_map[__func__]++;
}
void btif_ble_test_end() { mock_function_count_map[__func__]++; }
void btif_ble_transmitter_test(uint8_t tx_freq, uint8_t test_data_len,
                               uint8_t packet_payload) {
  mock_function_count_map[__func__]++;
}
void btif_debug_bond_event_dump(int fd) { mock_function_count_map[__func__]++; }
void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req, bool is_consent) {
  mock_function_count_map[__func__]++;
}
void btif_dm_cancel_bond(const RawAddress bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_cancel_discovery(void) { mock_function_count_map[__func__]++; }
void btif_dm_cleanup(void) { mock_function_count_map[__func__]++; }
void btif_dm_create_bond(const RawAddress bd_addr, int transport) {
  mock_function_count_map[__func__]++;
}
void btif_dm_create_bond_out_of_band(const RawAddress bd_addr, int transport,
                                     const bt_oob_data_t p192_data,
                                     const bt_oob_data_t p256_data) {
  mock_function_count_map[__func__]++;
}
void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable) {
  mock_function_count_map[__func__]++;
}
void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask,
                                Octet16* p_er,
                                tBTA_BLE_LOCAL_ID_KEYS* p_id_keys) {
  mock_function_count_map[__func__]++;
}
void btif_dm_get_remote_services(RawAddress remote_addr, const int transport) {
  mock_function_count_map[__func__]++;
}
void btif_dm_hh_open_failed(RawAddress* bdaddr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_init(uid_set_t* set) { mock_function_count_map[__func__]++; }
void btif_dm_load_ble_local_keys(void) { mock_function_count_map[__func__]++; }
void btif_dm_on_disable() { mock_function_count_map[__func__]++; }
void btif_dm_pin_reply(const RawAddress bd_addr, uint8_t accept,
                       uint8_t pin_len, bt_pin_code_t pin_code) {
  mock_function_count_map[__func__]++;
}
void btif_dm_proc_io_req(tBTM_AUTH_REQ* p_auth_req, bool is_orig) {
  mock_function_count_map[__func__]++;
}
void btif_dm_proc_io_rsp(UNUSED_ATTR const RawAddress& bd_addr,
                         tBTM_IO_CAP io_cap, UNUSED_ATTR tBTM_OOB_DATA oob_data,
                         tBTM_AUTH_REQ auth_req) {
  mock_function_count_map[__func__]++;
}
void btif_dm_read_energy_info() { mock_function_count_map[__func__]++; }
void btif_dm_remove_ble_bonding_keys(void) {
  mock_function_count_map[__func__]++;
}
void btif_dm_remove_bond(const RawAddress bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_save_ble_bonding_keys(RawAddress& bd_addr) {
  mock_function_count_map[__func__]++;
}
void btif_dm_set_oob_for_io_req(tBTM_OOB_DATA* p_has_oob_data) {
  mock_function_count_map[__func__]++;
}
void btif_dm_set_oob_for_le_io_req(const RawAddress& bd_addr,
                                   tBTM_OOB_DATA* p_has_oob_data,
                                   tBTM_LE_AUTH_REQ* p_auth_req) {
  mock_function_count_map[__func__]++;
}
void btif_dm_ssp_reply(const RawAddress bd_addr, bt_ssp_variant_t variant,
                       uint8_t accept) {
  mock_function_count_map[__func__]++;
}
void btif_dm_start_discovery(void) { mock_function_count_map[__func__]++; }
void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr,
                                          BD_NAME bd_name,
                                          tBT_DEVICE_TYPE dev_type) {
  mock_function_count_map[__func__]++;
}

void btif_dm_proc_loc_oob(tBT_TRANSPORT transport, bool is_valid,
                          const Octet16& c, const Octet16& r) {
  mock_function_count_map[__func__]++;
}
+0 −50
Original line number Diff line number Diff line
/*
 * Copyright 2020 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:6
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include "stack/include/gap_api.h"
#include "types/raw_address.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

bool GAP_BleCancelReadPeerDevName(const RawAddress& peer_bda) {
  mock_function_count_map[__func__]++;
  return false;
}
bool GAP_BleReadPeerDevName(const RawAddress& peer_bda,
                            tGAP_BLE_CMPL_CBACK* p_cback) {
  mock_function_count_map[__func__]++;
  return false;
}
bool GAP_BleReadPeerPrefConnParams(const RawAddress& peer_bda) {
  mock_function_count_map[__func__]++;
  return false;
}
void GAP_BleAttrDBUpdate(uint16_t attr_uuid, tGAP_BLE_ATTR_VALUE* p_value) {
  mock_function_count_map[__func__]++;
}
void gap_attr_db_init(void) { mock_function_count_map[__func__]++; }
+0 −59
Original line number Diff line number Diff line
/*
 * Copyright 2020 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:4
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include <base/bind.h>
#include <base/callback.h>
#include <base/location.h>
#include <base/logging.h>
#include <map>
#include <memory>
#include <set>
#include "internal_include/bt_trace.h"
#include "main/shim/shim.h"
#include "osi/include/alarm.h"
#include "osi/include/log.h"
#include "stack/btm/btm_ble_bgconn.h"
#include "stack/gatt/connection_manager.h"
#include "stack/include/l2c_api.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

bool connection_manager::direct_connect_add(uint8_t app_id,
                                            const RawAddress& address) {
  mock_function_count_map[__func__]++;
  return false;
}
bool connection_manager::direct_connect_remove(uint8_t app_id,
                                               const RawAddress& address) {
  mock_function_count_map[__func__]++;
  return false;
}
void connection_manager::on_connection_complete(const RawAddress& address) {
  mock_function_count_map[__func__]++;
}
void connection_manager::reset(bool) { mock_function_count_map[__func__]++; }
+0 −111
Original line number Diff line number Diff line
/*
 * Copyright 2020 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:23
 */

#include <map>
#include <string>

extern std::map<std::string, int> mock_function_count_map;

#include "bt_common.h"
#include "bt_target.h"
#include "btm_ble_int.h"
#include "device/include/interop.h"
#include "l2c_api.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/btm_sec.h"
#include "stack/gatt/gatt_int.h"
#include "stack/include/l2cap_acl_interface.h"

#ifndef UNUSED_ATTR
#define UNUSED_ATTR
#endif

bool gatt_act_connect(tGATT_REG* p_reg, const RawAddress& bd_addr,
                      tBT_TRANSPORT transport, int8_t initiating_phys) {
  mock_function_count_map[__func__]++;
  return false;
}
bool gatt_connect(const RawAddress& rem_bda, tGATT_TCB* p_tcb,
                  tBT_TRANSPORT transport, uint8_t initiating_phys,
                  tGATT_IF gatt_if) {
  mock_function_count_map[__func__]++;
  return false;
}
bool gatt_disconnect(tGATT_TCB* p_tcb) {
  mock_function_count_map[__func__]++;
  return false;
}
bool gatt_update_app_hold_link_status(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
                                      bool is_add) {
  mock_function_count_map[__func__]++;
  return false;
}
tGATT_CH_STATE gatt_get_ch_state(tGATT_TCB* p_tcb) {
  mock_function_count_map[__func__]++;
  return GATT_CH_CLOSE;
}
void gatt_add_a_bonded_dev_for_srv_chg(const RawAddress& bda) {
  mock_function_count_map[__func__]++;
}
void gatt_chk_srv_chg(tGATTS_SRV_CHG* p_srv_chg_clt) {
  mock_function_count_map[__func__]++;
}
void gatt_data_process(tGATT_TCB& tcb, uint16_t cid, BT_HDR* p_buf) {
  mock_function_count_map[__func__]++;
}
void gatt_find_in_device_record(const RawAddress& bd_addr,
                                tBLE_BD_ADDR* address_with_type) {
  mock_function_count_map[__func__]++;
}
void gatt_free(void) { mock_function_count_map[__func__]++; }
void gatt_init(void) { mock_function_count_map[__func__]++; }
void gatt_init_srv_chg(void) { mock_function_count_map[__func__]++; }
void gatt_l2cif_config_cfm_cback(uint16_t lcid, uint16_t initiator,
                                 tL2CAP_CFG_INFO* p_cfg) {
  mock_function_count_map[__func__]++;
}
void gatt_l2cif_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
  mock_function_count_map[__func__]++;
}
void gatt_l2cif_disconnect_ind_cback(uint16_t lcid, bool ack_needed) {
  mock_function_count_map[__func__]++;
}
void gatt_notify_conn_update(const RawAddress&, uint16_t interval,
                             uint16_t latency, uint16_t timeout,
                             tHCI_STATUS status) {
  mock_function_count_map[__func__]++;
}
void gatt_notify_phy_updated(tGATT_STATUS status, uint16_t handle,
                             uint8_t tx_phy, uint8_t rx_phy) {
  mock_function_count_map[__func__]++;
}
void gatt_proc_srv_chg(void) { mock_function_count_map[__func__]++; }
void gatt_send_srv_chg_ind(const RawAddress& peer_bda) {
  mock_function_count_map[__func__]++;
}
void gatt_set_ch_state(tGATT_TCB* p_tcb, tGATT_CH_STATE ch_state) {
  mock_function_count_map[__func__]++;
}
void gatt_update_app_use_link_flag(tGATT_IF gatt_if, tGATT_TCB* p_tcb,
                                   bool is_add, bool check_acl_link) {
  mock_function_count_map[__func__]++;
}
Loading