summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-11-03 06:05:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2022-11-03 06:05:47 +0000
commitf001e31bfa2e2370c6bedafc9177c151279bd56e (patch)
treed98fc8b9d70438916351adca611497820a8a3810
parente8300274e4d82896ed48ece84d959f9c87c6c2a8 (diff)
parent8bc03cdeb0b2f5766c20c2e220cf0bada87070b3 (diff)
Merge "Fix NullPointerException if device don't support NFC" into tm-qpr-dev
-rw-r--r--tests/unit/src/com/android/nfc/NfcStateTest.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/unit/src/com/android/nfc/NfcStateTest.java b/tests/unit/src/com/android/nfc/NfcStateTest.java
index 26f93a4b..50b8eea2 100644
--- a/tests/unit/src/com/android/nfc/NfcStateTest.java
+++ b/tests/unit/src/com/android/nfc/NfcStateTest.java
@@ -86,7 +86,7 @@ public final class NfcStateTest {
@After
public void tearDown() throws Exception {
mContext.unregisterReceiver(mAdapterStateChangedReceiver);
- if (mNfcAdapter.isControllerAlwaysOnSupported()) {
+ if (mNfcSupported && mNfcAdapter.isControllerAlwaysOnSupported()) {
mNfcAdapter.unregisterControllerAlwaysOnListener(mListener);
}
}