Change name of overlay subdir property to sku.
Also move the SKU subdirectories directly under /vendor/overlay. Bug: 31692079 Change-Id: I68c712b13918cc99629534580ee4f77d9e5b3823
This commit is contained in:
@@ -186,18 +186,19 @@ static void verifySystemIdmaps()
|
|||||||
argv[argc++] = AssetManager::TARGET_APK_PATH;
|
argv[argc++] = AssetManager::TARGET_APK_PATH;
|
||||||
argv[argc++] = AssetManager::IDMAP_DIR;
|
argv[argc++] = AssetManager::IDMAP_DIR;
|
||||||
|
|
||||||
// Directories to scan for overlays: if OVERLAY_SUBDIR_PROPERTY is defined,
|
// Directories to scan for overlays: if OVERLAY_SKU_DIR_PROPERTY is defined,
|
||||||
// use OVERLAY_SUBDIR/<value of OVERLAY_SUBDIR_PROPERTY>/ if exists, otherwise
|
// use OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> if exists, otherwise
|
||||||
// use OVERLAY_DIR if exists.
|
// use OVERLAY_DIR if exists.
|
||||||
char subdir[PROP_VALUE_MAX];
|
char subdir[PROP_VALUE_MAX];
|
||||||
int len = __system_property_get(AssetManager::OVERLAY_SUBDIR_PROPERTY, subdir);
|
int len = __system_property_get(AssetManager::OVERLAY_SKU_DIR_PROPERTY, subdir);
|
||||||
|
String8 overlayPath;
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
String8 subdirPath = String8(AssetManager::OVERLAY_SUBDIR) + "/" + subdir;
|
overlayPath = String8(AssetManager::OVERLAY_DIR) + "/" + subdir;
|
||||||
if (stat(subdirPath.string(), &st) == 0) {
|
} else {
|
||||||
argv[argc++] = subdirPath.string();
|
overlayPath = String8(AssetManager::OVERLAY_DIR);
|
||||||
}
|
}
|
||||||
} else if (stat(AssetManager::OVERLAY_DIR, &st) == 0) {
|
if (stat(overlayPath.string(), &st) == 0) {
|
||||||
argv[argc++] = AssetManager::OVERLAY_DIR;
|
argv[argc++] = overlayPath.string();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally, invoke idmap (if any overlay directory exists)
|
// Finally, invoke idmap (if any overlay directory exists)
|
||||||
|
|||||||
@@ -260,16 +260,13 @@ class FileDescriptorInfo {
|
|||||||
|
|
||||||
// Whitelist files needed for Runtime Resource Overlay, like these:
|
// Whitelist files needed for Runtime Resource Overlay, like these:
|
||||||
// /system/vendor/overlay/framework-res.apk
|
// /system/vendor/overlay/framework-res.apk
|
||||||
// /system/vendor/overlay-subdir/pg/framework-res.apk
|
// /system/vendor/overlay/PG/android-framework-runtime-resource-overlay.apk
|
||||||
// /data/resource-cache/system@vendor@overlay@framework-res.apk@idmap
|
// /data/resource-cache/system@vendor@overlay@framework-res.apk@idmap
|
||||||
// /data/resource-cache/system@vendor@overlay-subdir@pg@framework-res.apk@idmap
|
// /data/resource-cache/system@vendor@overlay@PG@framework-res.apk@idmap
|
||||||
// See AssetManager.cpp for more details on overlay-subdir.
|
|
||||||
static const char* kOverlayDir = "/system/vendor/overlay/";
|
static const char* kOverlayDir = "/system/vendor/overlay/";
|
||||||
static const char* kOverlaySubdir = "/system/vendor/overlay-subdir/";
|
|
||||||
static const char* kApkSuffix = ".apk";
|
static const char* kApkSuffix = ".apk";
|
||||||
|
|
||||||
if ((android::base::StartsWith(path, kOverlayDir)
|
if (android::base::StartsWith(path, kOverlayDir)
|
||||||
|| android::base::StartsWith(path, kOverlaySubdir))
|
|
||||||
&& android::base::EndsWith(path, kApkSuffix)
|
&& android::base::EndsWith(path, kApkSuffix)
|
||||||
&& path.find("/../") == std::string::npos) {
|
&& path.find("/../") == std::string::npos) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -73,12 +73,11 @@ public:
|
|||||||
static const char* IDMAP_BIN;
|
static const char* IDMAP_BIN;
|
||||||
static const char* OVERLAY_DIR;
|
static const char* OVERLAY_DIR;
|
||||||
/*
|
/*
|
||||||
* If OVERLAY_SUBDIR_PROPERTY is set, search for runtime resource overlay
|
* If OVERLAY_SKU_DIR_PROPERTY is set, search for runtime resource overlay
|
||||||
* APKs in OVERLAY_SUBDIR/<value of OVERLAY_SUBDIR_PROPERTY>/ rather than in
|
* APKs in OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> rather than in
|
||||||
* OVERLAY_DIR.
|
* OVERLAY_DIR.
|
||||||
*/
|
*/
|
||||||
static const char* OVERLAY_SUBDIR;
|
static const char* OVERLAY_SKU_DIR_PROPERTY;
|
||||||
static const char* OVERLAY_SUBDIR_PROPERTY;
|
|
||||||
static const char* TARGET_PACKAGE_NAME;
|
static const char* TARGET_PACKAGE_NAME;
|
||||||
static const char* TARGET_APK_PATH;
|
static const char* TARGET_APK_PATH;
|
||||||
static const char* IDMAP_DIR;
|
static const char* IDMAP_DIR;
|
||||||
|
|||||||
@@ -76,10 +76,9 @@ static volatile int32_t gCount = 0;
|
|||||||
const char* AssetManager::RESOURCES_FILENAME = "resources.arsc";
|
const char* AssetManager::RESOURCES_FILENAME = "resources.arsc";
|
||||||
const char* AssetManager::IDMAP_BIN = "/system/bin/idmap";
|
const char* AssetManager::IDMAP_BIN = "/system/bin/idmap";
|
||||||
const char* AssetManager::OVERLAY_DIR = "/vendor/overlay";
|
const char* AssetManager::OVERLAY_DIR = "/vendor/overlay";
|
||||||
|
const char* AssetManager::OVERLAY_SKU_DIR_PROPERTY = "ro.boot.vendor.overlay.sku";
|
||||||
const char* AssetManager::TARGET_PACKAGE_NAME = "android";
|
const char* AssetManager::TARGET_PACKAGE_NAME = "android";
|
||||||
const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk";
|
const char* AssetManager::TARGET_APK_PATH = "/system/framework/framework-res.apk";
|
||||||
const char* AssetManager::OVERLAY_SUBDIR = "/system/vendor/overlay-subdir";
|
|
||||||
const char* AssetManager::OVERLAY_SUBDIR_PROPERTY = "ro.boot.vendor.overlay.subdir";
|
|
||||||
const char* AssetManager::IDMAP_DIR = "/data/resource-cache";
|
const char* AssetManager::IDMAP_DIR = "/data/resource-cache";
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|||||||
Reference in New Issue
Block a user