camera3: Update vendor tag spec for HAL 3.2.

- Deprecates vendor tag specification in camera3 device.
- Moves vendor tag ops declaration to camera metadata library and
  cleans up definitions.
- Updates the example HAL.

Change-Id: Ifb16bb0d4bbc896bc32d33dd150e7e174af57dad
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h
index 3a1233f..2508022 100644
--- a/include/hardware/camera_common.h
+++ b/include/hardware/camera_common.h
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <cutils/native_handle.h>
 #include <system/camera.h>
+#include <system/camera_vendor_tags.h>
 #include <hardware/hardware.h>
 #include <hardware/gralloc.h>
 
@@ -100,8 +101,9 @@
 #define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1)
 #define CAMERA_DEVICE_API_VERSION_3_0 HARDWARE_DEVICE_API_VERSION(3, 0)
 #define CAMERA_DEVICE_API_VERSION_3_1 HARDWARE_DEVICE_API_VERSION(3, 1)
+#define CAMERA_DEVICE_API_VERSION_3_2 HARDWARE_DEVICE_API_VERSION(3, 2)
 
-// Device version 2.x is outdated; device version 3.0 is experimental
+// Device version 2.x is outdated; device version 3.x is experimental
 #define CAMERA_DEVICE_API_VERSION_CURRENT CAMERA_DEVICE_API_VERSION_1_0
 
 /**
@@ -251,65 +253,6 @@
 
 } camera_module_callbacks_t;
 
-/**
- * Set up vendor-specific tag query methods. These are needed to properly query
- * entries with vendor-specified tags, potentially returned by get_camera_info.
- *
- * This should be used in place of vendor_tag_query_ops, which are deprecated.
- */
-typedef struct vendor_tag_ops vendor_tag_ops_t;
-struct vendor_tag_ops {
-    /**
-     * Get the number of vendor tags supported on this platform. Used to
-     * calculate the size of buffer needed for holding the array of all tags
-     * returned by get_all_tags().
-     */
-    int (*get_tag_count)(const vendor_tag_ops_t *v);
-
-    /**
-     * Fill an array with all the supported vendor tags on this platform.
-     * get_tag_count() returns the number of tags supported, and
-     * tag_array will be allocated with enough space to hold all of the tags.
-     */
-    void (*get_all_tags)(const vendor_tag_ops_t *v, uint32_t *tag_array);
-
-    /**
-     * Get vendor section name for a vendor-specified entry tag. Only called for
-     * vendor-defined tags. The section name must start with the name of the
-     * vendor in the Java package style. For example, CameraZoom Inc. must
-     * prefix their sections with "com.camerazoom." Must return NULL if the tag
-     * is outside the bounds of vendor-defined sections.
-     *
-     * There may be different vendor-defined tag sections, for example the
-     * phone maker, the chipset maker, and the camera module maker may each
-     * have their own "com.vendor."-prefixed section.
-     *
-     * The memory pointed to by the return value must remain valid for the
-     * lifetime that the module is loaded, and is owned by the module.
-     */
-    const char *(*get_section_name)(const vendor_tag_ops_t *v, uint32_t tag);
-
-    /**
-     * Get tag name for a vendor-specified entry tag. Only called for
-     * vendor-defined tags. Must return NULL if the it is not a vendor-defined
-     * tag.
-     *
-     * The memory pointed to by the return value must remain valid for the
-     * lifetime that the module is loaded, and is owned by the module.
-     */
-    const char *(*get_tag_name)(const vendor_tag_ops_t *v, uint32_t tag);
-
-    /**
-     * Get tag type for a vendor-specified entry tag. Only called for tags >=
-     * 0x80000000. Must return -1 if the tag is outside the bounds of
-     * vendor-defined sections.
-     */
-    int (*get_tag_type)(const vendor_tag_ops_t *v, uint32_t tag);
-
-    /* reserved for future use */
-    void* reserved[8];
-};
-
 typedef struct camera_module {
     hw_module_t common;
 
@@ -365,6 +308,9 @@
      * HAL should fill in all the vendor tag operation methods, or leave ops
      * unchanged if no vendor tags are defined.
      *
+     * The vendor_tag_ops structure used here is defined in:
+     * system/media/camera/include/system/vendor_tags.h
+     *
      * Version information (based on camera_module_t.common.module_api_version):
      *
      *  CAMERA_MODULE_API_VERSION_1_x/2_0/2_1: