1 // This file is autogenerated
2 
3 #pragma once
4 
5 #include <stdint.h>
6 #include <vector>
7 #include <map>
8 #include <set>
9 #include <stddef.h>
10 
11 #ifndef __ANDROID_API_T__
12 #define __ANDROID_API_T__ 33
13 #endif
14 #ifndef __INTRODUCED_IN
15 #define __INTRODUCED_IN(api_level)
16 #endif
17 
18 namespace nfc {
19 namespace stats {
20 
21 /*
22  * API For logging statistics events.
23  */
24 
25 /**
26  * Constants for atom codes.
27  */
28 enum {
29 
30     /**
31      * NfcErrorOccurred nfc_error_occurred
32      * Usage: stats_write(NFC_ERROR_OCCURRED, int32_t type, int32_t nci_cmd, int32_t error_ntf_status_code);
33      */
34     NFC_ERROR_OCCURRED = 134,
35 
36     /**
37      * NfcStateChanged nfc_state_changed
38      * Usage: stats_write(NFC_STATE_CHANGED, int32_t state);
39      */
40     NFC_STATE_CHANGED = 135,
41 
42     /**
43      * NfcBeamOccurred nfc_beam_occurred
44      * Usage: stats_write(NFC_BEAM_OCCURRED, int32_t operation);
45      */
46     NFC_BEAM_OCCURRED = 136,
47 
48     /**
49      * NfcCardemulationOccurred nfc_cardemulation_occurred
50      * Usage: stats_write(NFC_CARDEMULATION_OCCURRED, int32_t category, char const* se_name, int32_t uid);
51      */
52     NFC_CARDEMULATION_OCCURRED = 137,
53 
54     /**
55      * NfcTagOccurred nfc_tag_occurred
56      * Usage: stats_write(NFC_TAG_OCCURRED, int32_t type, int32_t uid, const std::vector<int32_t>& rf_types, int32_t bt_device_type, char const* bt_device_info);
57      */
58     NFC_TAG_OCCURRED = 138,
59 
60     /**
61      * NfcHceTransactionOccurred nfc_hce_transaction_occurred
62      * Usage: stats_write(NFC_HCE_TRANSACTION_OCCURRED, int32_t latency_micros);
63      */
64     NFC_HCE_TRANSACTION_OCCURRED = 139,
65 
66     /**
67      * NfcTagTypeOccurred nfc_tag_type_occurred
68      * Usage: stats_write(NFC_TAG_TYPE_OCCURRED, int32_t type);
69      */
70     NFC_TAG_TYPE_OCCURRED = 560,
71 
72     /**
73      * NfcAIDConflictOccurred nfc_aid_conflict_occurred
74      * Usage: stats_write(NFC_AID_CONFLICT_OCCURRED, char const* conflicting_aid);
75      */
76     NFC_AID_CONFLICT_OCCURRED = 561,
77 
78     /**
79      * NfcReaderConflictOccurred nfc_reader_conflict_occurred
80      * Usage: stats_write(NFC_READER_CONFLICT_OCCURRED);
81      */
82     NFC_READER_CONFLICT_OCCURRED = 562,
83 
84     /**
85      * NfcObserveModeStateChanged nfc_observe_mode_state_changed
86      * Usage: stats_write(NFC_OBSERVE_MODE_STATE_CHANGED, int32_t state, int32_t trigger_source, int32_t latency_millis);
87      */
88     NFC_OBSERVE_MODE_STATE_CHANGED = 855,
89 
90     /**
91      * NfcFieldChanged nfc_field_changed
92      * Usage: stats_write(NFC_FIELD_CHANGED, int32_t field_status, int32_t field_strength);
93      */
94     NFC_FIELD_CHANGED = 856,
95 
96     /**
97      * NfcPollingLoopNotificationReported nfc_polling_loop_notification_reported
98      * Usage: stats_write(NFC_POLLING_LOOP_NOTIFICATION_REPORTED, int32_t proprietary_frame_type, int32_t repeat_count);
99      */
100     NFC_POLLING_LOOP_NOTIFICATION_REPORTED = 857,
101 
102     /**
103      * NfcProprietaryCapabilitiesReported nfc_proprietary_capabilities_reported
104      * Usage: stats_write(NFC_PROPRIETARY_CAPABILITIES_REPORTED, int32_t passive_observe_mode, bool is_polling_frame_notification_supported, bool is_power_saving_mode_supported, bool is_autotransact_polling_loop_filter_supported, int32_t number_of_exit_frames_supported);
105      */
106     NFC_PROPRIETARY_CAPABILITIES_REPORTED = 858
107 
108 };
109 
110 //
111 // Constants for enum values
112 //
113 
114 // Values for NfcErrorOccurred.type
115 const int32_t NFC_ERROR_OCCURRED__TYPE__UNKNOWN = 0;
116 const int32_t NFC_ERROR_OCCURRED__TYPE__CMD_TIMEOUT = 1;
117 const int32_t NFC_ERROR_OCCURRED__TYPE__ERROR_NOTIFICATION = 2;
118 const int32_t NFC_ERROR_OCCURRED__TYPE__AID_OVERFLOW = 3;
119 const int32_t NFC_ERROR_OCCURRED__TYPE__HCE_LATE_BINDING = 4;
120 const int32_t NFC_ERROR_OCCURRED__TYPE__NFC_ACCESS_CHECK_ERROR = 5;
121 const int32_t NFC_ERROR_OCCURRED__TYPE__SE_INCORRECT_FORMAT = 6;
122 
123 // Values for NfcStateChanged.state
124 const int32_t NFC_STATE_CHANGED__STATE__UNKNOWN = 0;
125 const int32_t NFC_STATE_CHANGED__STATE__OFF = 1;
126 const int32_t NFC_STATE_CHANGED__STATE__ON = 2;
127 const int32_t NFC_STATE_CHANGED__STATE__ON_LOCKED = 3;
128 const int32_t NFC_STATE_CHANGED__STATE__CRASH_RESTART = 4;
129 
130 // Values for NfcBeamOccurred.operation
131 const int32_t NFC_BEAM_OCCURRED__OPERATION__UNKNOWN = 0;
132 const int32_t NFC_BEAM_OCCURRED__OPERATION__SEND = 1;
133 const int32_t NFC_BEAM_OCCURRED__OPERATION__RECEIVE = 2;
134 
135 // Values for NfcCardemulationOccurred.category
136 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__UNKNOWN = 0;
137 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__HCE_PAYMENT = 1;
138 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__HCE_OTHER = 2;
139 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__OFFHOST = 3;
140 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__OFFHOST_PAYMENT = 4;
141 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__OFFHOST_OTHER = 5;
142 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_NO_ROUTING = 6;
143 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_PAYMENT_WRONG_SETTING = 7;
144 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_OTHER_WRONG_SETTING = 8;
145 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_BOUND = 9;
146 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_OTHER_DISCONNECTED_BEFORE_BOUND = 10;
147 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_PAYMENT_DISCONNECTED_BEFORE_RESPONSE = 11;
148 const int32_t NFC_CARDEMULATION_OCCURRED__CATEGORY__FAILED_HCE_OTHER_DISCONNECTED_BEFORE_RESPONSE = 12;
149 
150 // Values for NfcTagOccurred.type
151 const int32_t NFC_TAG_OCCURRED__TYPE__UNKNOWN = 0;
152 const int32_t NFC_TAG_OCCURRED__TYPE__URL = 1;
153 const int32_t NFC_TAG_OCCURRED__TYPE__BT_PAIRING = 2;
154 const int32_t NFC_TAG_OCCURRED__TYPE__PROVISION = 3;
155 const int32_t NFC_TAG_OCCURRED__TYPE__WIFI_CONNECT = 4;
156 const int32_t NFC_TAG_OCCURRED__TYPE__APP_LAUNCH = 5;
157 const int32_t NFC_TAG_OCCURRED__TYPE__OTHERS = 6;
158 const int32_t NFC_TAG_OCCURRED__TYPE__FOREGROUND_DISPATCH = 7;
159 const int32_t NFC_TAG_OCCURRED__TYPE__APP_LAUNCH_NDEF_MUTE = 8;
160 const int32_t NFC_TAG_OCCURRED__TYPE__APP_LAUNCH_TECH_MUTE = 9;
161 const int32_t NFC_TAG_OCCURRED__TYPE__APP_LAUNCH_TAG_MUTE = 10;
162 
163 // Values for NfcTagOccurred.rf_types
164 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_UNKNOWN = 0;
165 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NFC_A = 1;
166 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NFC_B = 2;
167 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_ISO_DEP = 3;
168 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NFC_F = 4;
169 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NFC_V = 5;
170 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NDEF = 6;
171 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NDEF_FORMATABLE = 7;
172 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_MIFARE_CLASSIC = 8;
173 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_MIFARE_ULTRALIGHT = 9;
174 const int32_t NFC_TAG_OCCURRED__RF_TYPES__RF_NFC_BARCODE = 10;
175 
176 // Values for NfcTagOccurred.bt_device_type
177 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_MISC = 0;
178 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_COMPUTER = 256;
179 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_PHONE = 512;
180 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_NETWORKING = 768;
181 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_AUDIO_VIDEO = 1024;
182 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_PERIPHERAL = 1280;
183 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_IMAGING = 1536;
184 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_WEARABLE = 1792;
185 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_TOY = 2048;
186 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_HEALTH = 2304;
187 const int32_t NFC_TAG_OCCURRED__BT_DEVICE_TYPE__MAJOR_CLASS_UNCATEGORIZED = 7936;
188 
189 // Values for NfcTagTypeOccurred.type
190 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_UNKNOWN = 0;
191 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_1 = 1;
192 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_2 = 2;
193 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_3 = 3;
194 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_4A = 4;
195 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_4B = 5;
196 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_TYPE_5 = 6;
197 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_MIFARE_CLASSIC = 7;
198 const int32_t NFC_TAG_TYPE_OCCURRED__TYPE__TAG_KOVIO_BARCODE = 8;
199 
200 // Values for NfcObserveModeStateChanged.state
201 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__STATE__STATE_UNKNOWN = 0;
202 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__STATE__OBSERVE_MODE_DISABLED = 1;
203 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__STATE__OBSERVE_MODE_ENABLED = 2;
204 
205 // Values for NfcObserveModeStateChanged.trigger_source
206 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__TRIGGER_SOURCE__TRIGGER_SOURCE_UNKNOWN = 0;
207 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__TRIGGER_SOURCE__WALLET_ROLE_HOLDER = 1;
208 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__TRIGGER_SOURCE__FOREGROUND_APP = 2;
209 const int32_t NFC_OBSERVE_MODE_STATE_CHANGED__TRIGGER_SOURCE__AUTO_TRANSACT = 3;
210 
211 // Values for NfcFieldChanged.field_status
212 const int32_t NFC_FIELD_CHANGED__FIELD_STATUS__FIELD_STATUS_UNKNOWN = 0;
213 const int32_t NFC_FIELD_CHANGED__FIELD_STATUS__FIELD_OFF = 1;
214 const int32_t NFC_FIELD_CHANGED__FIELD_STATUS__FIELD_ON = 2;
215 
216 // Values for NfcPollingLoopNotificationReported.proprietary_frame_type
217 const int32_t NFC_POLLING_LOOP_NOTIFICATION_REPORTED__PROPRIETARY_FRAME_TYPE__PROPRIETARY_FRAME_UNKNOWN = 0;
218 const int32_t NFC_POLLING_LOOP_NOTIFICATION_REPORTED__PROPRIETARY_FRAME_TYPE__ECP_V1 = 1;
219 const int32_t NFC_POLLING_LOOP_NOTIFICATION_REPORTED__PROPRIETARY_FRAME_TYPE__ECP_V2 = 2;
220 
221 // Values for NfcProprietaryCapabilitiesReported.passive_observe_mode
222 const int32_t NFC_PROPRIETARY_CAPABILITIES_REPORTED__PASSIVE_OBSERVE_MODE__MODE_UNKNOWN = 0;
223 const int32_t NFC_PROPRIETARY_CAPABILITIES_REPORTED__PASSIVE_OBSERVE_MODE__NOT_SUPPORTED = 1;
224 const int32_t NFC_PROPRIETARY_CAPABILITIES_REPORTED__PASSIVE_OBSERVE_MODE__SUPPORT_WITH_RF_DEACTIVATION = 2;
225 const int32_t NFC_PROPRIETARY_CAPABILITIES_REPORTED__PASSIVE_OBSERVE_MODE__SUPPORT_WITHOUT_RF_DEACTIVATION = 3;
226 
227 struct BytesField {
BytesFieldBytesField228   BytesField(char const* array, size_t len) : arg(array), arg_length(len) {}
229   char const* arg;
230   size_t arg_length;
231 };
232 
233 //
234 // Write methods
235 //
236 int stats_write(int32_t code);
237 int stats_write(int32_t code, int32_t arg1);
238 int stats_write(int32_t code, int32_t arg1, bool arg2, bool arg3, bool arg4, int32_t arg5);
239 int stats_write(int32_t code, int32_t arg1, int32_t arg2);
240 int stats_write(int32_t code, int32_t arg1, int32_t arg2, int32_t arg3);
241 int stats_write(int32_t code, int32_t arg1, int32_t arg2, const std::vector<int32_t>& arg3, int32_t arg4, char const* arg5)
242 __INTRODUCED_IN(__ANDROID_API_T__);
243 int stats_write(int32_t code, int32_t arg1, char const* arg2, int32_t arg3);
244 int stats_write(int32_t code, char const* arg1);
245 
246 //
247 // Write flattened methods
248 //
249 
250 //
251 // Add AStatsEvent methods
252 //
253 
254 } // namespace stats
255 } // namespace nfc
256