diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-07 01:08:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-05-07 01:08:29 +0000 |
commit | 05018c5f7d33e660bb62b1da4d2168ba82c9e537 (patch) | |
tree | 28de9da1834dadfcff8393f1f127854cc1b7d0a7 | |
parent | 55f359f387796fef6150162f5cc0f356adb39d5b (diff) | |
parent | 52a5ebb1e4faf5bec4c9944d6aed78e559908c44 (diff) | |
download | tests-05018c5f7d33e660bb62b1da4d2168ba82c9e537.tar.gz |
Snap for 7343210 from 52a5ebb1e4faf5bec4c9944d6aed78e559908c44 to sc-v2-release
Change-Id: I68afd085e6698cee6bcb8a9efd13efc5b7ac8a1f
-rw-r--r-- | tools/rro/resource_utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/rro/resource_utils.py b/tools/rro/resource_utils.py index 5e860f9..aae73a1 100644 --- a/tools/rro/resource_utils.py +++ b/tools/rro/resource_utils.py @@ -75,7 +75,8 @@ def get_all_resources(resDir, excluded_resource_files=[]): for file in os.listdir(os.path.join(resDir, dir)): filePath = os.path.abspath(os.path.join(resDir, dir, file)) if file.endswith('.xml') and filePath not in excluded_resource_files: - for resource in get_resources_from_single_file(os.path.join(resDir, dir, file)): + for resource in get_resources_from_single_file(os.path.join(resDir, dir, file), + dir != "values"): add_resource_to_set(resources, resource) return resources @@ -87,7 +88,7 @@ def get_ids_from_layout_file(filename): add_resource_to_set(result, Resource(i, 'id', ResourceLocation(filename))) return result -def get_resources_from_single_file(filename): +def get_resources_from_single_file(filename, ignore_strings=False): doc = etree.parse(filename) root = doc.getroot() result = set() @@ -100,6 +101,8 @@ def get_resources_from_single_file(filename): resType = "array" if resource.tag == 'item' or resource.tag == 'public': resType = resource.get('type') + if resType == 'string' and ignore_strings: + continue if resType == 'overlayable': for policy in resource: for overlayable in policy: |