summaryrefslogtreecommitdiffstats
path: root/jni/com_android_nfc_NativeNfcManager.cpp
diff options
context:
space:
mode:
authorMartijn Coenen <martijn.coenen@nxp.com>2010-12-13 16:39:50 +0100
committerJeff Hamilton <jham@android.com>2010-12-13 10:18:16 -0600
commitbb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f (patch)
tree2a5d1d65b5b15dea7033801d690b0bb685f5fc53 /jni/com_android_nfc_NativeNfcManager.cpp
parent3fb30ae5bf51d9ffe6271a345d55905dade8040d (diff)
downloadpackages_apps_nfc-bb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f.zip
packages_apps_nfc-bb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f.tar.gz
packages_apps_nfc-bb78d3749bd0cc3801fdd9d5df06b0f6ee7a400f.tar.bz2
Added support for (re)-connecting to tag technologies.
- Connect() now takes a technology as an argument. - NativeNfcTag now knows to which technology it is connected. The default connected handle is for now always the first in the tech list; also, NDEF is only checked on the first tech. Still to be done: - Check ndef on other techs if not found on first - Expose the connect(technology) API to the framework - Fix some calls that still use nfc_jni_get_tag_handle and need to work on the selected technology instead. - Get rid of mHandle and the globals for keeping tag handles Change-Id: If76d4d458565ab0be7ca986c080a59ed8fd0668f
Diffstat (limited to 'jni/com_android_nfc_NativeNfcManager.cpp')
-rw-r--r--jni/com_android_nfc_NativeNfcManager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/jni/com_android_nfc_NativeNfcManager.cpp b/jni/com_android_nfc_NativeNfcManager.cpp
index 0a54c20..9ac00b4 100644
--- a/jni/com_android_nfc_NativeNfcManager.cpp
+++ b/jni/com_android_nfc_NativeNfcManager.cpp
@@ -959,6 +959,9 @@ static void nfc_jni_Discovery_notification_callback(void *pContext,
f = e->GetFieldID(tag_cls, "mTechHandles", "[I");
e->SetObjectField(tag, f, handleList);
+
+ f = e->GetFieldID(tag_cls, "mConnectedTechnology", "I");
+ e->SetIntField(tag, f,(jint)-1);
}
/* Set tag handle */