summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/nfc
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2010-10-20 18:42:23 -0700
committerNick Pelly <npelly@google.com>2010-10-20 18:42:23 -0700
commite16f78d54abb7b8aad43bfa12328c1515a6e08e6 (patch)
tree006d4fb3fc3965fef06654ecc550bf3f6854f0d1 /src/com/android/settings/nfc
parentf2917ac3c5361e30041f52485c677ee5557cfa16 (diff)
downloadpackages_apps_settings-e16f78d54abb7b8aad43bfa12328c1515a6e08e6.zip
packages_apps_settings-e16f78d54abb7b8aad43bfa12328c1515a6e08e6.tar.gz
packages_apps_settings-e16f78d54abb7b8aad43bfa12328c1515a6e08e6.tar.bz2
NFC Settings cleanup.
NFC service now tracks its own settings. Call the NFC API to determine state. Change-Id: Ibdb33e68abdbe36df31fb13ad95c8ca1b3bcb35b Signed-off-by: Nick Pelly <npelly@google.com>
Diffstat (limited to 'src/com/android/settings/nfc')
-rw-r--r--src/com/android/settings/nfc/NfcEnabler.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/settings/nfc/NfcEnabler.java b/src/com/android/settings/nfc/NfcEnabler.java
index 14e8b52..c37c9bb 100644
--- a/src/com/android/settings/nfc/NfcEnabler.java
+++ b/src/com/android/settings/nfc/NfcEnabler.java
@@ -77,8 +77,7 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
}
mContext.registerReceiver(mReceiver, mIntentFilter);
mCheckbox.setOnPreferenceChangeListener(this);
- mNfcState = Settings.System.getInt(mContext.getContentResolver(),
- Settings.System.NFC_ON, 0) != 0;
+ mNfcState = mNfcAdapter.isEnabled();
mCheckbox.setChecked(mNfcState);
}
@@ -103,9 +102,9 @@ public class NfcEnabler implements Preference.OnPreferenceChangeListener {
Log.d(TAG, "Setting NFC enabled state to: " + desiredState);
boolean success = false;
if (desiredState) {
- success = mNfcAdapter.enableTagDiscovery();
+ success = mNfcAdapter.enable();
} else {
- success = mNfcAdapter.disableTagDiscovery();
+ success = mNfcAdapter.disable();
}
if (success) {
Log.d(TAG, "Successfully changed NFC enabled state to " + desiredState);