diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index db8c905eac34d..41a9921391117 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -781,6 +781,16 @@ public final class LoadedApk { isBundledApp = false; } + // Similar to vendor apks, we should add /product/lib for apks from product partition + // and not having /product/lib in the default search path + final boolean treatProductApkAsUnbundled = !defaultSearchPaths.contains("/product/lib"); + if (mApplicationInfo.getCodePath() != null + && mApplicationInfo.isProduct() && treatProductApkAsUnbundled + // TODO(b/128557860): Change target SDK version when version code R is available. + && getTargetSdkVersion() == Build.VERSION_CODES.CUR_DEVELOPMENT) { + isBundledApp = false; + } + makePaths(mActivityThread, isBundledApp, mApplicationInfo, zipPaths, libPaths); String libraryPermittedPath = mDataDir;