diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2019-05-01 11:54:33 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2019-05-01 21:52:21 +0900 |
commit | 88ddd882ad28e5c069b8f0fd4c0474cc9f0c1827 (patch) | |
tree | 22cd9ecbc604e992f47752cbcb5c282a1b9f7e64 /jni/network_stack_utils_jni.cpp | |
parent | d6535d10b7936005106a899b767a068078ef7656 (diff) |
Make NetworkStack actually build in an unbundled setup.
The Java code was already using sdk_version: "current", but the
JNI library did not have an sdk_version attribute, and had
forbidden dependencies on internal libraries such as libcutils,
liblog and libnativehelper.
This CL fixes things as follows:
- Use the NDK log functions, and switch to the NDK liblog.
- Switch to the NDK libnativehelper.
- Drop the dependencies on libcutils and libpcap, which were
unused.
- Use the libc++ STL, and set the sdk_version of the library to
current.
Bug: 131703417
Test: m
Test: installed NetworkStack APK via "adb install --staged" results in working networking
Test: builds, boots, wifi works
Test: atest FrameworksNetTests NetworkStackTests
(cherry picked from commit 3d680e887ba40cde436a5745578e67d4a6a6fce9)
Change-Id: I8a0a8d4b4e8872cb88ee526772ae519a8e6df615
Diffstat (limited to 'jni/network_stack_utils_jni.cpp')
-rw-r--r-- | jni/network_stack_utils_jni.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/jni/network_stack_utils_jni.cpp b/jni/network_stack_utils_jni.cpp index 5544eaa..f2ba575 100644 --- a/jni/network_stack_utils_jni.cpp +++ b/jni/network_stack_utils_jni.cpp @@ -31,7 +31,7 @@ #include <string> #include <nativehelper/JNIHelp.h> -#include <utils/Log.h> +#include <android/log.h> namespace android { constexpr const char NETWORKSTACKUTILS_PKG_NAME[] = "android/net/util/NetworkStackUtils"; @@ -249,7 +249,7 @@ static const JNINativeMethod gNetworkStackUtilsMethods[] = { extern "C" jint JNI_OnLoad(JavaVM* vm, void*) { JNIEnv *env; if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) { - ALOGE("ERROR: GetEnv failed"); + __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, "ERROR: GetEnv failed"); return JNI_ERR; } @@ -261,4 +261,4 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void*) { return JNI_VERSION_1_6; } -}; // namespace android
\ No newline at end of file +}; // namespace android |