summaryrefslogtreecommitdiff
path: root/libnativeloader/library_namespaces.cpp
diff options
context:
space:
mode:
author Kiyoung Kim <kiyoungkim@google.com> 2023-10-18 10:26:00 +0900
committer Kiyoung Kim <kiyoungkim@google.com> 2024-03-06 14:49:23 +0000
commitc831818b6caa483fd84e3abfd15cc0f3f3a93012 (patch)
treebdee1548e6ba596373443ed125ce7e821de9e7d2 /libnativeloader/library_namespaces.cpp
parent96d09a108d67d8cc07fed6c499e7fa3901c57446 (diff)
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)
Diffstat (limited to 'libnativeloader/library_namespaces.cpp')
-rw-r--r--libnativeloader/library_namespaces.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libnativeloader/library_namespaces.cpp b/libnativeloader/library_namespaces.cpp
index dc92a88cb3..1e29f4e457 100644
--- a/libnativeloader/library_namespaces.cpp
+++ b/libnativeloader/library_namespaces.cpp
@@ -255,7 +255,7 @@ Result<NativeLoaderNamespace*> LibraryNamespaces::Create(JNIEnv* env, uint32_t t
// Different name is useful for debugging
namespace_name = kVendorClassloaderNamespaceName;
- } else if (apk_origin == APK_ORIGIN_PRODUCT) {
+ } else if (apk_origin == APK_ORIGIN_PRODUCT && is_product_treblelized()) {
unbundled_app_origin = APK_ORIGIN_PRODUCT;
apk_origin_msg = "unbundled product apk";
@@ -405,7 +405,10 @@ Result<NativeLoaderNamespace*> LibraryNamespaces::Create(JNIEnv* env, uint32_t t
auto product_libs = filter_public_libraries(target_sdk_version, uses_libraries,
product_public_libraries());
if (!product_libs.empty()) {
- auto target_ns = NativeLoaderNamespace::GetExportedNamespace(kProductNamespaceName, is_bridged);
+ auto target_ns = system_ns;
+ if (is_product_treblelized()) {
+ target_ns = NativeLoaderNamespace::GetExportedNamespace(kProductNamespaceName, is_bridged);
+ }
if (target_ns.ok()) {
linked = app_ns->Link(&target_ns.value(), product_libs);
if (!linked.ok()) {