diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2019-04-09 17:13:50 -0700 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2019-04-17 16:07:57 -0700 |
commit | 939df096be11d242c8f3473954c7c10c371cf142 (patch) | |
tree | 0b4a8f3e490661546fe8fa728147da88a1b459e5 /tools/aapt2/format/binary/BinaryResourceParser.cpp | |
parent | 488693532998d5e08f68b58b235b7d6dcd3df1fb (diff) |
Add odm and oem policies
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.
Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
Diffstat (limited to 'tools/aapt2/format/binary/BinaryResourceParser.cpp')
-rw-r--r-- | tools/aapt2/format/binary/BinaryResourceParser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/aapt2/format/binary/BinaryResourceParser.cpp b/tools/aapt2/format/binary/BinaryResourceParser.cpp index 59eb9ec2d418..fd8e36ebf823 100644 --- a/tools/aapt2/format/binary/BinaryResourceParser.cpp +++ b/tools/aapt2/format/binary/BinaryResourceParser.cpp @@ -475,6 +475,14 @@ bool BinaryResourceParser::ParseOverlayable(const ResChunk_header* chunk) { & ResTable_overlayable_policy_header::POLICY_SIGNATURE) { policies |= OverlayableItem::Policy::kSignature; } + if (policy_header->policy_flags + & ResTable_overlayable_policy_header::POLICY_ODM_PARTITION) { + policies |= OverlayableItem::Policy::kOdm; + } + if (policy_header->policy_flags + & ResTable_overlayable_policy_header::POLICY_OEM_PARTITION) { + policies |= OverlayableItem::Policy::kOem; + } const ResTable_ref* const ref_begin = reinterpret_cast<const ResTable_ref*>( ((uint8_t *)policy_header) + util::DeviceToHost32(policy_header->header.headerSize)); |