| bymason.platform.NfcAdapterPrivileged |
A privileged extension of the existing android.nfc.NfcAdapter.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Disable NFC hardware.
| |||||||||||
Enable NFC hardware.
| |||||||||||
Disable NFC hardware.
No NFC features will work after this call, and the hardware will not perform or respond to any NFC communication.
This call is asynchronous. Listen for
NfcAdapter.ACTION_ADAPTER_STATE_CHANGED broadcasts to find out when the
operation is complete.
If this returns true, then either NFC is already off, or
a NfcAdapter.ACTION_ADAPTER_STATE_CHANGED broadcast will be sent
to indicate a state transition. If this returns false, then
there is some problem that prevents an attempt to turn
NFC off.
| Returns | |
|---|---|
boolean |
true if the operation is successful or NFC is already disabled |
Enable NFC hardware.
This call is asynchronous. Listen for
NfcAdapter.ACTION_ADAPTER_STATE_CHANGED broadcasts to find out when the
operation is complete.
If this returns true, then either NFC is already on, or
a NfcAdapter.ACTION_ADAPTER_STATE_CHANGED broadcast will be sent
to indicate a state transition. If this returns false, then
there is some problem that prevents an attempt to turn
NFC on (for example we are in airplane mode and NFC is not
toggleable in airplane mode on this platform).
| Returns | |
|---|---|
boolean |
true if the operation is successful or NFC is already enabled |