Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e16f78d5 authored by Nick Pelly's avatar Nick Pelly
Browse files

NFC Settings cleanup.



NFC service now tracks its own settings. Call the NFC API to determine
state.

Change-Id: Ibdb33e68abdbe36df31fb13ad95c8ca1b3bcb35b
Signed-off-by: default avatarNick Pelly <npelly@google.com>
parent f2917ac3
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -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);