diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-17 01:07:55 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-17 01:07:55 +0000 |
commit | acea3863ef7301c3273008ec55c41ff36a933a0b (patch) | |
tree | 826f2aa550592865145d3c185ab7b67f97f8f107 | |
parent | a594a96a58f3d23cb9d8b3786d826e447640db00 (diff) | |
parent | 27751ea8c6470df82e2085ddd30987072445172f (diff) | |
download | tests-acea3863ef7301c3273008ec55c41ff36a933a0b.tar.gz |
Snap for 7464903 from 27751ea8c6470df82e2085ddd30987072445172f to sc-d1-release
Change-Id: Iae2369fc9a2c5cea42146bc3b206e03a008d8db2
-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 |