From 1ef374f98b7446f78137773ac76636ebe14f144c Mon Sep 17 00:00:00 2001 From: Justin Yun Date: Tue, 17 Dec 2019 15:15:34 +0900 Subject: Use ro.product.vndk.version for unbundled product apks Instead of using "ro.product.apps.unbundled", use "ro.product.vndk.version" to determine if product apks are unbundled. "ro.product.vndk.version" will be defined by PRODUCT_PRODUCT_VNDK_VERSION. If it is defined, all product apks must be unbundled. Bug: 144534640 Bug: 127738095 Bug: 128557860 Test: boot and check logs if product apps are loaded successfully Change-Id: I6d0f7c20e131dfe12203c63a14e6254a8223893b --- core/java/android/app/LoadedApk.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index f0b354650cf4..4efaaad91eb6 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -46,7 +46,7 @@ import android.os.StrictMode; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; -import android.sysprop.ProductProperties; +import android.sysprop.VndkProperties; import android.text.TextUtils; import android.util.AndroidRuntimeException; import android.util.ArrayMap; @@ -785,13 +785,12 @@ public final class LoadedApk { // Similar to vendor apks, we should add /product/lib for apks from product partition // when product apps are marked as unbundled. We cannot use the same way from vendor // to check if lib path exists because there is possibility that /product/lib would not - // exist from legacy device while product apks are bundled. To make this clear, new - // property ("ro.product.apps.unbundled") is defined which should be true only when - // product apks are unbundled. + // exist from legacy device while product apks are bundled. To make this clear, we use + // "ro.product.vndk.version" property. If the property is defined, we regard all product + // apks as unbundled. if (mApplicationInfo.getCodePath() != null - && mApplicationInfo.isProduct() && ProductProperties.unbundled_apps().orElse(false) - // TODO(b/128557860): Change target SDK version when version code R is available. - && getTargetSdkVersion() == Build.VERSION_CODES.CUR_DEVELOPMENT) { + && mApplicationInfo.isProduct() + && VndkProperties.product_vndk_version().isPresent()) { isBundledApp = false; } -- cgit v1.2.3-59-g8ed1b