1// 2// Copyright (C) 2024 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 com_android_nfc; 20 21option java_package = "com.android.nfc.proto"; 22option java_outer_classname = "NfcEventProto"; 23 24// Proto used to format NFC event logs. 25message EventList { 26 repeated Event events = 1; 27} 28 29message Event { 30 required string timestamp = 1; 31 required EventType event_type = 2; 32} 33 34// Union of events. 35message EventType { 36 oneof _EventType { 37 NfcBootupState bootup_state = 1; 38 NfcStateChange state_change = 2; 39 NfcReaderModeChange reader_mode_change = 3; 40 NfcCeUnroutableAid ce_unroutable_aid = 4; 41 NfcObserveModeChange observe_mode_change = 5; 42 NfcWalletRoleHolderChange wallet_role_holder_change = 6; 43 NfcHostCardEmulationStateChange host_card_emulation_state_change = 7; 44 NfcHostCardEmulationData host_card_emulation_data = 8; 45 NfcRemoteFieldStateChange remote_field_state_change = 9; 46 NfcDiscoveryTechnologyUpdate discovery_technology_update = 10; 47 NfcSecureChange secure_change = 11; 48 NfcWlcStateChange wlc_state_change = 12; 49 NfcReaderOptionChange reader_option_change = 13; 50 NfcClearPreference clear_preference = 14; 51 NfcCeRoutedAid ce_routed_aid = 15; 52 NfcAidRegistration aid_registration = 16; 53 NfcPollingLoopRegistration polling_loop_registration = 17; 54 NfcDataMigrationInProgress data_migration_in_progress = 18; 55 NfcPaymentServiceBindState payment_service_bind_state = 19; 56 } 57} 58 59message NfcBootupState { 60 required bool enabled = 1; 61} 62 63message NfcAppInfo { 64 optional string package_name = 1; 65 optional int32 uid = 2; 66} 67 68message NfcComponentInfo { 69 optional string package_name = 1; 70 optional string class_name = 2; 71} 72 73message NfcStateChange { 74 required NfcAppInfo app_info = 1; 75 required bool enabled = 2; 76} 77 78message NfcReaderModeChange { 79 optional NfcAppInfo app_info = 1; 80 required int32 flags = 2; 81} 82 83message NfcCeUnroutableAid { 84 required string aid = 1; 85} 86 87message NfcObserveModeChange { 88 optional NfcAppInfo app_info = 1; 89 required bool enable = 2; 90 required bool result = 3; 91 required int32 latency_ms = 4; 92} 93 94message NfcWalletRoleHolderChange { 95 optional string package_name = 1; 96} 97 98message NfcHostCardEmulationStateChange { 99 required int32 technology = 1; 100 required bool enable = 2; 101} 102 103message NfcHostCardEmulationData { 104 required int32 technology = 1; 105 required bytes data = 2; 106} 107 108message NfcRemoteFieldStateChange { 109 required bool field_on = 1; 110} 111 112message NfcDiscoveryTechnologyUpdate { 113 required NfcAppInfo app_info = 1; 114 required int32 poll_tech = 2; 115 required int32 listen_tech = 3; 116} 117 118message NfcSecureChange { 119 required bool enable = 1; 120} 121 122message NfcWlcStateChange { 123 required bool enable = 1; 124} 125 126message NfcReaderOptionChange { 127 required bool enable = 1; 128 required NfcAppInfo app_info = 2; 129} 130 131message NfcClearPreference {} 132 133message NfcCeRoutedAid { 134 required string aid = 1; 135 required NfcComponentInfo component_info = 2; 136} 137 138message NfcAidRegistration { 139 required NfcAppInfo app_info = 1; 140 required NfcComponentInfo component_info = 2; 141 required bool is_registration = 3; 142 repeated string aids = 4; 143} 144 145message NfcPollingLoopRegistration { 146 required NfcAppInfo app_info = 1; 147 required NfcComponentInfo component_info = 2; 148 required bool is_registration = 3; 149 required string polling_loop_filter = 4; 150} 151 152message NfcDataMigrationInProgress { 153 required NfcAppInfo app_info = 1; 154 required bool in_progress = 2; 155} 156 157enum BindState { 158 SERVICE_CONNECTED = 0; 159 SERVICE_DISCONNECTED = 1; 160 SERVICE_BINDING_DIED = 2; 161} 162 163message NfcPaymentServiceBindState { 164 required NfcComponentInfo component_info = 1; 165 required BindState bind_state = 2; 166} 167