From e815550e7e287c4543c90ec3f994eab712bfdeb2 Mon Sep 17 00:00:00 2001 From: Dan Zhang Date: Thu, 13 Oct 2022 17:08:22 +0000 Subject: [PATCH] fix build Signed-off-by: Dan Zhang --- library/common/jni/BUILD | 1 + library/common/jni/android_jni_interface.cc | 2 +- library/common/jni/android_test_jni_interface.cc | 7 +------ .../java/io/envoyproxy/envoymobile/engine/JniLibrary.java | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/library/common/jni/BUILD b/library/common/jni/BUILD index 3df57cd8dd..444e4d3229 100644 --- a/library/common/jni/BUILD +++ b/library/common/jni/BUILD @@ -127,6 +127,7 @@ cc_library( ], deps = [ "base_java_jni_lib", + ":android_network_utility_lib", ], alwayslink = True, ) diff --git a/library/common/jni/android_jni_interface.cc b/library/common/jni/android_jni_interface.cc index 891a7624c5..9965195826 100644 --- a/library/common/jni/android_jni_interface.cc +++ b/library/common/jni/android_jni_interface.cc @@ -20,7 +20,7 @@ Java_io_envoyproxy_envoymobile_engine_AndroidJniLibrary_initialize(JNIEnv* env, envoy_status_t result = register_platform_api(cert_validator_name, get_android_cert_validator_api()); if (result == ENVOY_FAILURE) { - return -1; + return ENVOY_FAILURE; } // See note above about c-ares. diff --git a/library/common/jni/android_test_jni_interface.cc b/library/common/jni/android_test_jni_interface.cc index 208e0dcc1a..a04ddae3b1 100644 --- a/library/common/jni/android_test_jni_interface.cc +++ b/library/common/jni/android_test_jni_interface.cc @@ -15,10 +15,5 @@ Java_io_envoyproxy_envoymobile_engine_AndroidJniLibrary_initialize(JNIEnv* env, jobject connectivity_manager) { set_class_loader(env->NewGlobalRef(class_loader)); // At this point, we know Android APIs are available. Register cert chain validation JNI calls. - envoy_status_t result = - register_platform_api(cert_validator_name, get_android_cert_validator_api()); - if (result == ENVOY_FAILURE) { - return -1; - } - return 0; + return register_platform_api(cert_validator_name, get_android_cert_validator_api()); } diff --git a/library/java/io/envoyproxy/envoymobile/engine/JniLibrary.java b/library/java/io/envoyproxy/envoymobile/engine/JniLibrary.java index c800330224..44b89a6893 100644 --- a/library/java/io/envoyproxy/envoymobile/engine/JniLibrary.java +++ b/library/java/io/envoyproxy/envoymobile/engine/JniLibrary.java @@ -352,7 +352,6 @@ protected static native int registerStringAccessor(String accessorName, * * @param engine Handle to the engine for which to drain connections. */ - protected static native int resetConnectivityState(long engine); /**