Use NfcAdapter.getDefaultAdapter() to check for NFC prescence.
Change-Id: I518389a317a4e9ab9009fd33330a91f7c35edc2a Signed-off-by: Nick Pelly <npelly@google.com>
This commit is contained in:
@@ -20,6 +20,7 @@ import android.bluetooth.BluetoothAdapter;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
|
import android.nfc.NfcAdapter;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.SystemProperties;
|
import android.os.SystemProperties;
|
||||||
@@ -122,7 +123,7 @@ public class WirelessSettings extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove NFC if its not available
|
// Remove NFC if its not available
|
||||||
if (ServiceManager.getService(Context.NFC_SERVICE) == null) {
|
if (NfcAdapter.getDefaultAdapter() == null) {
|
||||||
getPreferenceScreen().removePreference(nfc);
|
getPreferenceScreen().removePreference(nfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user