diff options
-rw-r--r-- | init.aries.rc | 1 | ||||
-rw-r--r-- | init.rc | 4 | ||||
-rw-r--r-- | libcamera/LibCameraWrapper.cpp | 28 | ||||
-rw-r--r-- | libcamera/LibCameraWrapper.h | 1 | ||||
-rw-r--r-- | overlay/packages/apps/CMParts/res/values/config.xml | 8 |
5 files changed, 38 insertions, 4 deletions
diff --git a/init.aries.rc b/init.aries.rc index fabe861..131a023 100644 --- a/init.aries.rc +++ b/init.aries.rc @@ -239,6 +239,7 @@ service vold /system/bin/vold service netd /system/bin/netd socket netd stream 0660 root system + socket dnsproxyd stream 0660 root inet service debuggerd /system/bin/debuggerd @@ -144,7 +144,9 @@ on boot write /proc/1/oom_adj -16 # Tweak background writeout - write /proc/sys/vm/dirty_expire_centisecs 200 + write /proc/sys/vm/dirty_writeback_centisecs 2000 + write /proc/sys/vm/dirty_expire_centisecs 1000 + write /proc/sys/vm/dirty_ratio 90 write /proc/sys/vm/dirty_background_ratio 5 # Permissions for System Server and daemons. diff --git a/libcamera/LibCameraWrapper.cpp b/libcamera/LibCameraWrapper.cpp index 3ccf332..a34c9b2 100644 --- a/libcamera/LibCameraWrapper.cpp +++ b/libcamera/LibCameraWrapper.cpp @@ -105,6 +105,7 @@ LibCameraWrapper::LibCameraWrapper(int cameraId) : mCameraId(cameraId), mVideoMode(false), mContinuousAf(false), + mFixFocus(false), mTouchFocus(false) { LOGV("%s :", __func__); @@ -164,7 +165,22 @@ status_t LibCameraWrapper::startPreview() { LOGV("%s :", __func__); - return mLibInterface->startPreview(); + status_t ret = mLibInterface->startPreview(); + + if (mFixFocus) { + LOGV("Fix focus mode"); + // We need to switch the focus mode once after switching from video or the camera won't work. + // Note: If the previous mode was macro, then it actually doesn't matter since the bug doesn't affect that case. + CameraParameters pars = mLibInterface->getParameters(); + const char *prevFocusMode = pars.get("focus-mode"); + pars.set("focus-mode", "macro"); + mLibInterface->setParameters(pars); + pars.set("focus-mode", prevFocusMode); + mLibInterface->setParameters(pars); + mFixFocus = false; + } + + return ret; } bool @@ -261,6 +277,7 @@ LibCameraWrapper::setParameters(const CameraParameters& params) const char *metering; const char *conAf; const char *touchCoordinate; + bool prevContinuousAf; /* * getInt returns -1 if the value isn't present and 0 on parse failure, @@ -281,11 +298,16 @@ LibCameraWrapper::setParameters(const CameraParameters& params) pars.set("slow_ae", "off"); } - // Parse continuous autofoucs into a format the driver understands + // Parse continuous autofocus into a format the driver understands conAf = pars.get("enable-caf"); + prevContinuousAf = mContinuousAf; mContinuousAf = (conAf != 0 && strcmp(conAf, "on") == 0); pars.set("continuous_af", mContinuousAf ? 1 : 0); + if (prevContinuousAf && !mContinuousAf) { + mFixFocus = true; + } + // Always set antibanding to 50hz pars.set("antibanding", "50hz"); @@ -301,7 +323,7 @@ LibCameraWrapper::setParameters(const CameraParameters& params) else if (strcmp(metering, "meter-matrix") == 0) { pars.set("metering", "matrix"); } - pars.remove("auto-exposure"); + pars.remove("meter-mode"); } // Read touch-to-focus diff --git a/libcamera/LibCameraWrapper.h b/libcamera/LibCameraWrapper.h index e999706..79c7586 100644 --- a/libcamera/LibCameraWrapper.h +++ b/libcamera/LibCameraWrapper.h @@ -51,6 +51,7 @@ private: int mCameraId; bool mVideoMode; bool mContinuousAf; + bool mFixFocus; bool mTouchFocus; int mTouchFocusX; int mTouchFocusY; diff --git a/overlay/packages/apps/CMParts/res/values/config.xml b/overlay/packages/apps/CMParts/res/values/config.xml new file mode 100644 index 0000000..5818480 --- /dev/null +++ b/overlay/packages/apps/CMParts/res/values/config.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Whether or not to display the trackball settings --> + <bool name="has_trackball">false</bool> + + <!-- Notification LED has single color only --> + <bool name="has_single_notification_led">true</bool> +</resources> |