summaryrefslogtreecommitdiff
path: root/nci/jni
diff options
context:
space:
mode:
authorGeorge Chang <georgekgchang@google.com>2024-06-04 12:19:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-06-04 12:19:16 +0000
commit0c47e96f58070c7da44cf1843ab130e2e246bddb (patch)
treee0a204be8bfd5b1b128cd6734715c97b22a32672 /nci/jni
parent7e8f19b6eaab43482b8b116ceffcbbd00f7b46f0 (diff)
parentbcde994c83c0fa2576aa48d42b58bda64c9cda1d (diff)
downloadNfc-master.tar.gz
Merge "Return ATS historical bytes" into mainHEADmastermain
Diffstat (limited to 'nci/jni')
-rwxr-xr-xnci/jni/NfcTag.cpp9
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++) {