1 /* 2 * Copyright (C) 2022 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 * Util class to handle Nfc statsd logging 19 */ 20 class NfcStatsUtil { 21 public: 22 virtual ~NfcStatsUtil() = default; 23 24 /******************************************************************************* 25 ** 26 ** Function: logNfcTagType 27 ** 28 ** Description: determine Nfc tag type from given protocol and log 29 ** accordingly 30 ** protocol: tag protocol 31 ** discoveryMode: tag discovery mode 32 ** 33 ** Returns: None 34 ** 35 *******************************************************************************/ 36 void logNfcTagType(int protocol, int discoveryMode); 37 38 private: 39 /******************************************************************************* 40 ** 41 ** Function: writeNfcStatsTagTypeOccurred 42 ** 43 ** Description: stats_write TagTypeOccurred atom with provided type 44 ** tagType: NfcTagType defined in 45 ** frameworks/proto_logging/stats/enums/nfc/enums.proto 46 ** 47 ** Returns: None 48 ** 49 *******************************************************************************/ 50 virtual void writeNfcStatsTagTypeOccurred(int tagType); 51 }; 52