diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp index cfac5f31e2e61..0b349e10a118b 100644 --- a/cmds/idmap2/idmap2/Scan.cpp +++ b/cmds/idmap2/idmap2/Scan.cpp @@ -103,6 +103,7 @@ std::vector PoliciesForPath(const std::string& apk_path) { {"/oem/", kPolicyOem}, {"/product/", kPolicyProduct}, {"/system/", kPolicySystem}, + {"/system_ext/", kPolicySystem}, {"/vendor/", kPolicyVendor}, }; diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index d6d939183a0d4..bf4ffc7e42e03 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -161,7 +161,7 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { } // Generic idmap parameters - const char* argv[10]; + const char* argv[11]; int argc = 0; struct stat st; @@ -193,8 +193,8 @@ static void NativeVerifySystemIdmaps(JNIEnv* /*env*/, jclass /*clazz*/) { argv[argc++] = AssetManager::PRODUCT_OVERLAY_DIR; } - if (stat(AssetManager::PRODUCT_SERVICES_OVERLAY_DIR, &st) == 0) { - argv[argc++] = AssetManager::PRODUCT_SERVICES_OVERLAY_DIR; + if (stat(AssetManager::SYSTEM_EXT_OVERLAY_DIR, &st) == 0) { + argv[argc++] = AssetManager::SYSTEM_EXT_OVERLAY_DIR; } if (stat(AssetManager::ODM_OVERLAY_DIR, &st) == 0) { @@ -235,8 +235,8 @@ static jobjectArray NativeCreateIdmapsForStaticOverlaysTargetingAndroid(JNIEnv* input_dirs.push_back(AssetManager::PRODUCT_OVERLAY_DIR); } - if (stat(AssetManager::PRODUCT_SERVICES_OVERLAY_DIR, &st) == 0) { - input_dirs.push_back(AssetManager::PRODUCT_SERVICES_OVERLAY_DIR); + if (stat(AssetManager::SYSTEM_EXT_OVERLAY_DIR, &st) == 0) { + input_dirs.push_back(AssetManager::SYSTEM_EXT_OVERLAY_DIR); } if (stat(AssetManager::ODM_OVERLAY_DIR, &st) == 0) { diff --git a/core/jni/fd_utils.cpp b/core/jni/fd_utils.cpp index e5d6393530e49..ea4b25267512a 100644 --- a/core/jni/fd_utils.cpp +++ b/core/jni/fd_utils.cpp @@ -100,8 +100,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { static const char* kVendorOverlaySubdir = "/system/vendor/overlay-subdir/"; static const char* kSystemProductOverlayDir = "/system/product/overlay/"; static const char* kProductOverlayDir = "/product/overlay"; - static const char* kSystemProductServicesOverlayDir = "/system/product_services/overlay/"; - static const char* kProductServicesOverlayDir = "/product_services/overlay"; + static const char* kSystemSystemExtOverlayDir = "/system/system_ext/overlay/"; + static const char* kSystemExtOverlayDir = "/system_ext/overlay"; static const char* kSystemOdmOverlayDir = "/system/odm/overlay"; static const char* kOdmOverlayDir = "/odm/overlay"; static const char* kSystemOemOverlayDir = "/system/oem/overlay"; @@ -113,8 +113,8 @@ bool FileDescriptorWhitelist::IsAllowed(const std::string& path) const { || android::base::StartsWith(path, kVendorOverlayDir) || android::base::StartsWith(path, kSystemProductOverlayDir) || android::base::StartsWith(path, kProductOverlayDir) - || android::base::StartsWith(path, kSystemProductServicesOverlayDir) - || android::base::StartsWith(path, kProductServicesOverlayDir) + || android::base::StartsWith(path, kSystemSystemExtOverlayDir) + || android::base::StartsWith(path, kSystemExtOverlayDir) || android::base::StartsWith(path, kSystemOdmOverlayDir) || android::base::StartsWith(path, kOdmOverlayDir) || android::base::StartsWith(path, kSystemOemOverlayDir) diff --git a/libs/androidfw/AssetManager.cpp b/libs/androidfw/AssetManager.cpp index 4755cb8663104..f7c83371f79c3 100644 --- a/libs/androidfw/AssetManager.cpp +++ b/libs/androidfw/AssetManager.cpp @@ -74,7 +74,7 @@ const char* AssetManager::RESOURCES_FILENAME = "resources.arsc"; const char* AssetManager::IDMAP_BIN = "/system/bin/idmap"; const char* AssetManager::VENDOR_OVERLAY_DIR = "/vendor/overlay"; const char* AssetManager::PRODUCT_OVERLAY_DIR = "/product/overlay"; -const char* AssetManager::PRODUCT_SERVICES_OVERLAY_DIR = "/product_services/overlay"; +const char* AssetManager::SYSTEM_EXT_OVERLAY_DIR = "/system_ext/overlay"; const char* AssetManager::ODM_OVERLAY_DIR = "/odm/overlay"; const char* AssetManager::OEM_OVERLAY_DIR = "/oem/overlay"; const char* AssetManager::OVERLAY_THEME_DIR_PROPERTY = "ro.boot.vendor.overlay.theme"; @@ -575,7 +575,7 @@ bool AssetManager::appendPathToResTable(asset_path& ap, bool appAsLib) const { mZipSet.setZipResourceTableAsset(ap.path, ass); } } - + if (nextEntryIdx == 0 && ass != NULL) { // If this is the first resource table in the asset // manager, then we are going to cache it so that we diff --git a/libs/androidfw/include/androidfw/AssetManager.h b/libs/androidfw/include/androidfw/AssetManager.h index 66fba26b72896..ce0985b389862 100644 --- a/libs/androidfw/include/androidfw/AssetManager.h +++ b/libs/androidfw/include/androidfw/AssetManager.h @@ -61,7 +61,7 @@ public: static const char* IDMAP_BIN; static const char* VENDOR_OVERLAY_DIR; static const char* PRODUCT_OVERLAY_DIR; - static const char* PRODUCT_SERVICES_OVERLAY_DIR; + static const char* SYSTEM_EXT_OVERLAY_DIR; static const char* ODM_OVERLAY_DIR; static const char* OEM_OVERLAY_DIR; /* diff --git a/services/core/java/com/android/server/om/IdmapManager.java b/services/core/java/com/android/server/om/IdmapManager.java index b22b33cdf5fe3..1f20968ca0c83 100644 --- a/services/core/java/com/android/server/om/IdmapManager.java +++ b/services/core/java/com/android/server/om/IdmapManager.java @@ -237,14 +237,9 @@ class IdmapManager { return fulfilledPolicies | IIdmap2.POLICY_OEM_PARTITION; } - // Check partitions for which there exists no policy so overlays on these partitions will - // not fulfill the system policy. - if (ai.isSystemExt()) { - return fulfilledPolicies; - } - + // System_ext partition (/system_ext) is considered as system // Check this last since every partition except for data is scanned as system in the PMS. - if (ai.isSystemApp()) { + if (ai.isSystemApp() || ai.isSystemExt()) { return fulfilledPolicies | IIdmap2.POLICY_SYSTEM_PARTITION; }