public final class NfcAdapterExtras extends Object
NfcAdapter
for Card Emulation
and management of NfcExecutionEnvironment
's.
There is a 1-1 relationship between an NfcAdapterExtras
object and
a NfcAdapter
object.Modifier and Type | Class and Description |
---|---|
static class |
NfcAdapterExtras.CardEmulationRoute
Immutable data class that describes a card emulation route.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_RF_FIELD_OFF_DETECTED
Broadcast Action: an RF field OFF has been detected.
|
static String |
ACTION_RF_FIELD_ON_DETECTED
Broadcast Action: an RF field ON has been detected.
|
Modifier and Type | Method and Description |
---|---|
void |
authenticate(byte[] token)
Authenticate the client application.
|
static NfcAdapterExtras |
get(NfcAdapter adapter)
Get the
NfcAdapterExtras for the given NfcAdapter . |
NfcAdapterExtras.CardEmulationRoute |
getCardEmulationRoute()
Get the routing state of this NFC EE.
|
String |
getDriverName()
Returns the name of this adapter's driver.
|
NfcExecutionEnvironment |
getEmbeddedExecutionEnvironment()
Get the
NfcExecutionEnvironment that is embedded with the
NfcAdapter . |
void |
setCardEmulationRoute(NfcAdapterExtras.CardEmulationRoute route)
Set the routing state of this NFC EE.
|
public static final String ACTION_RF_FIELD_ON_DETECTED
This is an unreliable signal, and will be removed.
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission
to receive.
public static final String ACTION_RF_FIELD_OFF_DETECTED
This is an unreliable signal, and will be removed.
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission
to receive.
public static NfcAdapterExtras get(NfcAdapter adapter)
NfcAdapterExtras
for the given NfcAdapter
.
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission.
adapter
- a NfcAdapter
, must not be nullNfcAdapterExtras
object for the given NfcAdapter
public NfcAdapterExtras.CardEmulationRoute getCardEmulationRoute()
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission.
public void setCardEmulationRoute(NfcAdapterExtras.CardEmulationRoute route)
This routing state is not persisted across reboot.
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission.
route
- a NfcAdapterExtras.CardEmulationRoute
public NfcExecutionEnvironment getEmbeddedExecutionEnvironment()
NfcExecutionEnvironment
that is embedded with the
NfcAdapter
.
Requires the android.Manifest.permission#WRITE_SECURE_SETTINGS
permission.
NfcExecutionEnvironment
, or null if there is no embedded NFC-EEpublic void authenticate(byte[] token)
token
- a implementation specific tokenSecurityException
- if authentication failedpublic String getDriverName()
Different NFC adapters may use different drivers. This value is informational and should not be parsed.