Skip to content

Commit

Permalink
jni: Fix JvmStringAccessorContext.getEnvoyString accessor in jni_inte…
Browse files Browse the repository at this point in the history
…rface (#1311)

* Fix JvmStringAccessorContext.getEnvoyString accessor in jni_interface

Signed-off-by: Alan Chiu <achiu@lyft.com>

* more

Signed-off-by: Alan Chiu <achiu@lyft.com>

* java

Signed-off-by: Alan Chiu <achiu@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
  • Loading branch information
Alan Chiu authored and jpsim committed Nov 29, 2022
1 parent ae0a23c commit f1750f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mobile/library/common/jni/jni_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,8 @@ static envoy_data jvm_get_string(const void* context) {
JNIEnv* env = get_env();
jobject j_context = static_cast<jobject>(const_cast<void*>(context));
jclass jcls_JvmStringAccessorContext = env->GetObjectClass(j_context);
jmethodID jmid_getString = env->GetMethodID(jcls_JvmStringAccessorContext, "getString", "()[B");
jmethodID jmid_getString =
env->GetMethodID(jcls_JvmStringAccessorContext, "getEnvoyString", "()[B");
jbyteArray j_data = static_cast<jbyteArray>(env->CallObjectMethod(j_context, jmid_getString));
envoy_data native_data = array_to_native_data(env, j_data);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ class JvmStringAccessorContext {
public JvmStringAccessorContext(EnvoyStringAccessor accessor) { this.accessor = accessor; }

/**
* Invokes getEnvoyString callback.
* Invokes getEnvoyString callback. This method signature is used within the jni_interface.cc.
* Changing naming of this class or methods will likely require an audit across the jni usages
* and proguard rules.
*
* @return String, the string retrieved from the platform.
*/
Expand Down

0 comments on commit f1750f6

Please sign in to comment.