Merge "Camera3: buffer manager doesn't support HAL3.2 devices"
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index ea1e5f6..cac82f3 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -971,9 +971,9 @@
     assert(mStatus != STATUS_ACTIVE);
 
     sp<Camera3OutputStream> newStream;
-    // Overwrite stream set id to invalid for HAL3.1 or lower, as buffer manager does support
+    // Overwrite stream set id to invalid for HAL3.2 or lower, as buffer manager does support
     // such devices.
-    if (mDeviceVersion < CAMERA_DEVICE_API_VERSION_3_2) {
+    if (mDeviceVersion <= CAMERA_DEVICE_API_VERSION_3_2) {
         streamSetId = CAMERA3_STREAM_SET_ID_INVALID;
     }
     if (format == HAL_PIXEL_FORMAT_BLOB) {
@@ -1008,11 +1008,12 @@
     newStream->setStatusTracker(mStatusTracker);
 
     /**
-     * Camera3 Buffer manager is only supported by HAL3.2 onwards, as the older HALs requires
-     * buffers to be statically allocated for internal static buffer registration, while the
-     * buffers provided by buffer manager are really dynamically allocated.
+     * Camera3 Buffer manager is only supported by HAL3.3 onwards, as the older HALs ( < HAL3.2)
+     * requires buffers to be statically allocated for internal static buffer registration, while
+     * the buffers provided by buffer manager are really dynamically allocated. For HAL3.2, because
+     * not all HAL implementation supports dynamic buffer registeration, exlude it as well.
      */
-    if (mDeviceVersion >= CAMERA_DEVICE_API_VERSION_3_2) {
+    if (mDeviceVersion > CAMERA_DEVICE_API_VERSION_3_2) {
         newStream->setBufferManager(mBufferManager);
     }
 
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
index 4e79029..1c7bd81 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -416,11 +416,12 @@
     }
 
     /**
-     * Camera3 Buffer manager is only supported by HAL3.2 onwards, as the older HALs requires
+     * Camera3 Buffer manager is only supported by HAL3.3 onwards, as the older HALs requires
      * buffers to be statically allocated for internal static buffer registration, while the
      * buffers provided by buffer manager are really dynamically allocated. Camera3Device only
-     * sets the mBufferManager if device version is >= HAL3.2, which guarantees that the buffer
-     * manager setup is skipped in below code.
+     * sets the mBufferManager if device version is > HAL3.2, which guarantees that the buffer
+     * manager setup is skipped in below code. Note that HAL3.2 is also excluded here, as some
+     * HAL3.2 devices may not support the dynamic buffer registeration.
      */
     if (mBufferManager != 0 && mSetId > CAMERA3_STREAM_SET_ID_INVALID) {
         StreamInfo streamInfo(