Fix UnbundledProductApp test to allow extendend public libraries.
This fixes the test to conform with the change in
https://r.android.com/2165025. The test only broke on devices that do
have extended public libraries, in particular wembley.
Test: atest libnativeloader_test
Bug: 242016740
Bug: 237572732
Change-Id: I1400a701a622f9f35b3ce0781575134faca679ae
diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp
index 85cb36d..7bf4cb7 100644
--- a/libnativeloader/native_loader_test.cpp
+++ b/libnativeloader/native_loader_test.cpp
@@ -167,13 +167,16 @@
/////////////////////////////////////////////////////////////////
-std::string default_public_and_extended_libraries() {
- std::string public_libs = default_public_libraries();
+std::string append_extended_libraries(const std::string& libs) {
const std::string& ext_libs = extended_public_libraries();
if (!ext_libs.empty()) {
- public_libs = public_libs + ":" + ext_libs;
+ return libs + ":" + ext_libs;
}
- return public_libs;
+ return libs;
+}
+
+std::string default_public_and_extended_libraries() {
+ return append_extended_libraries(default_public_libraries());
}
class NativeLoaderTest_Create : public NativeLoaderTest {
@@ -380,7 +383,7 @@
expected_permitted_path =
expected_permitted_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR;
expected_shared_libs_to_platform_ns =
- default_public_libraries() + ":" + llndk_libraries_product();
+ append_extended_libraries(default_public_libraries() + ":" + llndk_libraries_product());
expected_link_with_vndk_product_ns = true;
}
SetExpectations();