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/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
index 9cdc86c..9348ab7 100644
--- a/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
+++ b/cmds/idmap2/tests/BinaryStreamVisitorTests.cpp
@@ -109,49 +109,55 @@
success = LoadedIdmap::Lookup(header, 0x0002, &entry); // string/c
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0003, &entry); // string/other
+ success = LoadedIdmap::Lookup(header, 0x0003, &entry); // string/policy_odm
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0004, &entry); // string/not_overlayable
+ success = LoadedIdmap::Lookup(header, 0x0004, &entry); // string/policy_oem
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0005, &entry); // string/policy_product
+ success = LoadedIdmap::Lookup(header, 0x0005, &entry); // string/other
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0006, &entry); // string/policy_public
+ success = LoadedIdmap::Lookup(header, 0x0006, &entry); // string/not_overlayable
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0007, &entry); // string/policy_system
+ success = LoadedIdmap::Lookup(header, 0x0007, &entry); // string/policy_product
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0008, &entry); // string/policy_system_vendor
+ success = LoadedIdmap::Lookup(header, 0x0008, &entry); // string/policy_public
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0009, &entry); // string/policy_signature
+ success = LoadedIdmap::Lookup(header, 0x0009, &entry); // string/policy_system
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x000a, &entry); // string/str1
+ success = LoadedIdmap::Lookup(header, 0x000a, &entry); // string/policy_system_vendor
+ ASSERT_FALSE(success);
+
+ success = LoadedIdmap::Lookup(header, 0x000b, &entry); // string/policy_signature
+ ASSERT_FALSE(success);
+
+ success = LoadedIdmap::Lookup(header, 0x000c, &entry); // string/str1
ASSERT_TRUE(success);
ASSERT_EQ(entry, 0x0000);
- success = LoadedIdmap::Lookup(header, 0x000b, &entry); // string/str2
+ success = LoadedIdmap::Lookup(header, 0x000d, &entry); // string/str2
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x000c, &entry); // string/str3
+ success = LoadedIdmap::Lookup(header, 0x000e, &entry); // string/str3
ASSERT_TRUE(success);
ASSERT_EQ(entry, 0x0001);
- success = LoadedIdmap::Lookup(header, 0x000d, &entry); // string/str4
+ success = LoadedIdmap::Lookup(header, 0x000f, &entry); // string/str4
ASSERT_TRUE(success);
ASSERT_EQ(entry, 0x0002);
- success = LoadedIdmap::Lookup(header, 0x000e, &entry); // string/x
+ success = LoadedIdmap::Lookup(header, 0x0010, &entry); // string/x
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x000f, &entry); // string/y
+ success = LoadedIdmap::Lookup(header, 0x0011, &entry); // string/y
ASSERT_FALSE(success);
- success = LoadedIdmap::Lookup(header, 0x0010, &entry); // string/z
+ success = LoadedIdmap::Lookup(header, 0x0012, &entry); // string/z
ASSERT_FALSE(success);
}