1 /*
2 * Copyright 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 /*
18 * Generated mock file from original source file
19 * Functions generated:5
20 *
21 * mockcify.pl ver 0.2
22 */
23
24 #include <map>
25 #include <string>
26
27 extern std::map<std::string, int> mock_function_count_map;
28
29 // Original included files, if any
30 // NOTE: Since this is a mock file with mock definitions some number of
31 // include files may not be required. The include-what-you-use
32 // still applies, but crafting proper inclusion is out of scope
33 // for this effort. This compilation unit may compile as-is, or
34 // may need attention to prune the inclusion set.
35 #include <frameworks/proto_logging/stats/enums/bluetooth/enums.pb.h>
36 #include <frameworks/proto_logging/stats/enums/bluetooth/hci/enums.pb.h>
37 #include "common/metrics.h"
38 #include "main/shim/metrics_api.h"
39 #include "main/shim/shim.h"
40 #include "stack/include/stack_metrics_logging.h"
41 #include "types/raw_address.h"
42
43 // Mock include file to share data between tests and mock
44 #include "test/mock/mock_stack_metrics_logging.h"
45
46 // Mocked compile conditionals, if any
47 #ifndef UNUSED_ATTR
48 #define UNUSED_ATTR
49 #endif
50
51 // Mocked internal structures, if any
52
53 namespace test {
54 namespace mock {
55 namespace stack_metrics_logging {
56
57 // Function state capture and return values, if needed
58 struct log_classic_pairing_event log_classic_pairing_event;
59 struct log_link_layer_connection_event log_link_layer_connection_event;
60 struct log_smp_pairing_event log_smp_pairing_event;
61 struct log_sdp_attribute log_sdp_attribute;
62 struct log_manufacturer_info log_manufacturer_info;
63
64 } // namespace stack_metrics_logging
65 } // namespace mock
66 } // namespace test
67
68 // Mocked functions, if any
log_classic_pairing_event(const RawAddress & address,uint16_t handle,uint32_t hci_cmd,uint16_t hci_event,uint16_t cmd_status,uint16_t reason_code,int64_t event_value)69 void log_classic_pairing_event(const RawAddress& address, uint16_t handle,
70 uint32_t hci_cmd, uint16_t hci_event,
71 uint16_t cmd_status, uint16_t reason_code,
72 int64_t event_value) {
73 mock_function_count_map[__func__]++;
74 test::mock::stack_metrics_logging::log_classic_pairing_event(
75 address, handle, hci_cmd, hci_event, cmd_status, reason_code,
76 event_value);
77 }
log_link_layer_connection_event(const RawAddress * address,uint32_t connection_handle,android::bluetooth::DirectionEnum direction,uint16_t link_type,uint32_t hci_cmd,uint16_t hci_event,uint16_t hci_ble_event,uint16_t cmd_status,uint16_t reason_code)78 void log_link_layer_connection_event(
79 const RawAddress* address, uint32_t connection_handle,
80 android::bluetooth::DirectionEnum direction, uint16_t link_type,
81 uint32_t hci_cmd, uint16_t hci_event, uint16_t hci_ble_event,
82 uint16_t cmd_status, uint16_t reason_code) {
83 mock_function_count_map[__func__]++;
84 test::mock::stack_metrics_logging::log_link_layer_connection_event(
85 address, connection_handle, direction, link_type, hci_cmd, hci_event,
86 hci_ble_event, cmd_status, reason_code);
87 }
log_smp_pairing_event(const RawAddress & address,uint8_t smp_cmd,android::bluetooth::DirectionEnum direction,uint8_t smp_fail_reason)88 void log_smp_pairing_event(const RawAddress& address, uint8_t smp_cmd,
89 android::bluetooth::DirectionEnum direction,
90 uint8_t smp_fail_reason) {
91 mock_function_count_map[__func__]++;
92 test::mock::stack_metrics_logging::log_smp_pairing_event(
93 address, smp_cmd, direction, smp_fail_reason);
94 }
log_sdp_attribute(const RawAddress & address,uint16_t protocol_uuid,uint16_t attribute_id,size_t attribute_size,const char * attribute_value)95 void log_sdp_attribute(const RawAddress& address, uint16_t protocol_uuid,
96 uint16_t attribute_id, size_t attribute_size,
97 const char* attribute_value) {
98 mock_function_count_map[__func__]++;
99 test::mock::stack_metrics_logging::log_sdp_attribute(
100 address, protocol_uuid, attribute_id, attribute_size, attribute_value);
101 }
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)102 void log_manufacturer_info(const RawAddress& address,
103 android::bluetooth::DeviceInfoSrcEnum source_type,
104 const std::string& source_name,
105 const std::string& manufacturer,
106 const std::string& model,
107 const std::string& hardware_version,
108 const std::string& software_version) {
109 mock_function_count_map[__func__]++;
110 test::mock::stack_metrics_logging::log_manufacturer_info(
111 address, source_type, source_name, manufacturer, model, hardware_version,
112 software_version);
113 }
114
115 // END mockcify generation
116