summaryrefslogtreecommitdiffstats
path: root/src/com/android/nfc/NfcService.java
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2011-08-09 19:08:21 -0700
committerNick Pelly <npelly@google.com>2011-08-09 19:08:21 -0700
commitca7e72aaac66ce856c32aaffb8fd2163d7bb486a (patch)
tree074c1c45482df406014e75d93c2b69c2494d1357 /src/com/android/nfc/NfcService.java
parent31949217328bf2357ff044f0d18677fe588c790c (diff)
downloadpackages_apps_nfc-ca7e72aaac66ce856c32aaffb8fd2163d7bb486a.zip
packages_apps_nfc-ca7e72aaac66ce856c32aaffb8fd2163d7bb486a.tar.gz
packages_apps_nfc-ca7e72aaac66ce856c32aaffb8fd2163d7bb486a.tar.bz2
Fix bug where NfcAdapterExtras.get() always fails.
And improve some logging while we're at it. Change-Id: Ia1f5c1a451690bfcf5b9af75e855c09164460561
Diffstat (limited to 'src/com/android/nfc/NfcService.java')
-rwxr-xr-xsrc/com/android/nfc/NfcService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index ca3bbb3..a9b7533 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -290,6 +290,7 @@ public class NfcService extends Application implements DeviceHostListener, P2pSt
mNfcTagService = new TagService();
mNfcAdapter = new NfcAdapterService();
+ mExtrasService = new NfcAdapterExtrasService();
Log.i(TAG, "Starting NFC service");
@@ -504,7 +505,7 @@ public class NfcService extends Application implements DeviceHostListener, P2pSt
boolean tempEnable = mState == NfcAdapter.STATE_OFF;
if (tempEnable) {
if (!enableInternal()) {
- Log.w(TAG, "Could not enable NFC to wipe Secure Element");
+ Log.w(TAG, "Could not enable NFC to wipe NFC-EE");
return;
}
}
@@ -521,7 +522,11 @@ public class NfcService extends Application implements DeviceHostListener, P2pSt
mDeviceHost.setTimeout(TagTechnology.ISO_DEP, 10000);
for (byte[] cmd : apdus) {
- mSecureElement.doTransceive(handle, cmd);
+ byte[] resp = mSecureElement.doTransceive(handle, cmd);
+ if (resp == null) {
+ Log.w(TAG, "Transceive failed, could not wipe NFC-EE");
+ break;
+ }
}
mDeviceHost.resetTimeouts();