From e1ab849b391c6d5c7fbf57310701c99cad88ba21 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 11 Sep 2024 13:28:16 -0700 Subject: Support multiple or elements in manifest_*.py Manifests may now have multiple copies of elements if they are disambiguated with android:featureFlag attributes. Remove the restrictions on duplicate elements from manifest_check.py and manifest_fixer.py, and instead iterate over all matching elements. Test: manifest_check_test.py, manifest_fixer_test.py Bug: 365170653 Flag: EXEMPT bugfix Change-Id: Ib577439d03a808a20a5fcc3e15a3117e0970d729 --- scripts/manifest_check_test.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'scripts/manifest_check_test.py') diff --git a/scripts/manifest_check_test.py b/scripts/manifest_check_test.py index 7aaf8a966..abe0d8b0e 100755 --- a/scripts/manifest_check_test.py +++ b/scripts/manifest_check_test.py @@ -234,6 +234,32 @@ class EnforceUsesLibrariesTest(unittest.TestCase): optional_uses_libraries=['//x/y/z:bar']) self.assertTrue(matches) + def test_multiple_applications(self): + xml = """ + + + + + + + + + + + """ + apk = self.apk_tmpl % ('\n'.join([ + uses_library_apk('foo'), + uses_library_apk('bar', required_apk(False)), + uses_library_apk('foo'), + uses_library_apk('qux', required_apk(False)) + ])) + matches = self.run_test( + xml, + apk, + uses_libraries=['//x/y/z:foo'], + optional_uses_libraries=['//x/y/z:bar', '//x/y/z:qux']) + self.assertTrue(matches) + class ExtractTargetSdkVersionTest(unittest.TestCase): -- cgit v1.2.3-59-g8ed1b