Use new API to load mapper

AServiceManager_getDeclaredPassthroughHal() can replace
android_load_sphal_library().

Bug: 325018681
Test: VtsHalGraphicsMapperStableC_TargetTest
Change-Id: I004355a9df8bd1ba4f9fb00149d7fddb9ac9f499
This commit is contained in:
Jooyung Han
2024-02-13 21:36:10 +09:00
parent 7f9c47a388
commit 0425704133

View File

@@ -166,7 +166,8 @@ class GraphicsTestsBase {
auto status = mAllocator->getIMapperLibrarySuffix(&mapperSuffix);
ASSERT_TRUE(status.isOk()) << "Failed to get IMapper library suffix";
std::string lib_name = "mapper." + mapperSuffix + ".so";
void* so = android_load_sphal_library(lib_name.c_str(), RTLD_LOCAL | RTLD_NOW);
void* so = AServiceManager_openDeclaredPassthroughHal("mapper", mapperSuffix.c_str(),
RTLD_LOCAL | RTLD_NOW);
ASSERT_NE(nullptr, so) << "Failed to load " << lib_name;
mIMapperLoader = (AIMapper_loadIMapperFn)dlsym(so, "AIMapper_loadIMapper");
ASSERT_NE(nullptr, mIMapperLoader) << "AIMapper_locaIMapper missing from " << lib_name;