summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/nfc/NfcEnabler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/nfc/NfcEnabler.java')
-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);