From c831818b6caa483fd84e3abfd15cc0f3f3a93012 Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Wed, 18 Oct 2023 10:26:00 +0900 Subject: Check if product is treblelized Previous change on handling product partition was based on the assumption that all devices for mainline update would be product treblelized, but it was not true. There are some upgrade devices to S which is not product treblelized. This change checks if the device is treblelized with first api level and product vndk version. Bug: 305749591 Bug: 325710867 Test: AOSP cuttlefish boot succeeded Test: libnativeloader_e2e_tests passed Change-Id: I46f9c0e253363b891bdc6b073df3cc14e9f7b5aa Merged-In: I46f9c0e253363b891bdc6b073df3cc14e9f7b5aa (cherry picked from commit 760e495e79c03ce9c748a93ff42e6e3dd00bfc05) --- libnativeloader/native_loader_test.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'libnativeloader/native_loader_test.cpp') diff --git a/libnativeloader/native_loader_test.cpp b/libnativeloader/native_loader_test.cpp index 62fb1eef2b..547fded4b4 100644 --- a/libnativeloader/native_loader_test.cpp +++ b/libnativeloader/native_loader_test.cpp @@ -18,9 +18,9 @@ #include "native_loader_test.h" -#include - +#include #include +#include #include #include "nativehelper/scoped_utf_chars.h" @@ -378,13 +378,16 @@ TEST_P(NativeLoaderTest_Create, UnbundledProductApp) { dex_path = "/product/app/foo/foo.apk"; is_shared = false; - expected_namespace_prefix = "product-clns"; - expected_library_path = expected_library_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; - expected_permitted_path = - expected_permitted_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; - expected_shared_libs_to_platform_ns = - append_extended_libraries(default_public_libraries() + ":" + llndk_libraries_product()); - expected_link_with_vndk_product_ns = true; + if (is_product_treblelized()) { + expected_namespace_prefix = "product-clns"; + expected_library_path = + expected_library_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; + expected_permitted_path = + expected_permitted_path + ":/product/" LIB_DIR ":/system/product/" LIB_DIR; + expected_shared_libs_to_platform_ns = + append_extended_libraries(default_public_libraries() + ":" + llndk_libraries_product()); + expected_link_with_vndk_product_ns = true; + } SetExpectations(); RunTest(); -- cgit v1.2.3-59-g8ed1b