diff options
author | 2024-02-13 02:28:37 +0000 | |
---|---|---|
committer | 2024-02-13 02:28:37 +0000 | |
commit | b66de05eddd3dd0719d1e2591ebfd832c4aeebf2 (patch) | |
tree | 770ba14fef11081d4071231709e13bbaae71a67e /libs/ui/Gralloc5.cpp | |
parent | 6be5e45e6972e29a89f8a085e534689e9364f6eb (diff) | |
parent | a38f2a995b68cb2895ae91a4b882828394a0d708 (diff) |
Merge "binder: add openDeclaredPassthroughHal()" into main am: a38f2a995b
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2952185
Change-Id: I3f85fe1ad55fa4fc4adffaa9c1c74e831106dac7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/ui/Gralloc5.cpp')
-rw-r--r-- | libs/ui/Gralloc5.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ui/Gralloc5.cpp b/libs/ui/Gralloc5.cpp index 2ec6d18fda..25850f71cb 100644 --- a/libs/ui/Gralloc5.cpp +++ b/libs/ui/Gralloc5.cpp @@ -88,10 +88,18 @@ static void *loadIMapperLibrary() { return nullptr; } - std::string lib_name = "mapper." + mapperSuffix + ".so"; - void *so = android_load_sphal_library(lib_name.c_str(), RTLD_LOCAL | RTLD_NOW); + void* so = nullptr; + // TODO(b/322384429) switch this to __ANDROID_API_V__ when V is finalized + // TODO(b/302113279) use __ANDROID_VENDOR_API__ for vendor variant + if (__builtin_available(android __ANDROID_API_FUTURE__, *)) { + so = AServiceManager_openDeclaredPassthroughHal("mapper", mapperSuffix.c_str(), + RTLD_LOCAL | RTLD_NOW); + } else { + std::string lib_name = "mapper." + mapperSuffix + ".so"; + so = android_load_sphal_library(lib_name.c_str(), RTLD_LOCAL | RTLD_NOW); + } if (!so) { - ALOGE("Failed to load %s", lib_name.c_str()); + ALOGE("Failed to load mapper.%s.so", mapperSuffix.c_str()); } return so; }(); |