summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jakub Adamek <jakuba@google.com> 2016-10-17 14:53:40 +0100
committer Jakub Adamek <jakuba@google.com> 2016-10-17 15:52:48 +0100
commit1f36a2166b5bfe9afa2a6379573fda58868c6e28 (patch)
tree8edfd6cdef751f389f9cd6a1bb46d4e07717a2f3
parent4a6e2466713e50d642b375b621265013d73e5d8e (diff)
Search for RRO both in SKU subdir and in vendor/overlay
Currently, if the "ro.boot.vendor.overlay.subdir" property is set, we only search in the subdir. It seems more powerful to search both in there and in the standard /vendor/overlay directory. Also, RRO packages have the "priority" attribute in the <overlay> attribute in AndroidManifest.xml which serves for disambiguation. Bug: 32202741 Change-Id: I7acff1b7f0e153830924047349f003295648a53b
-rw-r--r--core/jni/android_util_AssetManager.cpp15
-rw-r--r--include/androidfw/AssetManager.h2
2 files changed, 8 insertions, 9 deletions
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index da9415d10b73..52b7ef4f7fa3 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -187,18 +187,17 @@ static void verifySystemIdmaps()
argv[argc++] = AssetManager::IDMAP_DIR;
// Directories to scan for overlays: if OVERLAY_SKU_DIR_PROPERTY is defined,
- // use OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> if exists, otherwise
- // use OVERLAY_DIR if exists.
+ // use OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> in addition to OVERLAY_DIR.
char subdir[PROP_VALUE_MAX];
int len = __system_property_get(AssetManager::OVERLAY_SKU_DIR_PROPERTY, subdir);
- String8 overlayPath;
if (len > 0) {
- overlayPath = String8(AssetManager::OVERLAY_DIR) + "/" + subdir;
- } else {
- overlayPath = String8(AssetManager::OVERLAY_DIR);
+ String8 overlayPath = String8(AssetManager::OVERLAY_DIR) + "/" + subdir;
+ if (stat(overlayPath.string(), &st) == 0) {
+ argv[argc++] = overlayPath.string();
+ }
}
- if (stat(overlayPath.string(), &st) == 0) {
- argv[argc++] = overlayPath.string();
+ if (stat(AssetManager::OVERLAY_DIR, &st) == 0) {
+ argv[argc++] = AssetManager::OVERLAY_DIR;
}
// Finally, invoke idmap (if any overlay directory exists)
diff --git a/include/androidfw/AssetManager.h b/include/androidfw/AssetManager.h
index 099d82eb564f..31b692d6624e 100644
--- a/include/androidfw/AssetManager.h
+++ b/include/androidfw/AssetManager.h
@@ -74,7 +74,7 @@ public:
static const char* OVERLAY_DIR;
/*
* If OVERLAY_SKU_DIR_PROPERTY is set, search for runtime resource overlay
- * APKs in OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> rather than in
+ * APKs in OVERLAY_DIR/<value of OVERLAY_SKU_DIR_PROPERTY> in addition to
* OVERLAY_DIR.
*/
static const char* OVERLAY_SKU_DIR_PROPERTY;