diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-09-12 11:13:21 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-09-12 11:20:54 -0700 |
commit | 23d4b2c087bd4286bf16bda83b6d9f72c5bb1718 (patch) | |
tree | 052963ce053baf3137f2db54cd794eb7d1948d60 | |
parent | 0702575fea9e820c8d52736da7542117b02bf679 (diff) | |
download | android_system_media-23d4b2c087bd4286bf16bda83b6d9f72c5bb1718.tar.gz android_system_media-23d4b2c087bd4286bf16bda83b6d9f72c5bb1718.tar.bz2 android_system_media-23d4b2c087bd4286bf16bda83b6d9f72c5bb1718.zip |
Camera: Fix Java metadata generation bug
When a single section included multiple groups of metadata of the same
kind (control, static, or dynamic), only the first was being used
for generating Java-level keys and enums.
Specifically, this affected android.statistics.lensShadingMapMode
Bug: 10726421
Change-Id: Ibec159777dee4d89cf04a7e2a450d4675934636f
-rw-r--r-- | camera/docs/metadata_helpers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/camera/docs/metadata_helpers.py b/camera/docs/metadata_helpers.py index 51444bf5..e897ed01 100644 --- a/camera/docs/metadata_helpers.py +++ b/camera/docs/metadata_helpers.py @@ -156,18 +156,17 @@ def get_children_by_throwing_away_kind(node, member='entries'): def get_children_by_filtering_kind(section, kind_name, member='entries'): """ - Takes a section and yields the children of the kind under this section. + Takes a section and yields the children of the merged kind under this section. Args: section: An instance of Section kind_name: A name of the kind, i.e. 'dynamic' or 'static' or 'controls' Returns: - An iterable over the children of the specified kind. + An iterable over the children of the specified merged kind. """ -# TODO: test/use this function - matched_kind = next((i for i in section.kinds if i.name == kind_name), None) + matched_kind = next((i for i in section.merged_kinds if i.name == kind_name), None) if matched_kind: return getattr(matched_kind, member) |