summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable.h
diff options
context:
space:
mode:
author Jeremy Meyer <jakmcbane@google.com> 2024-06-04 14:22:03 -0700
committer Jeremy Meyer <jakmcbane@google.com> 2024-07-12 13:29:55 -0700
commit211bec2871da597f9f3fd81df7faffea1754437e (patch)
treecb65f77cf0dd3810f068efd20937b0745438ad12 /tools/aapt2/ResourceTable.h
parenta1c0fd0b31b799796295c648ae87c83d2e5ce470 (diff)
First pass at flagged resources
This gets the main parts of resource flagging in place and the basic use case of flagging with an xml attribute working. Test: Automated Bug: 329436914 Flag: EXEMPT Aconfig not supported on host tools Change-Id: Id2b5ba450d05da00a922e98ca204b6e5aa6c6c24
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r--tools/aapt2/ResourceTable.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index 61e399c7ab68..9530c1750c79 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -104,6 +104,8 @@ class ResourceConfigValue {
// The actual Value.
std::unique_ptr<Value> value;
+ FlagStatus flag_status;
+
ResourceConfigValue(const android::ConfigDescription& config, android::StringPiece product)
: config(config), product(product) {
}
@@ -269,6 +271,7 @@ struct NewResource {
std::optional<AllowNew> allow_new;
std::optional<StagedId> staged_id;
bool allow_mangled = false;
+ FlagStatus flag_status;
};
struct NewResourceBuilder {
@@ -282,6 +285,7 @@ struct NewResourceBuilder {
NewResourceBuilder& SetAllowNew(AllowNew allow_new);
NewResourceBuilder& SetStagedId(StagedId id);
NewResourceBuilder& SetAllowMangled(bool allow_mangled);
+ NewResourceBuilder& SetFlagStatus(FlagStatus flag_status);
NewResource Build();
private:
@@ -330,7 +334,8 @@ class ResourceTable {
std::unique_ptr<ResourceTable> Clone() const;
- // When a collision of resources occurs, this method decides which value to keep.
+ // When a collision of resources occurs, these methods decide which value to keep.
+ static CollisionResult ResolveFlagCollision(FlagStatus existing, FlagStatus incoming);
static CollisionResult ResolveValueCollision(Value* existing, Value* incoming);
// The string pool used by this resource table. Values that reference strings must use