Camera: modify metadata visibility attributes
So we can better describe whether a key should present in java or
native API.
Here are all possbile visibility values:
public = visible in both Java/NDK public API
ndk_public = visible in NDK API, @hide in java API
(mostly source of synthethic keys)
java_public = visible in public java API, not present in NDK
(mostly synthetic keys or features not supported
in NDK)
hidden = @hide in java API, not visible in NDK
system = not defined in any API.
Bug: 27102995
Change-Id: Ib5163b0aba62126dfe3d72ec62a24136ce206b17
diff --git a/camera/docs/metadata_model.py b/camera/docs/metadata_model.py
index 315c97c..37689e5 100644
--- a/camera/docs/metadata_model.py
+++ b/camera/docs/metadata_model.py
@@ -1031,6 +1031,9 @@
public entries are visible in the Android SDK.
applied_visibility: As visibility, but always valid, defaulting to 'system'
if no visibility is given for an entry.
+ applied_ndk_visible: Always valid. Default is 'false'.
+ Set to 'true' when the visibility implied entry is visible
+ in NDK.
synthetic: The C-level visibility of this entry ('false', 'true').
Synthetic entries will not be generated into the native metadata
list of entries (in C code). In general a synthetic entry is
@@ -1137,6 +1140,12 @@
return self._visibility or 'system'
@property
+ def applied_ndk_visible(self):
+ if self._visibility in ("public", "ndk_public"):
+ return "true"
+ return "false"
+
+ @property
def synthetic(self):
return self._synthetic
@@ -1274,6 +1283,7 @@
self._hwlevel = kwargs.get('hwlevel')
self._deprecated = kwargs.get('deprecated', False)
self._optional = kwargs.get('optional')
+ self._ndk_visible = kwargs.get('ndk_visible')
self._property_keys = kwargs
@@ -1470,6 +1480,7 @@
'type',
'type_notes',
'visibility',
+ 'ndk_visible',
'synthetic',
'hwlevel',
'deprecated',