Check for proper SE open return values on wipe.
Bug: 9227578
Change-Id: Iff9e9512ac4d8e25a287ce40fba7c2717b4419fa
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 6ed07fd..5315a2e 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -748,7 +748,7 @@
try {
Log.i(TAG, "Executing SE wipe");
handle = doOpenSecureElementConnection();
- if (handle == 0) {
+ if (handle < 0) {
Log.w(TAG, "Could not open the secure element");
return;
}
@@ -772,7 +772,7 @@
mDeviceHost.resetTimeouts();
}
} finally {
- if (handle != 0) {
+ if (handle >= 0) {
doDisconnect(handle);
}
}