mirror of
https://github.com/joel16/android_device_sony_kitakami-common.git
synced 2024-11-23 11:49:47 +00:00
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:
parent
5ff03252ca
commit
1f21f54530
@ -250,19 +250,18 @@ int QCamera2Factory::getCameraInfo(int camera_id, struct camera_info *info)
|
||||
return NO_INIT;
|
||||
}
|
||||
|
||||
if ( mHalDescriptors[camera_id].device_version == CAMERA_DEVICE_API_VERSION_3_0 ) {
|
||||
rc = QCamera3HardwareInterface::getCamInfo(mHalDescriptors[camera_id].cameraId, info);
|
||||
} else if (mHalDescriptors[camera_id].device_version == CAMERA_DEVICE_API_VERSION_1_0) {
|
||||
rc = QCamera2HardwareInterface::getCapabilities(mHalDescriptors[camera_id].cameraId, info);
|
||||
} else {
|
||||
ALOGE("%s: Device version for camera id %d invalid %d",
|
||||
__func__,
|
||||
camera_id,
|
||||
mHalDescriptors[camera_id].device_version);
|
||||
return BAD_VALUE;
|
||||
ALOGI("Camera id %d API version %d",
|
||||
camera_id, mHalDescriptors[camera_id].device_version);
|
||||
|
||||
// Need ANDROID_FLASH_INFO_AVAILABLE property for flashlight widget to
|
||||
// work and so get the static data regardless of HAL version
|
||||
rc = QCamera3HardwareInterface::getCamInfo(
|
||||
mHalDescriptors[camera_id].cameraId, info);
|
||||
if (mHalDescriptors[camera_id].device_version ==
|
||||
CAMERA_DEVICE_API_VERSION_1_0) {
|
||||
info->device_version = CAMERA_DEVICE_API_VERSION_1_0;
|
||||
}
|
||||
|
||||
ALOGV("%s: X", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user