summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2015-05-05 16:49:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-05 16:49:42 +0000
commita627e3df129c4a502368ee861b1e5831ecae174a (patch)
treececcaf8f44ec8c5eb8203895e98a0180dc647773 /services
parent9f578d3297782be6de5373e171f3b4af49726709 (diff)
parent9c5af614aac9d9ffeee9124ce10f0f4bc025398d (diff)
downloadframeworks_av-a627e3df129c4a502368ee861b1e5831ecae174a.zip
frameworks_av-a627e3df129c4a502368ee861b1e5831ecae174a.tar.gz
frameworks_av-a627e3df129c4a502368ee861b1e5831ecae174a.tar.bz2
Merge "CameraService: update android.control.availableModes" into mnc-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/common/CameraModule.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp
index ac4d9a6..064ff71 100644
--- a/services/camera/libcameraservice/common/CameraModule.cpp
+++ b/services/camera/libcameraservice/common/CameraModule.cpp
@@ -36,12 +36,47 @@ void CameraModule::deriveCameraCharacteristicsKeys(
chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/1);
data = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE;
chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/1);
- controlModes.push(ANDROID_CONTROL_MODE_OFF);
controlModes.push(ANDROID_CONTROL_MODE_AUTO);
camera_metadata_entry entry = chars.find(ANDROID_CONTROL_AVAILABLE_SCENE_MODES);
if (entry.count > 1 || entry.data.u8[0] != ANDROID_CONTROL_SCENE_MODE_DISABLED) {
controlModes.push(ANDROID_CONTROL_MODE_USE_SCENE_MODE);
}
+
+ // Only advertise CONTROL_OFF mode if 3A manual controls are supported.
+ bool isManualAeSupported = false;
+ bool isManualAfSupported = false;
+ bool isManualAwbSupported = false;
+ entry = chars.find(ANDROID_CONTROL_AE_AVAILABLE_MODES);
+ if (entry.count > 0) {
+ for (size_t i = 0; i < entry.count; i++) {
+ if (entry.data.u8[i] == ANDROID_CONTROL_AE_MODE_OFF) {
+ isManualAeSupported = true;
+ break;
+ }
+ }
+ }
+ entry = chars.find(ANDROID_CONTROL_AF_AVAILABLE_MODES);
+ if (entry.count > 0) {
+ for (size_t i = 0; i < entry.count; i++) {
+ if (entry.data.u8[i] == ANDROID_CONTROL_AF_MODE_OFF) {
+ isManualAfSupported = true;
+ break;
+ }
+ }
+ }
+ entry = chars.find(ANDROID_CONTROL_AWB_AVAILABLE_MODES);
+ if (entry.count > 0) {
+ for (size_t i = 0; i < entry.count; i++) {
+ if (entry.data.u8[i] == ANDROID_CONTROL_AWB_MODE_OFF) {
+ isManualAwbSupported = true;
+ break;
+ }
+ }
+ }
+ if (isManualAeSupported && isManualAfSupported && isManualAwbSupported) {
+ controlModes.push(ANDROID_CONTROL_MODE_OFF);
+ }
+
chars.update(ANDROID_CONTROL_AVAILABLE_MODES, controlModes);
}
return;
@@ -86,7 +121,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
if (ret != 0) {
return ret;
}
- int deviceVersion = cameraInfo.device_version;
+ int deviceVersion = rawInfo.device_version;
if (deviceVersion < CAMERA_DEVICE_API_VERSION_2_0) {
// static_camera_characteristics is invalid
*info = rawInfo;