summaryrefslogtreecommitdiff
path: root/libs/androidfw/AssetManager2.cpp
diff options
context:
space:
mode:
authorChris Gross <chrisgross@google.com>2021-05-19 11:39:13 -0700
committerScott Lobdell <slobdell@google.com>2021-05-21 00:34:23 +0000
commit219787565ff982848d596fa8743cd132af113e6b (patch)
tree93bd3c94771fb966fdf611d38865e712fb83e969 /libs/androidfw/AssetManager2.cpp
parent7b4a006d559a571313e36799d93af7e3c6b69c82 (diff)
parent75eb1dd292d1800d660c5146464264b25854d318 (diff)
Merge SP1A.210513.004
Change-Id: Ic23aece12c3bbd2b4dcf3205fdbcdd1601deabec
Diffstat (limited to 'libs/androidfw/AssetManager2.cpp')
-rw-r--r--libs/androidfw/AssetManager2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index 7e45f952d389..320106a20b69 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -221,6 +221,16 @@ void AssetManager2::BuildDynamicRefTable() {
for (auto iter2 = package_groups_.begin(); iter2 != package_groups_end; ++iter2) {
iter2->dynamic_ref_table->addMapping(String16(package_name.c_str(), package_name.size()),
iter->dynamic_ref_table->mAssignedPackageId);
+
+ // Add the alias resources to the dynamic reference table of every package group. Since
+ // staging aliases can only be defined by the framework package (which is not a shared
+ // library), the compile-time package id of the framework is the same across all packages
+ // that compile against the framework.
+ for (const auto& package : iter->packages_) {
+ for (const auto& entry : package.loaded_package_->GetAliasResourceIdMap()) {
+ iter2->dynamic_ref_table->addAlias(entry.first, entry.second);
+ }
+ }
}
}
}