OSDN Git Service

camera_metadata: fix int64 enums being mismapped to Integer in API
authorZhijun He <zhijunhe@google.com>
Thu, 17 Apr 2014 18:33:33 +0000 (11:33 -0700)
committerZhijun He <zhijunhe@google.com>
Thu, 17 Apr 2014 18:43:43 +0000 (11:43 -0700)
metadata generation logic wrongly maps all tags that are both int64 and enum
to Integer type in managed code. This created mismatch between native and
managed sides and caused exception when application get the metadata key.

Change-Id: I53a213078d3587522970ca8af46ac28d43eef425

camera/docs/metadata_helpers.py

index 14e75cc..43de00c 100644 (file)
@@ -382,8 +382,8 @@ def jtype_unboxed(entry):
       java_type = typedef_name # already takes into account arrays
 
   if not java_type:
-    if not java_type and entry.enum:
-      # Always map enums to Java ints, unless there's a typedef override
+    if not java_type and entry.enum and metadata_type == 'byte':
+      # Always map byte enums to Java ints, unless there's a typedef override
       base_type = 'int'
 
     else: