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
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index 7ed7897..30ba1ae 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -79,22 +79,28 @@
// Represents the types overlays that are allowed to overlay the resource.
typedef uint32_t PolicyFlags;
enum Policy : uint32_t {
- kNone = 0x00,
+ kNone = 0x00000000,
// The resource can be overlaid by any overlay.
- kPublic = 0x01,
+ kPublic = 0x00000001,
// The resource can be overlaid by any overlay on the system partition.
- kSystem = 0x02,
+ kSystem = 0x00000002,
// The resource can be overlaid by any overlay on the vendor partition.
- kVendor = 0x04,
+ kVendor = 0x00000004,
// The resource can be overlaid by any overlay on the product partition.
- kProduct = 0x08,
+ kProduct = 0x00000008,
// The resource can be overlaid by any overlay signed with the same signature as its actor.
- kSignature = 0x010,
+ kSignature = 0x00000010,
+
+ // The resource can be overlaid by any overlay on the odm partition.
+ kOdm = 0x00000020,
+
+ // The resource can be overlaid by any overlay on the oem partition.
+ kOem = 0x00000040,
};
std::shared_ptr<Overlayable> overlayable;