summaryrefslogtreecommitdiffstats
path: root/core/java/android/nfc/NfcAdapter.java
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2010-10-20 18:39:11 -0700
committerNick Pelly <npelly@google.com>2010-10-21 03:54:51 -0700
commit7ea5c45e8d89f59065f088d4e11cceeeed9d64d1 (patch)
treeb5bb01cdf9280d1ea7cf0cba3d96ebe3ca1c1be5 /core/java/android/nfc/NfcAdapter.java
parentfa7a87fb4b3d25b0b6b0985d65848a144d28df26 (diff)
downloadframeworks_base-7ea5c45e8d89f59065f088d4e11cceeeed9d64d1.zip
frameworks_base-7ea5c45e8d89f59065f088d4e11cceeeed9d64d1.tar.gz
frameworks_base-7ea5c45e8d89f59065f088d4e11cceeeed9d64d1.tar.bz2
NFC settings cleanup.
Remove NFC settings from Settings.System. The NFC Service tracks them internally using SharedPreference. Revert back to enable()/disable()/isEnabled() - Tag discovery is the only functionality NFC service performs right now so we don't need to break it up more explicitly yet. enable/disable is the global NFC on/off and later we'll add enableDiscovery(), enableTagEmulation(), enableSecureElement() etc as needed. Change-Id: Id5b23e89d4a29511835f509962842452075e56cb Signed-off-by: Nick Pelly <npelly@google.com>
Diffstat (limited to 'core/java/android/nfc/NfcAdapter.java')
-rw-r--r--core/java/android/nfc/NfcAdapter.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index bc3c6d9..6884abb 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -227,14 +227,17 @@ public final class NfcAdapter {
}
/**
- * Return true if this NFC Adapter is enabled to discover new tags.
+ * Return true if this NFC Adapter has any features enabled.
* <p>
* If this method returns false, then applications should request the user
* turn on NFC tag discovery in Settings.
+ * <p>
+ * If this method returns false, the NFC hardware is guaranteed not to
+ * perform or respond to any NFC communication.
*
* @return true if this NFC Adapter is enabled to discover new tags
*/
- public boolean isTagDiscoveryEnabled() {
+ public boolean isEnabled() {
try {
return mService.isEnabled();
} catch (RemoteException e) {
@@ -244,12 +247,14 @@ public final class NfcAdapter {
}
/**
+ * Enable NFC hardware.
+ * <p>
* NOTE: may block for ~second or more. Poor API. Avoid
* calling from the UI thread.
*
* @hide
*/
- public boolean enableTagDiscovery() {
+ public boolean enable() {
try {
return mService.enable();
} catch (RemoteException e) {
@@ -259,12 +264,16 @@ public final class NfcAdapter {
}
/**
+ * Disable NFC hardware.
+ * No NFC features will work after this call, and the hardware
+ * will not perform or respond to any NFC communication.
+ * <p>
* NOTE: may block for ~second or more. Poor API. Avoid
* calling from the UI thread.
*
* @hide
*/
- public boolean disableTagDiscovery() {
+ public boolean disable() {
try {
return mService.disable();
} catch (RemoteException e) {