kitakami-common: QCamera2: HAL: FlashLight widget fix for HAL1

Issue:
Flashlight in system tray is not working with HAL1 on
devices with module version >= 2.4.
Its due to framework looks for ANDROID_FLASH_INFO_AVAILABLE
property which is not set in the HAL1 camera info.

Fix:
Populate the required camera static characteristics
regardless of HAL version.

CRs-Fixed: 993695
Change-Id: I5d3b95b3b3f4ab72ae3b67c87a8a2d257260a5de
This commit is contained in:
Rajaram Gudivada 2016-03-23 20:07:03 +05:30 committed by TARKZiM
parent 5ff03252ca
commit 1f21f54530

View File

@ -250,19 +250,18 @@ int QCamera2Factory::getCameraInfo(int camera_id, struct camera_info *info)
return NO_INIT; return NO_INIT;
} }
if ( mHalDescriptors[camera_id].device_version == CAMERA_DEVICE_API_VERSION_3_0 ) { ALOGI("Camera id %d API version %d",
rc = QCamera3HardwareInterface::getCamInfo(mHalDescriptors[camera_id].cameraId, info); camera_id, mHalDescriptors[camera_id].device_version);
} else if (mHalDescriptors[camera_id].device_version == CAMERA_DEVICE_API_VERSION_1_0) {
rc = QCamera2HardwareInterface::getCapabilities(mHalDescriptors[camera_id].cameraId, info); // Need ANDROID_FLASH_INFO_AVAILABLE property for flashlight widget to
} else { // work and so get the static data regardless of HAL version
ALOGE("%s: Device version for camera id %d invalid %d", rc = QCamera3HardwareInterface::getCamInfo(
__func__, mHalDescriptors[camera_id].cameraId, info);
camera_id, if (mHalDescriptors[camera_id].device_version ==
mHalDescriptors[camera_id].device_version); CAMERA_DEVICE_API_VERSION_1_0) {
return BAD_VALUE; info->device_version = CAMERA_DEVICE_API_VERSION_1_0;
} }
ALOGV("%s: X", __func__);
return rc; return rc;
} }