xref: /aosp_15_r20/prebuilts/sdk/35/system/api/framework-nfc.txt (revision 344a7f5ef16c479e7a7f54ee6567a9d112f9e72b)
1*344a7f5eSAndroid Build Coastguard Worker// Signature format: 2.0
2*344a7f5eSAndroid Build Coastguard Workerpackage android.nfc {
3*344a7f5eSAndroid Build Coastguard Worker
4*344a7f5eSAndroid Build Coastguard Worker  public final class NfcAdapter {
5*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean addNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler, String[]);
6*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable();
7*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean disable(boolean);
8*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enable();
9*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableReaderOption(boolean);
10*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableSecureNfc(boolean);
11*344a7f5eSAndroid Build Coastguard Worker    method public int getAdapterState();
12*344a7f5eSAndroid Build Coastguard Worker    method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public java.util.Map<java.lang.String,java.lang.Boolean> getTagIntentAppPreferenceForUser(int);
13*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isControllerAlwaysOn();
14*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isControllerAlwaysOnSupported();
15*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean isTagIntentAppPreferenceSupported();
16*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public void registerControllerAlwaysOnListener(@NonNull java.util.concurrent.Executor, @NonNull android.nfc.NfcAdapter.ControllerAlwaysOnListener);
17*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void registerNfcVendorNciCallback(@NonNull java.util.concurrent.Executor, @NonNull android.nfc.NfcAdapter.NfcVendorNciCallback);
18*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean removeNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler);
19*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int sendVendorNciMessage(int, @IntRange(from=0, to=15) int, @IntRange(from=0) int, @NonNull byte[]);
20*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean setControllerAlwaysOn(boolean);
21*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setReaderModePollingEnabled(boolean);
22*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public int setTagIntentAppPreferenceForUser(int, @NonNull String, boolean);
23*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public void unregisterControllerAlwaysOnListener(@NonNull android.nfc.NfcAdapter.ControllerAlwaysOnListener);
24*344a7f5eSAndroid Build Coastguard Worker    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void unregisterNfcVendorNciCallback(@NonNull android.nfc.NfcAdapter.NfcVendorNciCallback);
25*344a7f5eSAndroid Build Coastguard Worker    field public static final String ACTION_REQUIRE_UNLOCK_FOR_NFC = "android.nfc.action.REQUIRE_UNLOCK_FOR_NFC";
26*344a7f5eSAndroid Build Coastguard Worker    field @RequiresPermission(android.Manifest.permission.SHOW_CUSTOMIZED_RESOLVER) public static final String ACTION_SHOW_NFC_RESOLVER = "android.nfc.action.SHOW_NFC_RESOLVER";
27*344a7f5eSAndroid Build Coastguard Worker    field public static final String EXTRA_RESOLVE_INFOS = "android.nfc.extra.RESOLVE_INFOS";
28*344a7f5eSAndroid Build Coastguard Worker    field public static final int MESSAGE_TYPE_COMMAND = 1; // 0x1
29*344a7f5eSAndroid Build Coastguard Worker    field public static final int SEND_VENDOR_NCI_STATUS_FAILED = 3; // 0x3
30*344a7f5eSAndroid Build Coastguard Worker    field public static final int SEND_VENDOR_NCI_STATUS_MESSAGE_CORRUPTED = 2; // 0x2
31*344a7f5eSAndroid Build Coastguard Worker    field public static final int SEND_VENDOR_NCI_STATUS_REJECTED = 1; // 0x1
32*344a7f5eSAndroid Build Coastguard Worker    field public static final int SEND_VENDOR_NCI_STATUS_SUCCESS = 0; // 0x0
33*344a7f5eSAndroid Build Coastguard Worker    field public static final int TAG_INTENT_APP_PREF_RESULT_PACKAGE_NOT_FOUND = -1; // 0xffffffff
34*344a7f5eSAndroid Build Coastguard Worker    field public static final int TAG_INTENT_APP_PREF_RESULT_SUCCESS = 0; // 0x0
35*344a7f5eSAndroid Build Coastguard Worker    field public static final int TAG_INTENT_APP_PREF_RESULT_UNAVAILABLE = -2; // 0xfffffffe
36*344a7f5eSAndroid Build Coastguard Worker  }
37*344a7f5eSAndroid Build Coastguard Worker
38*344a7f5eSAndroid Build Coastguard Worker  public static interface NfcAdapter.ControllerAlwaysOnListener {
39*344a7f5eSAndroid Build Coastguard Worker    method public void onControllerAlwaysOnChanged(boolean);
40*344a7f5eSAndroid Build Coastguard Worker  }
41*344a7f5eSAndroid Build Coastguard Worker
42*344a7f5eSAndroid Build Coastguard Worker  public static interface NfcAdapter.NfcUnlockHandler {
43*344a7f5eSAndroid Build Coastguard Worker    method public boolean onUnlockAttempted(android.nfc.Tag);
44*344a7f5eSAndroid Build Coastguard Worker  }
45*344a7f5eSAndroid Build Coastguard Worker
46*344a7f5eSAndroid Build Coastguard Worker  public static interface NfcAdapter.NfcVendorNciCallback {
47*344a7f5eSAndroid Build Coastguard Worker    method public void onVendorNciNotification(@IntRange(from=9, to=15) int, int, @NonNull byte[]);
48*344a7f5eSAndroid Build Coastguard Worker    method public void onVendorNciResponse(@IntRange(from=0, to=15) int, int, @NonNull byte[]);
49*344a7f5eSAndroid Build Coastguard Worker  }
50*344a7f5eSAndroid Build Coastguard Worker
51*344a7f5eSAndroid Build Coastguard Worker}
52*344a7f5eSAndroid Build Coastguard Worker
53*344a7f5eSAndroid Build Coastguard Workerpackage android.nfc.cardemulation {
54*344a7f5eSAndroid Build Coastguard Worker
55*344a7f5eSAndroid Build Coastguard Worker  public final class CardEmulation {
56*344a7f5eSAndroid Build Coastguard Worker    method @Nullable @RequiresPermission(android.Manifest.permission.NFC_PREFERRED_PAYMENT_INFO) public static android.content.ComponentName getPreferredPaymentService(@NonNull android.content.Context);
57*344a7f5eSAndroid Build Coastguard Worker    method @NonNull public java.util.List<android.nfc.cardemulation.ApduServiceInfo> getServices(@NonNull String, int);
58*344a7f5eSAndroid Build Coastguard Worker  }
59*344a7f5eSAndroid Build Coastguard Worker
60*344a7f5eSAndroid Build Coastguard Worker}
61*344a7f5eSAndroid Build Coastguard Worker
62