have flash on permanently even in photo mode, if set so

This commit is contained in:
tibbi 2016-12-18 18:04:47 +01:00
parent 3931579d48
commit 93ec82df00

View File

@ -221,12 +221,6 @@ public class Preview extends ViewGroup
public void takePicture() { public void takePicture() {
if (mCanTakePicture) { if (mCanTakePicture) {
if (mIsFlashEnabled) {
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
} else {
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
}
int rotation = Utils.Companion.getMediaRotation(mActivity, mCurrCameraId); int rotation = Utils.Companion.getMediaRotation(mActivity, mCurrCameraId);
rotation += Utils.Companion.compensateDeviceRotation(mCurrCameraId, mCallback.getCurrentOrientation()); rotation += Utils.Companion.compensateDeviceRotation(mCurrCameraId, mCallback.getCurrentOrientation());
@ -278,11 +272,6 @@ public class Preview extends ViewGroup
} }
mCanTakePicture = true; mCanTakePicture = true;
if (mIsFlashEnabled) {
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
mCamera.setParameters(mParameters);
}
} }
private Camera.Size getOptimalPictureSize() { private Camera.Size getOptimalPictureSize() {
@ -532,11 +521,8 @@ public class Preview extends ViewGroup
} }
public void enableFlash() { public void enableFlash() {
if (mIsVideoMode) { mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH); mCamera.setParameters(mParameters);
mCamera.setParameters(mParameters);
}
mIsFlashEnabled = true; mIsFlashEnabled = true;
} }