summaryrefslogtreecommitdiffstats
path: root/jni/com_android_nfc_NativeNfcSecureElement.cpp
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2011-07-26 11:08:49 -0700
committerJean-Baptiste Queru <jbq@google.com>2011-07-26 11:08:49 -0700
commit742eacb628af1f2e008c76462cca3c651a6433b7 (patch)
tree5a46702ca90ab2b52b6a7a16aeb81e33a33cffb3 /jni/com_android_nfc_NativeNfcSecureElement.cpp
parentc12429f9e194cda51767304f2fb26bab731df4fc (diff)
parent3d644e80240424d4752faf91b1bd85705b7dfd41 (diff)
downloadpackages_apps_nfc-742eacb628af1f2e008c76462cca3c651a6433b7.zip
packages_apps_nfc-742eacb628af1f2e008c76462cca3c651a6433b7.tar.gz
packages_apps_nfc-742eacb628af1f2e008c76462cca3c651a6433b7.tar.bz2
Merge 3d644e80
Change-Id: I8391bb474ecfe80ea9e7f13178fbaccf2cc576e8
Diffstat (limited to 'jni/com_android_nfc_NativeNfcSecureElement.cpp')
-rwxr-xr-xjni/com_android_nfc_NativeNfcSecureElement.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/jni/com_android_nfc_NativeNfcSecureElement.cpp b/jni/com_android_nfc_NativeNfcSecureElement.cpp
index dc4d3ba..97417ea 100755
--- a/jni/com_android_nfc_NativeNfcSecureElement.cpp
+++ b/jni/com_android_nfc_NativeNfcSecureElement.cpp
@@ -24,6 +24,7 @@ static phNfc_sRemoteDevInformation_t* SecureElementInfo;
static int secureElementHandle;
extern void *gHWRef;
static int SecureElementTech;
+extern uint8_t device_connected_flag;
namespace android {
@@ -202,6 +203,13 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection
TRACE("Open Secure Element");
+ /* Check if NFC device is already connected to a tag or P2P peer */
+ if (device_connected_flag == 1)
+ {
+ LOGD("Unable to open SE connection, device already connected to a P2P peer or a Tag");
+ goto clean_and_return;
+ }
+
/* Test if External RF field is detected */
InParam.buffer = ExternalRFDetected;
InParam.length = 3;
@@ -213,6 +221,7 @@ static jint com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection
if(ret!=NFCSTATUS_PENDING)
{
LOGE("IOCTL status error");
+ goto clean_and_return;
}
/* Wait for callback response */