summaryrefslogtreecommitdiffstats
path: root/src/com/android/nfc
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-05-17 15:19:57 -0700
committerMartijn Coenen <maco@google.com>2012-05-17 15:19:57 -0700
commit4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2 (patch)
tree6e9a5ccfc92d02ec1acf162692fee3b3e2d74dbd /src/com/android/nfc
parent3bf04bd4f04b217768b3799dadb4a775b5a31f1a (diff)
downloadpackages_apps_nfc-4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2.zip
packages_apps_nfc-4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2.tar.gz
packages_apps_nfc-4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2.tar.bz2
Close NFCEE when NFC is being shut down.
Bug: 6501921 Change-Id: Ib76fd3a436632ddad0da7c73f7972018990f37c0
Diffstat (limited to 'src/com/android/nfc')
-rwxr-xr-xsrc/com/android/nfc/NfcService.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index 9e4e21b..7b3c456 100755
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -554,6 +554,14 @@ public class NfcService extends Application implements DeviceHostListener {
mP2pLinkManager.enableDisable(false, false);
+ synchronized (NfcService.this) {
+ if (mOpenEe != null) {
+ try {
+ _nfcEeClose(-1, mOpenEe.binder);
+ } catch (IOException e) { }
+ }
+ }
+
// Stop watchdog if tag present
// A convenient way to stop the watchdog properly consists of
// disconnecting the tag. The polling loop shall be stopped before
@@ -1178,7 +1186,7 @@ public class NfcService extends Application implements DeviceHostListener {
// operations. However this is not supported by current hardware.
synchronized (NfcService.this) {
- if (!isNfcEnabled()) {
+ if (!isNfcEnabledOrShuttingDown()) {
throw new IOException("NFC adapter is disabled");
}
if (mOpenEe == null) {