camera_metadata: Automatically linkify tag names

Change-Id: I5f07a99765174f519e5d1187b38fd0e7ab355d3f
diff --git a/camera/docs/CameraMetadataKeys.mako b/camera/docs/CameraMetadataKeys.mako
index 51b314e..a1645db 100644
--- a/camera/docs/CameraMetadataKeys.mako
+++ b/camera/docs/CameraMetadataKeys.mako
@@ -24,33 +24,36 @@
      * modify the comment blocks at the start or end.
      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
 
+<%!
+  ##
+  ## Generate extra text blocks for the details field
+  def generate_extra_detail(entry):
+    text = entry.details
+    if entry.optional:
+      text += '\n\n<b>Optional</b> - This value may be null on some devices.\n'
+    if any(tag.name == 'FULL' for tag in entry.tags):
+      text += \
+        '\n<b>Full capability</b> - \n' + \
+        'Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the\n' + \
+        'android.info.supportedHardwareLevel key\n'
+    return text
+%>
 ##
 ## Generate a single key and docs
 <%def name="generate_key(entry)">\
     /**
   % if entry.description:
-${entry.description | javadoc}\
+${entry.description | javadoc(metadata)}\
   % endif
   % if entry.details:
-${entry.details | javadoc}\
+${generate_extra_detail(entry) | javadoc(metadata)}\
   % endif
   % if entry.enum and not (entry.typedef and entry.typedef.languages.get('java')):
     % for value in entry.enum.values:
      * @see #${jenum_value(entry, value)}
     % endfor
   % endif
-  % if entry.optional:
-     *
-     * <b>Optional</b> - This value may be null on some devices.
-  % endif
-  % if any(tag.name == 'FULL' for tag in entry.tags):
-     *
-     * <b>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL}</b> -
-     * Present on all devices that report being FULL level hardware devices in the
-     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL HARDWARE_LEVEL} key.
-  % endif
   % if entry.applied_visibility == 'hidden':
-     *
      * @hide
   % endif
      */