aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrystian Zlomek <kzlomek@affinegy.com>2017-06-08 09:44:31 +0000
committerGerrit Code Review <gerrit@172.30.200.193>2017-06-08 09:44:32 +0000
commit5d85c4f57854450114a778acb2f0a919e02656aa (patch)
treeb3adf161f5cb7a4ecdbac9dd39154fee006d6f9d
parent16974777a78fa057a385afbcd84e25f9a9280dc7 (diff)
parentcf917a206c05706b4ebfa1ecc96bae05663379c5 (diff)
Merge "ASACORE-3600 Android JUnit Test fails" into feature/16.10.02
-rw-r--r--alljoyn_java/jni/CertificateX509.cc6
-rw-r--r--alljoyn_java/jni/alljoyn_java.cc2
-rw-r--r--alljoyn_java/jni/alljoyn_jni_helper.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/alljoyn_java/jni/CertificateX509.cc b/alljoyn_java/jni/CertificateX509.cc
index b770e0d..aa61ce2 100644
--- a/alljoyn_java/jni/CertificateX509.cc
+++ b/alljoyn_java/jni/CertificateX509.cc
@@ -1569,8 +1569,12 @@ JNIEXPORT jstring JNICALL Java_org_alljoyn_bus_common_CertificateX509_toJavaStri
}
qcc::String certString = certPtr->ToString();
+ const unsigned char* cerStr = reinterpret_cast<const unsigned char*>(certString.c_str());
- return jenv->NewStringUTF(certString.c_str());
+ jmethodID strngCnstrctr = jenv->GetMethodID(CLS_String, "<init>", "([B)V");
+ jbyteArray strByteArray = ToJByteArray(cerStr, certString.length());
+
+ return (jstring) jenv->NewObject(CLS_String, strngCnstrctr, strByteArray);
}
/*
diff --git a/alljoyn_java/jni/alljoyn_java.cc b/alljoyn_java/jni/alljoyn_java.cc
index c9f7bb1..8f41182 100644
--- a/alljoyn_java/jni/alljoyn_java.cc
+++ b/alljoyn_java/jni/alljoyn_java.cc
@@ -767,7 +767,7 @@ static JavaVM* jvm = NULL;
/** java/lang cached items - these are guaranteed to be loaded at all times. */
static jclass CLS_Integer = NULL;
static jclass CLS_Object = NULL;
-static jclass CLS_String = NULL;
+jclass CLS_String = NULL;
/** org/alljoyn/bus */
jclass CLS_BusException = NULL;
diff --git a/alljoyn_java/jni/alljoyn_jni_helper.h b/alljoyn_java/jni/alljoyn_jni_helper.h
index 195202c..147ec40 100644
--- a/alljoyn_java/jni/alljoyn_jni_helper.h
+++ b/alljoyn_java/jni/alljoyn_jni_helper.h
@@ -34,6 +34,8 @@
#include <stdlib.h>
#include <alljoyn/MsgArg.h>
+extern jclass CLS_String;
+
extern jclass CLS_BusException;
extern jclass CLS_Status;