diff options
author | Orion Hodson <oth@google.com> | 2021-05-12 09:40:08 +0100 |
---|---|---|
committer | Orion Hodson <oth@google.com> | 2021-05-12 09:43:35 +0100 |
commit | d96b6cdfd7bf31524d13e201856f99227d2fbfe0 (patch) | |
tree | 7f46157ae3d7f329625543c17e09f591b22cefb7 /common/native/netjniutils/netjniutils.cpp | |
parent | 81be76f836c4349fbe8b58381f17a9192f8de841 (diff) | |
download | net-d96b6cdfd7bf31524d13e201856f99227d2fbfe0.tar.gz |
Move to renamed NDK symbol AFileDescriptor_getFd
Bug: 185256332
Test: TH
Change-Id: I77f7551a97d015fe5cc54c053020504f5fb93ab7
Diffstat (limited to 'common/native/netjniutils/netjniutils.cpp')
-rw-r--r-- | common/native/netjniutils/netjniutils.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/native/netjniutils/netjniutils.cpp b/common/native/netjniutils/netjniutils.cpp index 8ed72b08..210c6c3a 100644 --- a/common/native/netjniutils/netjniutils.cpp +++ b/common/native/netjniutils/netjniutils.cpp @@ -74,19 +74,19 @@ int GetNativeFileDescriptorWithNdk(JNIEnv* env, jobject javaFd) { // Since Android S, there is an NDK API to get a file descriptor present in libnativehelper.so. // libnativehelper is loaded into all processes by the zygote since the zygote uses it // to load the Android Runtime and is also a public library (because of the NDK API). - typedef int (*ndkGetFD_t)(JNIEnv*, jobject); - static const ndkGetFD_t ndkGetFD = []() -> ndkGetFD_t { + typedef int (*ndkGetFd_t)(JNIEnv*, jobject); + static const ndkGetFd_t ndkGetFd = []() -> ndkGetFd_t { void* handle = dlopen("libnativehelper.so", RTLD_NOLOAD | RTLD_NODELETE); - auto ndkGetFD = reinterpret_cast<ndkGetFD_t>(dlsym(handle, "AFileDescriptor_getFD")); - if (ndkGetFD == nullptr) { + auto ndkGetFd = reinterpret_cast<ndkGetFd_t>(dlsym(handle, "AFileDescriptor_getFd")); + if (ndkGetFd == nullptr) { __android_log_print(ANDROID_LOG_FATAL, LOG_TAG, - "Failed to dlsym(AFileDescriptor_getFD): %s", dlerror()); + "Failed to dlsym(AFileDescriptor_getFd): %s", dlerror()); dlclose(handle); } - return ndkGetFD; + return ndkGetFd; }(); - return javaFd != nullptr ? ndkGetFD(env, javaFd) : -1; + return javaFd != nullptr ? ndkGetFd(env, javaFd) : -1; } } // namespace |