summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceValues.cpp
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2017-11-07 17:08:07 -0800
committerAdam Lesinski <adamlesinski@google.com>2017-11-09 14:57:49 -0800
commit490595a5fc1c3618dbbc2da5d421d10c025fabac (patch)
tree95b9f4a854da15241e2acc4b379693a9320c63f5 /tools/aapt2/ResourceValues.cpp
parent2dd3953ae00068a71da9f0a0d4e2fb9d8517424c (diff)
AAPT2: Workaround for feature splits without namespacing
Android Instant Apps in its current iteration does not use namespaces, but due to limitations on the Android resource runtime, needs to make it look like it does. This is due to a bug that treats any package ID that's not 0x01 or 0x7F as a shared library. Shared libraries require unique package names. As a workaround, and since Android Instant Apps can not have a feature depend on another feature, we can alter the resource package name of a feature split just before writing it out to disk. This avoids using a unique package name while linking, thereby avoiding namespace issues. Bug: 68820737 Test: manual Change-Id: Ic553ed42656436bbb949393d0248ee7bb9d37860
Diffstat (limited to 'tools/aapt2/ResourceValues.cpp')
-rw-r--r--tools/aapt2/ResourceValues.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp
index b38d259d6b25..a782cd3672d1 100644
--- a/tools/aapt2/ResourceValues.cpp
+++ b/tools/aapt2/ResourceValues.cpp
@@ -118,7 +118,7 @@ bool Reference::Equals(const Value* value) const {
bool Reference::Flatten(android::Res_value* out_value) const {
const ResourceId resid = id.value_or_default(ResourceId(0));
const bool dynamic = resid.is_valid_dynamic() && resid.package_id() != kFrameworkPackageId &&
- resid.package_id() != kAppPackageId;
+ resid.package_id() < kAppPackageId;
if (reference_type == Reference::Type::kResource) {
if (dynamic) {