blob: a166b283f55b811f204c99bbf7b8a0e6ddcadbcd [file] [log] [blame]
Nick Pelly590b73b2010-10-12 13:00:50 -07001/*
2 * Copyright (C) 2010 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
17package android.nfc;
18
Jeff Hamilton52d32032011-01-08 15:31:26 -060019import android.app.PendingIntent;
Jeff Hamilton52d32032011-01-08 15:31:26 -060020import android.content.IntentFilter;
Nick Pelly590b73b2010-10-12 13:00:50 -070021import android.nfc.NdefMessage;
22import android.nfc.Tag;
Jeff Hamiltond88e9aa2011-01-24 14:53:00 -060023import android.nfc.TechListParcel;
Martijn Coenen5b1e0322013-09-02 20:38:47 -070024import android.nfc.IAppCallback;
Nick Pelly367f41f2011-03-08 11:43:30 -080025import android.nfc.INfcAdapterExtras;
George Chang78fad0d2021-04-15 00:07:00 +080026import android.nfc.INfcControllerAlwaysOnListener;
suryaprakash.konduruace29c12023-12-04 23:12:58 +053027import android.nfc.INfcVendorNciCallback;
Nick Pellyc84c89a2011-08-22 22:27:11 -070028import android.nfc.INfcTag;
Martijn Coenena7397882013-07-30 20:07:47 -070029import android.nfc.INfcCardEmulation;
Yoshinobu Itoc52adfe2016-01-22 18:14:18 +090030import android.nfc.INfcFCardEmulation;
Roshan Piusa4329542024-03-25 13:01:21 -070031import android.nfc.INfcOemExtensionCallback;
Andres Morales11d2e532014-07-23 12:39:55 -070032import android.nfc.INfcUnlockHandler;
Martijn Coenend55def82016-04-14 15:19:31 +020033import android.nfc.ITagRemovedCallback;
Love Khanna755a8fa2017-05-17 15:52:16 +053034import android.nfc.INfcDta;
Jack Yu09033512023-10-17 14:02:45 +000035import android.nfc.INfcWlcStateListener;
Omer Ozer43c4ff62022-10-13 22:11:47 +000036import android.nfc.NfcAntennaInfo;
Jack Yudc872e02024-01-09 09:40:40 +000037import android.nfc.WlcListenerDeviceInfo;
Brad Lassey897900a2024-04-10 17:35:50 -040038import android.nfc.cardemulation.PollingFrame;
Martijn Coenen5b1e0322013-09-02 20:38:47 -070039import android.os.Bundle;
Nick Pelly590b73b2010-10-12 13:00:50 -070040
41/**
42 * @hide
43 */
44interface INfcAdapter
45{
Nick Pelly590b73b2010-10-12 13:00:50 -070046 INfcTag getNfcTagInterface();
Martijn Coenena7397882013-07-30 20:07:47 -070047 INfcCardEmulation getNfcCardEmulationInterface();
Yoshinobu Itoc52adfe2016-01-22 18:14:18 +090048 INfcFCardEmulation getNfcFCardEmulationInterface();
Jeff Hamiltonbb951c82011-11-08 16:55:13 -060049 INfcAdapterExtras getNfcAdapterExtrasInterface(in String pkg);
Love Khanna755a8fa2017-05-17 15:52:16 +053050 INfcDta getNfcDtaInterface(in String pkg);
Nick Pelly8d32a012011-08-09 07:03:49 -070051 int getState();
ziyiwa97474d2024-03-20 22:27:10 +000052 boolean disable(boolean saveState, in String pkg);
53 boolean enable(in String pkg);
Andres Morales9c4f4002014-09-08 17:09:16 -070054 void pausePolling(int timeoutInMs);
55 void resumePolling();
Nick Pellyc84c89a2011-08-22 22:27:11 -070056
57 void setForegroundDispatch(in PendingIntent intent,
58 in IntentFilter[] filters, in TechListParcel techLists);
Martijn Coenen5b1e0322013-09-02 20:38:47 -070059 void setAppCallback(in IAppCallback callback);
Nick Pellyc97a5522012-01-05 15:13:01 +110060
Martijn Coenend55def82016-04-14 15:19:31 +020061 boolean ignore(int nativeHandle, int debounceMs, ITagRemovedCallback callback);
62
Nick Pelly1f5badc2012-01-24 13:22:58 -080063 void dispatch(in Tag tag);
Martijn Coenen188cddb2012-01-31 22:16:15 -080064
Roshan498e9ae2024-08-29 12:54:01 -070065 void setReaderMode (IBinder b, IAppCallback callback, int flags, in Bundle extras, String pkg);
Andres Morales3b33fd22014-05-20 09:25:07 -070066
Andres Morales11d2e532014-07-23 12:39:55 -070067 void addNfcUnlockHandler(INfcUnlockHandler unlockHandler, in int[] techList);
Andres Moralesf9a97942014-08-14 15:43:30 -070068 void removeNfcUnlockHandler(INfcUnlockHandler unlockHandler);
Martijn Coenend8bcfba2014-11-13 15:00:56 -080069
70 void verifyNfcPermission();
Ruchi Kandoid97bb092019-01-08 14:16:25 -080071 boolean isNfcSecureEnabled();
72 boolean deviceSupportsNfcSecure();
73 boolean setNfcSecure(boolean enable);
Omer Ozer43c4ff62022-10-13 22:11:47 +000074 NfcAntennaInfo getNfcAntennaInfo();
Ruchi Kandoid97bb092019-01-08 14:16:25 -080075
Roshan Pius60d125b2024-09-18 14:06:47 +000076 void setControllerAlwaysOn(int mode);
George Chang50521892021-03-23 20:24:28 +080077 boolean isControllerAlwaysOn();
78 boolean isControllerAlwaysOnSupported();
George Chang78fad0d2021-04-15 00:07:00 +080079 void registerControllerAlwaysOnListener(in INfcControllerAlwaysOnListener listener);
80 void unregisterControllerAlwaysOnListener(in INfcControllerAlwaysOnListener listener);
George Changba43e332022-11-24 14:25:27 +080081 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
82 boolean isTagIntentAppPreferenceSupported();
83 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
84 Map getTagIntentAppPreferenceForUser(int userId);
85 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
86 int setTagIntentAppPreferenceForUser(int userId, String pkg, boolean allow);
jhh.seo65025ba2023-09-11 12:56:30 +090087
88 boolean isReaderOptionEnabled();
89 boolean isReaderOptionSupported();
90 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
ziyiw1f51a662024-08-13 18:24:23 +000091 boolean enableReaderOption(boolean enable, in String pkg);
Brad Lasseyb8c4f9b2023-09-01 11:30:09 -040092 boolean isObserveModeSupported();
Brad Lasseyee03676a2024-01-27 14:29:51 -050093 boolean isObserveModeEnabled();
James Willcox953f7662024-05-20 18:11:13 +000094 boolean setObserveMode(boolean enabled, String pkg);
Jack Yu09033512023-10-17 14:02:45 +000095
96 @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
Jack Yudc872e02024-01-09 09:40:40 +000097 boolean setWlcEnabled(boolean enable);
Jack Yu09033512023-10-17 14:02:45 +000098 boolean isWlcEnabled();
99 void registerWlcStateListener(in INfcWlcStateListener listener);
100 void unregisterWlcStateListener(in INfcWlcStateListener listener);
Jack Yudc872e02024-01-09 09:40:40 +0000101 WlcListenerDeviceInfo getWlcListenerDeviceInfo();
Alisher Alikhodjaeva0de3192023-11-28 14:52:44 -0800102
Roshan498e9ae2024-08-29 12:54:01 -0700103 void updateDiscoveryTechnology(IBinder b, int pollFlags, int listenFlags, String pkg);
Brad Lassey3ea82ea2024-01-02 09:29:07 -0500104
Brad Lassey897900a2024-04-10 17:35:50 -0400105 void notifyPollingLoop(in PollingFrame frame);
Brad Lassey7d7d09f2024-01-05 14:59:13 -0500106 void notifyHceDeactivated();
Brad Lassey7c0d0982024-07-08 18:10:30 -0400107 void notifyTestHceData(in int technology, in byte[] data);
suryaprakash.konduruace29c12023-12-04 23:12:58 +0530108 int sendVendorNciMessage(int mt, int gid, int oid, in byte[] payload);
109 void registerVendorExtensionCallback(in INfcVendorNciCallback callbacks);
110 void unregisterVendorExtensionCallback(in INfcVendorNciCallback callbacks);
Roshan Piusa4329542024-03-25 13:01:21 -0700111 void registerOemExtensionCallback(INfcOemExtensionCallback callbacks);
112 void unregisterOemExtensionCallback(INfcOemExtensionCallback callbacks);
113 void clearPreference();
ziyiwcbb1e362024-05-09 20:22:04 +0000114 void setScreenState();
115 void checkFirmware();
Himanshu Singh Kushwah9fa04812024-06-19 16:46:28 +0530116 List<String> fetchActiveNfceeList();
ziyiwaebcc462024-09-20 20:56:25 +0000117 void triggerInitialization();
118 boolean getSettingStatus();
119 boolean isTagPresent();
Nick Pelly367f41f2011-03-08 11:43:30 -0800120}