Merge "Camera: add HAL 3.4 declaration"
diff --git a/include/hardware/camera2.h b/include/hardware/camera2.h
index d920d4b..2b7add0 100644
--- a/include/hardware/camera2.h
+++ b/include/hardware/camera2.h
@@ -23,7 +23,10 @@
 /**
  * Camera device HAL 2.1 [ CAMERA_DEVICE_API_VERSION_2_0, CAMERA_DEVICE_API_VERSION_2_1 ]
  *
- * DEPRECATED. New devices should use Camera HAL v3.2 or newer.
+ * NO LONGER SUPPORTED.  The camera service will no longer load HAL modules that
+ * contain HAL v2.0 or v2.1 devices.
+ *
+ * New devices should use Camera HAL v3.2 or newer.
  *
  * Supports the android.hardware.Camera API, and the android.hardware.camera2
  * API in legacy mode only.
diff --git a/include/hardware/camera_common.h b/include/hardware/camera_common.h
index fe0e5cf..c74d7bb 100644
--- a/include/hardware/camera_common.h
+++ b/include/hardware/camera_common.h
@@ -140,9 +140,9 @@
  * All device versions <= HARDWARE_DEVICE_API_VERSION(1, 0xFF) must be treated
  * as CAMERA_DEVICE_API_VERSION_1_0
  */
-#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0)
-#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0)
-#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1)
+#define CAMERA_DEVICE_API_VERSION_1_0 HARDWARE_DEVICE_API_VERSION(1, 0) // DEPRECATED
+#define CAMERA_DEVICE_API_VERSION_2_0 HARDWARE_DEVICE_API_VERSION(2, 0) // NO LONGER SUPPORTED
+#define CAMERA_DEVICE_API_VERSION_2_1 HARDWARE_DEVICE_API_VERSION(2, 1) // NO LONGER SUPPORTED
 #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)
diff --git a/include/hardware/fingerprint.h b/include/hardware/fingerprint.h
index ac88c10..618ca7e 100644
--- a/include/hardware/fingerprint.h
+++ b/include/hardware/fingerprint.h
@@ -21,6 +21,7 @@
 
 #define FINGERPRINT_MODULE_API_VERSION_1_0 HARDWARE_MODULE_API_VERSION(1, 0)
 #define FINGERPRINT_MODULE_API_VERSION_2_0 HARDWARE_MODULE_API_VERSION(2, 0)
+#define FINGERPRINT_MODULE_API_VERSION_2_1 HARDWARE_MODULE_API_VERSION(2, 1)
 #define FINGERPRINT_HARDWARE_MODULE_ID "fingerprint"
 
 typedef enum fingerprint_msg_type {
@@ -28,7 +29,8 @@
     FINGERPRINT_ACQUIRED = 1,
     FINGERPRINT_TEMPLATE_ENROLLING = 3,
     FINGERPRINT_TEMPLATE_REMOVED = 4,
-    FINGERPRINT_AUTHENTICATED = 5
+    FINGERPRINT_AUTHENTICATED = 5,
+    FINGERPRINT_TEMPLATE_ENUMERATING = 6,
 } fingerprint_msg_type_t;
 
 /*
@@ -82,6 +84,11 @@
     uint64_t msg; /* Vendor specific message. Used for user guidance */
 } fingerprint_enroll_t;
 
+typedef struct fingerprint_enumerated {
+    fingerprint_finger_id_t finger;
+    uint32_t remaining_templates;
+} fingerprint_enumerated_t;
+
 typedef struct fingerprint_removed {
     fingerprint_finger_id_t finger;
 } fingerprint_removed_t;
@@ -100,6 +107,7 @@
     union {
         fingerprint_error_t error;
         fingerprint_enroll_t enroll;
+        fingerprint_enumerated_t enumerated;
         fingerprint_removed_t removed;
         fingerprint_acquired_t acquired;
         fingerprint_authenticated_t authenticated;
@@ -198,31 +206,24 @@
     /*
      * Enumerate all the fingerprint templates found in the directory set by
      * set_active_group()
-     * This is a synchronous call. The function takes:
-     * - A pointer to an array of fingerprint_finger_id_t.
-     * - The size of the array provided, in fingerprint_finger_id_t elements.
-     * Max_size is a bi-directional parameter and returns the actual number
-     * of elements copied to the caller supplied array.
-     * In the absence of errors the function returns the total number of templates
-     * in the user directory.
-     * If the caller has no good guess on the size of the array he should call this
-     * function witn *max_size == 0 and use the return value for the array allocation.
-     * The caller of this function has a complete list of the templates when *max_size
-     * is the same as the function return.
+     * For each template found notify() will be called with:
+     * fingerprint_msg.type == FINGERPRINT_TEMPLATE_ENUMERATED
+     * fingerprint_msg.data.enumerated.finger indicating a template id
+     * fingerprint_msg.data.enumerated.remaining_templates indicating how many more
+     * enumeration messages to expect.
      *
-     * Function return: Total number of fingerprint templates in the current storage directory.
+     * Function return: 0 if enumerate request is accepted
      *                  or a negative number in case of error, generally from the errno.h set.
      */
-    int (*enumerate)(struct fingerprint_device *dev, fingerprint_finger_id_t *results,
-        uint32_t *max_size);
+    int (*enumerate)(struct fingerprint_device *dev);
 
     /*
      * Fingerprint remove request:
      * Deletes a fingerprint template.
-     * Works only within a path set by set_active_group().
+     * Works only within the path set by set_active_group().
      * notify() will be called with details on the template deleted.
      * fingerprint_msg.type == FINGERPRINT_TEMPLATE_REMOVED and
-     * fingerprint_msg.data.removed.id indicating the template id removed.
+     * fingerprint_msg.data.removed.finger indicating the template id removed.
      *
      * Function return: 0 if fingerprint template(s) can be successfully deleted
      *                  or a negative number in case of error, generally from the errno.h set.
diff --git a/tests/camera2/CameraModuleFixture.h b/tests/camera2/CameraModuleFixture.h
index 3a2df69..661c693 100644
--- a/tests/camera2/CameraModuleFixture.h
+++ b/tests/camera2/CameraModuleFixture.h
@@ -23,7 +23,6 @@
 #include "hardware/camera2.h"
 
 #include <common/CameraModule.h>
-#include <device2/Camera2Device.h>
 #include <device3/Camera3Device.h>
 
 #include "camera2_utils.h"
@@ -92,14 +91,10 @@
         struct camera_info info;
         ASSERT_EQ(OK, mModule->getCameraInfo(cameraID, &info));
 
-        ASSERT_GE((int)info.device_version, CAMERA_DEVICE_API_VERSION_2_0) <<
+        ASSERT_GE((int)info.device_version, CAMERA_DEVICE_API_VERSION_3_0) <<
                 "Device version too old for camera " << cameraID << ". Version: " <<
                 info.device_version;
         switch(info.device_version) {
-            case CAMERA_DEVICE_API_VERSION_2_0:
-            case CAMERA_DEVICE_API_VERSION_2_1:
-                *device = new Camera2Device(cameraID);
-                break;
             case CAMERA_DEVICE_API_VERSION_3_0:
             case CAMERA_DEVICE_API_VERSION_3_1:
             case CAMERA_DEVICE_API_VERSION_3_2:
diff --git a/tests/camera2/CameraMultiStreamTests.cpp b/tests/camera2/CameraMultiStreamTests.cpp
index 3e29ad6..eb64db1 100644
--- a/tests/camera2/CameraMultiStreamTests.cpp
+++ b/tests/camera2/CameraMultiStreamTests.cpp
@@ -495,9 +495,6 @@
         jpegData = availableJpegSizes.data.i32;
         jpegCount = availableJpegSizes.count;
     } else {
-        const int32_t *implDefResolutions;
-        size_t   implDefResolutionsCount;
-
         getResolutionList(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED, &implDefData, &implDefCount);
         ASSERT_NE(0u, implDefCount)
             << "Missing implementation defined sizes";
diff --git a/tests/camera2/CameraStreamFixture.h b/tests/camera2/CameraStreamFixture.h
index fc5fb36..bf7fb42 100644
--- a/tests/camera2/CameraStreamFixture.h
+++ b/tests/camera2/CameraStreamFixture.h
@@ -186,7 +186,6 @@
     void getResolutionList(int32_t format,
             const int32_t **list,
             size_t *count) {
-        status_t res;
         ALOGV("Getting resolutions for format %x", format);
         if (getDeviceVersion() < CAMERA_DEVICE_API_VERSION_3_2) {
             return;
diff --git a/tests/camera2/CameraStreamTests.cpp b/tests/camera2/CameraStreamTests.cpp
index a3b8c47..de9ae8a 100644
--- a/tests/camera2/CameraStreamTests.cpp
+++ b/tests/camera2/CameraStreamTests.cpp
@@ -29,8 +29,6 @@
 #include <gui/CpuConsumer.h>
 #include <gui/Surface.h>
 
-#include <device2/Camera2Device.h>
-
 #include "CameraStreamFixture.h"
 #include "TestExtensions.h"