diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2019-02-10 06:52:31 -0800 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2019-02-10 06:52:31 -0800 |
commit | 3f64df28512b6d30787383262bc4ab27c9152e35 (patch) | |
tree | 124eb6d458a85554d475b38c5915cf42060b00dc /src/com | |
parent | 3853cc83a73ac0fac77adac9ecba346e8731cc09 (diff) | |
parent | 4fc685f3217532da4d5d7bc0f2c8b289d1036c35 (diff) | |
download | android_packages_apps_Snap-3f64df28512b6d30787383262bc4ab27c9152e35.tar.gz android_packages_apps_Snap-3f64df28512b6d30787383262bc4ab27c9152e35.tar.bz2 android_packages_apps_Snap-3f64df28512b6d30787383262bc4ab27c9152e35.zip |
Merge 4fc685f3217532da4d5d7bc0f2c8b289d1036c35 on remote branch
Change-Id: I5e65bd3c1a28ab899ddee188137a53ec18501c10
Diffstat (limited to 'src/com')
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 36 | ||||
-rwxr-xr-x | src/com/android/camera/ui/ProMode.java | 22 |
2 files changed, 41 insertions, 17 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index cf5ebdbb1..a55c9e451 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1037,7 +1037,14 @@ public class CaptureModule implements CameraModule, PhotoController, } } - if ((CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || + // If the lens is just fixed focus then check only + // for AE Lock else check AF & AE state before + // trigger of capture + if (mSettingsManager.isFixedFocus(getMainCameraId())) { + if (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_LOCKED) { + checkAfAeStatesAndCapture(id); + } + } else if ((CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED == afState || CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED == afState) && (aeState == null || aeState == CaptureResult.CONTROL_AE_STATE_LOCKED)) { checkAfAeStatesAndCapture(id); @@ -4024,7 +4031,7 @@ public class CaptureModule implements CameraModule, PhotoController, } }; - private void configureCameraSessionWithParameters(CameraDevice camera, + private void configureCameraSessionWithParameters(int cameraId, List<Surface> outputSurfaces, CameraCaptureSession.StateCallback listener, Handler handler, CaptureRequest initialRequest) throws CameraAccessException { List<OutputConfiguration> outConfigurations = new ArrayList<>(outputSurfaces.size()); @@ -4033,13 +4040,32 @@ public class CaptureModule implements CameraModule, PhotoController, outConfigurations.add(new OutputConfiguration(surface)); } + String zzHDR = mSettingsManager.getValue(SettingsManager.KEY_VIDEO_HDR_VALUE); + boolean zzHdrStatue = zzHDR.equals("1"); + // if enable ZZHDR mode, don`t call the setOpModeForVideoStream method. + /* if (!zzHdrStatue) { + setOpModeForVideoStream(cameraId); + }*/ + String value = mSettingsManager.getValue(SettingsManager.KEY_FOVC_VALUE); + if (value != null && Boolean.parseBoolean(value)) { + mStreamConfigOptMode = mStreamConfigOptMode | STREAM_CONFIG_MODE_FOVC; + } + if (zzHdrStatue) { + mStreamConfigOptMode = STREAM_CONFIG_MODE_ZZHDR; + } + if (DEBUG) { + Log.v(TAG, "configureCameraSessionWithParameters mStreamConfigOptMode :" + + mStreamConfigOptMode); + } + Method method_setSessionParameters = null; Method method_createCaptureSession = null; Object sessionConfig = null; try { Class clazz = Class.forName("android.hardware.camera2.params.SessionConfiguration"); sessionConfig = clazz.getConstructors()[0].newInstance( - SESSION_REGULAR, outConfigurations, new HandlerExecutor(handler), listener); + SESSION_REGULAR | mStreamConfigOptMode, outConfigurations, + new HandlerExecutor(handler), listener); if (method_setSessionParameters == null) { method_setSessionParameters = clazz.getDeclaredMethod( "setSessionParameters", CaptureRequest.class); @@ -4047,7 +4073,7 @@ public class CaptureModule implements CameraModule, PhotoController, method_setSessionParameters.invoke(sessionConfig, initialRequest); method_createCaptureSession = CameraDevice.class.getDeclaredMethod( "createCaptureSession", clazz); - method_createCaptureSession.invoke(camera, sessionConfig); + method_createCaptureSession.invoke(mCameraDevice[cameraId], sessionConfig); } catch (Exception exception) { Log.w(TAG, "configureCameraSessionWithParameters method is not exist"); exception.printStackTrace(); @@ -4173,7 +4199,7 @@ public class CaptureModule implements CameraModule, PhotoController, mSessionListener, mCameraHandler, initialRequest); } else { - configureCameraSessionWithParameters(mCameraDevice[cameraId], surfaces, + configureCameraSessionWithParameters(cameraId, surfaces, mSessionListener, mCameraHandler, mVideoRequestBuilder.build()); } } else { diff --git a/src/com/android/camera/ui/ProMode.java b/src/com/android/camera/ui/ProMode.java index c5193bdef..7a0dede04 100755 --- a/src/com/android/camera/ui/ProMode.java +++ b/src/com/android/camera/ui/ProMode.java @@ -325,20 +325,18 @@ public class ProMode extends View { mIndex = index; String key = currentKey(); - if (mIndex > 0) { - View v = mAddedViews.get(mIndex); - if (v instanceof TextView) { - ((TextView) v).setTextColor(BLUE); - } else if (v instanceof ImageView) { - if (mMode == WHITE_BALANCE_MODE) { - ((ImageView) v).setImageResource(wbIconsBlue[mIndex]); - } + View v = mAddedViews.get(mIndex); + if (v instanceof TextView) { + ((TextView) v).setTextColor(BLUE); + } else if (v instanceof ImageView) { + if (mMode == WHITE_BALANCE_MODE) { + ((ImageView) v).setImageResource(wbIconsBlue[mIndex]); } - if (key != null) mSettingsManager.setValueIndex(key, mIndex); - CharSequence[] cc = mSettingsManager.getEntries(key); - mUI.updateProModeText(mMode, cc[mIndex].toString()); - invalidate(); } + if (key != null) mSettingsManager.setValueIndex(key, mIndex); + CharSequence[] cc = mSettingsManager.getEntries(key); + mUI.updateProModeText(mMode, cc[mIndex].toString()); + invalidate(); } private void removeViews() { |