diff options
-rwxr-xr-x | libcamera/SecCamera.cpp | 8 | ||||
-rw-r--r-- | libsensors/CompassSensor.cpp | 7 | ||||
-rw-r--r-- | libsensors/OrientationSensor.cpp | 7 | ||||
-rw-r--r-- | overlay/packages/apps/Camera/res/values/config.xml | 27 |
4 files changed, 42 insertions, 7 deletions
diff --git a/libcamera/SecCamera.cpp b/libcamera/SecCamera.cpp index 7ea19e8..dabe878 100755 --- a/libcamera/SecCamera.cpp +++ b/libcamera/SecCamera.cpp @@ -974,6 +974,14 @@ int SecCamera::stopRecord(void) if (m_camera_id == CAMERA_ID_BACK) { ret = fimc_v4l2_s_ctrl(m_cam_fd, V4L2_CID_CAMERA_CAF_START_STOP, 0); CHECK(ret); + + // Need to switch focus mode so that the camera can focus properly + // after using caf. + // Note: This bug is not affected when the original mode is macro + // so we can safely use that as a mode to switch to. + int orig_mode = m_params->focus_mode; + setFocusMode(FOCUS_MODE_MACRO); + setFocusMode(orig_mode); } m_flag_record_start = 0; diff --git a/libsensors/CompassSensor.cpp b/libsensors/CompassSensor.cpp index 4ed3e20..f4b3685 100644 --- a/libsensors/CompassSensor.cpp +++ b/libsensors/CompassSensor.cpp @@ -21,7 +21,6 @@ #include <unistd.h> #include <dirent.h> #include <sys/select.h> -#include <cutils/properties.h> #include <cutils/log.h> @@ -89,12 +88,6 @@ int CompassSensor::enable(int32_t, int en) { err = write(fd, buf, sizeof(buf)); close(fd); mEnabled = flags; - - /* Since the migration to 3.0 kernel, orientationd doesn't poll - * the enabled state properly, so start it when it's enabled and - * stop it when we're done using it. - */ - property_set(mEnabled ? "ctl.start" : "ctl.stop", "orientationd"); return 0; } return -1; diff --git a/libsensors/OrientationSensor.cpp b/libsensors/OrientationSensor.cpp index 2925ba7..d0c97af 100644 --- a/libsensors/OrientationSensor.cpp +++ b/libsensors/OrientationSensor.cpp @@ -21,6 +21,7 @@ #include <unistd.h> #include <dirent.h> #include <sys/select.h> +#include <cutils/properties.h> #include <cutils/log.h> @@ -85,6 +86,12 @@ int OrientationSensor::enable(int32_t, int en) { close(fd); mEnabled = flags; //setInitialState(); + + /* Since the migration to 3.0 kernel, orientationd doesn't poll + * the enabled state properly, so start it when it's enabled and + * stop it when we're done using it. + */ + property_set(mEnabled ? "ctl.start" : "ctl.stop", "orientationd"); return 0; } return -1; diff --git a/overlay/packages/apps/Camera/res/values/config.xml b/overlay/packages/apps/Camera/res/values/config.xml new file mode 100644 index 0000000..4ad7260 --- /dev/null +++ b/overlay/packages/apps/Camera/res/values/config.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2009, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> + +<!-- These resources are around just to allow their values to be customized + for different hardware and product builds. --> +<resources> + <!-- The camera removes the focus modes by default when touch-to-focus + exists. Use this option to change that behavior --> + <bool name="wantsFocusModes">true</bool> +</resources> + |