summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2012-05-17 17:54:59 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-17 17:54:59 -0700
commit1179ee22543abdd350f0a60b887e2fb7cf95d6a6 (patch)
tree6bc522478b3777d90c39c27cc19fbb2cb3e5c08d /src/com/android
parent2aa9b461d148f49ab9c63858f1c8f87c0b40b824 (diff)
parent4ac28aa73f8bc7b501912fb8e96877a7b9a1f4f2 (diff)
downloadpackages_apps_nfc-1179ee22543abdd350f0a60b887e2fb7cf95d6a6.zip
packages_apps_nfc-1179ee22543abdd350f0a60b887e2fb7cf95d6a6.tar.gz
packages_apps_nfc-1179ee22543abdd350f0a60b887e2fb7cf95d6a6.tar.bz2
Merge "Close NFCEE when NFC is being shut down." into jb-dev
Diffstat (limited to 'src/com/android')
-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) {