summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-08-25 14:48:00 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-25 14:48:00 -0700
commita82883bc7f41ab8672b5c863648fc39247ba3d7e (patch)
treee12f781dfaad51b82343aab6d5edd79905eeccd2 /src/com/android/camera/VideoModule.java
parent69502c4513e37bdca3eb7fd9e29c1578bfa04d79 (diff)
parentee5d17ff56388a99a8216a984ccca2eaa4fc6662 (diff)
downloadandroid_packages_apps_Snap-a82883bc7f41ab8672b5c863648fc39247ba3d7e.tar.gz
android_packages_apps_Snap-a82883bc7f41ab8672b5c863648fc39247ba3d7e.tar.bz2
android_packages_apps_Snap-a82883bc7f41ab8672b5c863648fc39247ba3d7e.zip
Merge "SnapdragonCamera: Fix camera flash blink after unlock device" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index db0faef65..bae16bde6 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -98,6 +98,7 @@ public class VideoModule implements CameraModule,
private static final int SHOW_TAP_TO_SNAPSHOT_TOAST = 7;
private static final int SWITCH_CAMERA = 8;
private static final int SWITCH_CAMERA_START_ANIMATION = 9;
+ private static final int HANDLE_FLASH_TORCH_DELAY = 10;
private static final int SCREEN_DELAY = 2 * 60 * 1000;
@@ -415,6 +416,11 @@ public class VideoModule implements CameraModule,
break;
}
+ case HANDLE_FLASH_TORCH_DELAY: {
+ forceFlashOff(!mPreviewFocused);
+ break;
+ }
+
default:
Log.v(TAG, "Unhandled message: " + msg.what);
break;
@@ -1224,7 +1230,7 @@ public class VideoModule implements CameraModule,
setDisplayOrientation();
mCameraDevice.setDisplayOrientation(mCameraDisplayOrientation);
- setCameraParameters();
+ setCameraParameters(true);
try {
mCameraDevice.setPreviewDisplay(sh);
@@ -1323,6 +1329,7 @@ public class VideoModule implements CameraModule,
mHandler.removeMessages(CHECK_DISPLAY_ROTATION);
mHandler.removeMessages(SWITCH_CAMERA);
mHandler.removeMessages(SWITCH_CAMERA_START_ANIMATION);
+ mHandler.removeMessages(HANDLE_FLASH_TORCH_DELAY);
mPendingSwitchCameraId = -1;
mSwitchingCamera = false;
mPreferenceRead = false;
@@ -2598,7 +2605,7 @@ public class VideoModule implements CameraModule,
}
@SuppressWarnings("deprecation")
- private void setCameraParameters() {
+ private void setCameraParameters(boolean isFlashDelay) {
Log.d(TAG,"Preview dimension in App->"+mDesiredPreviewWidth+"X"+mDesiredPreviewHeight);
mParameters.setPreviewSize(mDesiredPreviewWidth, mDesiredPreviewHeight);
mParameters.set("video-size", mProfile.videoFrameWidth+"x"+mProfile.videoFrameHeight);
@@ -2611,7 +2618,11 @@ public class VideoModule implements CameraModule,
mParameters.setPreviewFrameRate(mProfile.videoFrameRate);
}
- forceFlashOffIfSupported(!mPreviewFocused);
+ if (isFlashDelay) {
+ mHandler.sendEmptyMessageDelayed(HANDLE_FLASH_TORCH_DELAY, 800);
+ } else {
+ forceFlashOffIfSupported(!mPreviewFocused);
+ }
videoWidth = mProfile.videoFrameWidth;
videoHeight = mProfile.videoFrameHeight;
@@ -2786,7 +2797,7 @@ public class VideoModule implements CameraModule,
resizeForPreviewAspectRatio();
startPreview(); // Parameters will be set in startPreview().
} else {
- setCameraParameters();
+ setCameraParameters(false);
}
mRestartPreview = false;
mUI.updateOnScreenIndicators(mParameters, mPreferences);
@@ -2915,7 +2926,7 @@ public class VideoModule implements CameraModule,
@Override
public void onPreviewFocusChanged(boolean previewFocused) {
mUI.onPreviewFocusChanged(previewFocused);
- forceFlashOff(!previewFocused);
+ mHandler.sendEmptyMessageDelayed(HANDLE_FLASH_TORCH_DELAY, 800);
mPreviewFocused = previewFocused;
}