1/* 2 * Copyright (C) 2023 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 17syntax = "proto2"; 18 19package android.os.statsd.nfc; 20 21import "frameworks/proto_logging/stats/atom_field_options.proto"; 22import "frameworks/proto_logging/stats/atoms.proto"; 23 24option java_package = "com.android.nfc"; 25 26extend Atom { 27 optional NfcObserveModeStateChanged nfc_observe_mode_state_changed = 855 [(module) = "nfc"]; 28 optional NfcFieldChanged nfc_field_changed = 856 [(module) = "nfc"]; 29 optional NfcPollingLoopNotificationReported nfc_polling_loop_notification_reported = 857 [(module) = "nfc"]; 30 optional NfcProprietaryCapabilitiesReported nfc_proprietary_capabilities_reported = 858 [(module) = "nfc"]; 31} 32 33message NfcObserveModeStateChanged { 34 enum State { 35 STATE_UNKNOWN = 0; 36 OBSERVE_MODE_DISABLED = 1; 37 OBSERVE_MODE_ENABLED = 2; 38 } 39 40 enum TriggerSource { 41 TRIGGER_SOURCE_UNKNOWN = 0; 42 WALLET_ROLE_HOLDER = 1; 43 FOREGROUND_APP = 2; 44 AUTO_TRANSACT = 3; 45 } 46 47 optional State state = 1; 48 optional TriggerSource trigger_source = 2; 49 optional int32 latency_millis = 3; // time between first polling frame and this state change 50} 51 52message NfcFieldChanged { 53 enum FieldStatus { 54 FIELD_STATUS_UNKNOWN = 0; 55 FIELD_OFF = 1; 56 FIELD_ON = 2; 57 } 58 59 optional FieldStatus field_status = 1; 60 optional int32 field_strength = 2; // units are undefined and will vary by vendor 61} 62 63message NfcPollingLoopNotificationReported { 64 enum ProprietaryFrameType { 65 PROPRIETARY_FRAME_UNKNOWN = 0; 66 ECP_V1 = 1; 67 ECP_V2 = 2; 68 } 69 70 optional ProprietaryFrameType proprietary_frame_type = 1; 71 optional int32 repeat_count = 2; 72} 73 74message NfcProprietaryCapabilitiesReported { 75 enum PassiveObserveMode { 76 MODE_UNKNOWN = 0; 77 NOT_SUPPORTED = 1; 78 SUPPORT_WITH_RF_DEACTIVATION = 2; 79 SUPPORT_WITHOUT_RF_DEACTIVATION = 3; 80 } 81 82 optional PassiveObserveMode passive_observe_mode = 1; 83 optional bool is_polling_frame_notification_supported = 2; 84 optional bool is_power_saving_mode_supported = 3; 85 optional bool is_autotransact_polling_loop_filter_supported = 4; 86} 87