public interface

NfcAdapterPrivileged

masonamerica.platform.NfcAdapterPrivileged

Class Overview

A privileged extension of the existing ERROR(/android.nfc.NfcAdapter).

Summary

Public Methods
abstract boolean disable()
Disable NFC hardware.
abstract boolean enable()
Enable NFC hardware.

Public Methods

public abstract boolean disable ()

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 ERROR(/android.nfc.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 ERROR(/android.nfc.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

public abstract boolean enable ()

Enable NFC hardware.

This call is asynchronous. Listen for ERROR(/android.nfc.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 ERROR(/android.nfc.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