summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSultanxda <sultanxda@gmail.com>2016-12-18 10:58:42 -0800
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:43 +0100
commitca34c971be8974fa2ca1a9faca633f635533ce78 (patch)
treed1af82fd2440139f15179f750f27f732c797fc44
parenta05e15cd2d1b7a0cd1c39425c0e2421d5ce16025 (diff)
downloadandroid_packages_apps_Snap-ca34c971be8974fa2ca1a9faca633f635533ce78.zip
android_packages_apps_Snap-ca34c971be8974fa2ca1a9faca633f635533ce78.tar.gz
android_packages_apps_Snap-ca34c971be8974fa2ca1a9faca633f635533ce78.tar.bz2
SnapdragonCamera: Enforce 120ms delay in between shutter clicks
To prevent unintentional duplicate photo captures. Change-Id: I5b24d834ba6eb7e2f606d656a71f5878ab8d08f5 Signed-off-by: Alex Naidis <alex.naidis@linux.com>
-rw-r--r--src/com/android/camera/PhotoModule.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index d5bdfd0..0e0ab1f 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -166,6 +166,7 @@ public class PhotoModule
private static final int SWITCH_TO_GCAM_MODULE = 12;
private static final int ON_PREVIEW_STARTED = 13;
private static final int INSTANT_CAPTURE = 14;
+ private static final int UNLOCK_CAM_SHUTTER = 15;
private static final int NO_DEPTH_EFFECT = 0;
private static final int DEPTH_EFFECT_SUCCESS = 1;
@@ -568,6 +569,11 @@ public class PhotoModule
onShutterButtonClick();
break;
}
+
+ case UNLOCK_CAM_SHUTTER: {
+ mUI.enableShutter(true);
+ break;
+ }
}
}
}
@@ -1949,10 +1955,12 @@ public class PhotoModule
mPreviewRestartSupport &= PIXEL_FORMAT_JPEG.equalsIgnoreCase(
pictureFormat);
+ mUI.enableShutter(false);
+
// We don't want user to press the button again while taking a
// multi-second HDR photo. For longshot, no need to disable.
- if (CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)) {
- mUI.enableShutter(false);
+ if (!CameraUtil.SCENE_MODE_HDR.equals(mSceneMode)) {
+ mHandler.sendEmptyMessageDelayed(UNLOCK_CAM_SHUTTER, 120);
}
if (!isShutterSoundOn()) {