diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-18 01:09:06 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-18 01:09:06 +0000 |
commit | 7be5d69c972bf6527a142cb6f12bfb2d8b1916c6 (patch) | |
tree | 826f2aa550592865145d3c185ab7b67f97f8f107 | |
parent | 2a456291fc4877fb2cdf0fd225de28f5a8e66883 (diff) | |
parent | cbe84baafa632434a89c154d8791e4cd5da12161 (diff) | |
download | tests-7be5d69c972bf6527a142cb6f12bfb2d8b1916c6.tar.gz |
Snap for 7468788 from cbe84baafa632434a89c154d8791e4cd5da12161 to sc-v2-release
Change-Id: I51673595d08c52151246836894c4a55e01609f59
-rw-r--r-- | tools/rro/resource_utils.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/rro/resource_utils.py b/tools/rro/resource_utils.py index aae73a1..8628abf 100644 --- a/tools/rro/resource_utils.py +++ b/tools/rro/resource_utils.py @@ -93,7 +93,17 @@ def get_resources_from_single_file(filename, ignore_strings=False): root = doc.getroot() result = set() for resource in root: - if resource.tag == 'declare-styleable' or resource.tag is etree.Comment: + if resource.tag is etree.Comment: + continue + if resource.tag == 'declare-styleable': + for attr in resource: + resName = attr.get('name') + # Skip resources beginning with 'android:' as they are part of the framework + # resources. This script finds only the app's resources. + if resName is None or resName.startswith('android:'): + continue + resType = "attr" + add_resource_to_set(result, Resource(resName, resType, ResourceLocation(filename, attr.sourceline))) continue resName = resource.get('name') resType = resource.tag |