OSDN Git Service

Camera: Fix Java metadata generation bug
authorEino-Ville Talvala <etalvala@google.com>
Thu, 12 Sep 2013 18:13:21 +0000 (11:13 -0700)
committerEino-Ville Talvala <etalvala@google.com>
Thu, 12 Sep 2013 18:20:54 +0000 (11:20 -0700)
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

camera/docs/metadata_helpers.py

index 51444bf..e897ed0 100644 (file)
@@ -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)