summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/nfc/NfcAdapter.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/java/android/nfc/NfcAdapter.java b/core/java/android/nfc/NfcAdapter.java
index c61f10f50c93..dc4ce039bf77 100644
--- a/core/java/android/nfc/NfcAdapter.java
+++ b/core/java/android/nfc/NfcAdapter.java
@@ -677,6 +677,12 @@ public final class NfcAdapter {
throw new IllegalArgumentException(
"context not associated with any application (using a mock context?)");
}
+
+ if (getServiceInterface() == null) {
+ // NFC is not available
+ return null;
+ }
+
/* use getSystemService() for consistency */
NfcManager manager = (NfcManager) context.getSystemService(Context.NFC_SERVICE);
if (manager == null) {