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
1 changed files with 2 additions and 16 deletions

View File

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