diff options
author | Todd Kennedy <toddke@google.com> | 2018-04-25 16:45:59 -0700 |
---|---|---|
committer | Todd Kennedy <toddke@google.com> | 2018-04-26 10:27:30 -0700 |
commit | 325129964e5b0a9794cf5bb63a2d2d8774ea6a1b (patch) | |
tree | 6916dd14dd937ad9650558c8afca42929acd26f2 /tools/aapt2/ResourceValues.cpp | |
parent | a93ab56ed802f320cbf1ac9452cae75acbef47c3 (diff) |
Allow using reserved package IDs
Pre-O, the platform treats negative resource IDs [those with
a package ID of 0x80 or higher] as invalid. In order to work
around this limitation, we allow the use of traditionally
reserved resource IDs [those between 0x02 and 0x7E].
Bug: 78041707
Test: ./out/host/linux-x86/nativetest64/aapt2_tests/aapt2_tests
Test: ./out/host/linux-x86/nativetest/libandroidfw_tests/libandroidfw_tests
Test: Manual. Create a feature split with a package ID of 0x7E and see it runs and can reference base resources.
Change-Id: I3d9782cc05d3a55e1a2467bf39566788847e1160
Diffstat (limited to 'tools/aapt2/ResourceValues.cpp')
-rw-r--r-- | tools/aapt2/ResourceValues.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp index 6f213e19e5f6..34b46c552e0c 100644 --- a/tools/aapt2/ResourceValues.cpp +++ b/tools/aapt2/ResourceValues.cpp @@ -117,8 +117,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; + const bool dynamic = resid.is_valid_dynamic() && is_dynamic; if (reference_type == Reference::Type::kResource) { if (dynamic) { |