diff options
author | George Chang <georgekgchang@google.com> | 2024-06-04 12:19:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-06-04 12:19:16 +0000 |
commit | 0c47e96f58070c7da44cf1843ab130e2e246bddb (patch) | |
tree | e0a204be8bfd5b1b128cd6734715c97b22a32672 /nci/jni | |
parent | 7e8f19b6eaab43482b8b116ceffcbbd00f7b46f0 (diff) | |
parent | bcde994c83c0fa2576aa48d42b58bda64c9cda1d (diff) | |
download | Nfc-master.tar.gz |
Diffstat (limited to 'nci/jni')
-rwxr-xr-x | nci/jni/NfcTag.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nci/jni/NfcTag.cpp b/nci/jni/NfcTag.cpp index 2037b915..08e289da 100755 --- a/nci/jni/NfcTag.cpp +++ b/nci/jni/NfcTag.cpp @@ -661,6 +661,10 @@ void NfcTag::fillNativeNfcTagMembers3(JNIEnv* e, jclass tag_cls, jobject tag, sTechPollBytes = reinterpret_cast<jobjectArray>(e->NewGlobalRef(techPollBytes.get())); } else { + if (sTechPollBytes == NULL) { + sTechPollBytes = + reinterpret_cast<jobjectArray>(e->NewGlobalRef(techPollBytes.get())); + } /* Add previously activated tag's tech poll bytes also in the list for multiprotocol tag*/ jobject techPollBytesObject; @@ -823,6 +827,11 @@ void NfcTag::fillNativeNfcTagMembers4(JNIEnv* e, jclass tag_cls, jobject tag, // multi selection. gtechActBytes = reinterpret_cast<jobjectArray>(e->NewGlobalRef(techActBytes.get())); + } else { + for (int j = 0; j < mTechListTail; j++) { + gtechActBytesObject = e->GetObjectArrayElement(gtechActBytes, j); + e->SetObjectArrayElement(techActBytes.get(), j, gtechActBytesObject); + } } for (int i = mTechListTail; i < mNumTechList; i++) { |