QCamera2Factory: Initialize HAL descriptor before get_camera_info
get_camera_info method uses HAL descriptor to determine which
version of HAL is active. Initialize HAL descriptor before
calling get_camera_info
Bug: 19809724
Change-Id: I055651baefcef05971dd184718caf15b0619ba26
diff --git a/camera/QCamera2/QCamera2Factory.cpp b/camera/QCamera2/QCamera2Factory.cpp
index e0584b8..78ccd3f 100644
--- a/camera/QCamera2/QCamera2Factory.cpp
+++ b/camera/QCamera2/QCamera2Factory.cpp
@@ -66,13 +66,6 @@
char prop[PROPERTY_VALUE_MAX];
property_get("persist.camera.HAL3.enabled", prop, "0");
int isHAL3Enabled = atoi(prop);
- //Query camera at this point in order
- //to avoid any delays during subsequent
- //calls to 'getCameraInfo()'
- for (int i = 0 ; i < mNumOfCameras ; i++) {
- getCameraInfo(i, &info);
- }
- //
if ((mNumOfCameras > 0) && (mNumOfCameras <= MM_CAMERA_MAX_NUM_SENSORS)) {
mHalDescriptors = new hal_desc[mNumOfCameras];
@@ -86,6 +79,10 @@
} else {
mHalDescriptors[i].device_version = CAMERA_DEVICE_API_VERSION_1_0;
}
+ //Query camera at this point in order
+ //to avoid any delays during subsequent
+ //calls to 'getCameraInfo()'
+ getCameraInfo(i, &info);
}
} else {
ALOGE("%s: Not enough resources to allocate HAL descriptor table!",