diff options
author | 2025-02-24 11:01:49 -0800 | |
---|---|---|
committer | 2025-03-06 16:50:57 -0800 | |
commit | 08c54a712ed7a6463d1b6471c75c05fe1aabd36d (patch) | |
tree | 3832989516a61303682e30e9230e5d4492d54584 /tools/aapt2/ResourceTable.h | |
parent | 61c93118bccb8c17e1f45f268e8ebf22394aeed7 (diff) |
Persist whether xml resources have flags
This stores whether an xml document has feature flags in it in a
ResTable_entry so that at runtime we can know not to do extra work
looking for flags.
Test: Automation
Bug: 377974898
Flag: android.content.res.layout_readwrite_flags
Change-Id: Id43b2d9941d1fab8c654d081bf19df5a33a464f3
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r-- | tools/aapt2/ResourceTable.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h index b0e185536d16..778b43adb50b 100644 --- a/tools/aapt2/ResourceTable.h +++ b/tools/aapt2/ResourceTable.h @@ -104,6 +104,9 @@ class ResourceConfigValue { // The actual Value. std::unique_ptr<Value> value; + // Whether the value uses read/write feature flags + bool uses_readwrite_feature_flags = false; + ResourceConfigValue(const android::ConfigDescription& config, android::StringPiece product) : config(config), product(product) { } @@ -284,6 +287,7 @@ struct NewResource { std::optional<AllowNew> allow_new; std::optional<StagedId> staged_id; bool allow_mangled = false; + bool uses_readwrite_feature_flags = false; }; struct NewResourceBuilder { @@ -297,6 +301,7 @@ struct NewResourceBuilder { NewResourceBuilder& SetAllowNew(AllowNew allow_new); NewResourceBuilder& SetStagedId(StagedId id); NewResourceBuilder& SetAllowMangled(bool allow_mangled); + NewResourceBuilder& SetUsesReadWriteFeatureFlags(bool uses_feature_flags); NewResource Build(); private: |