summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2015-05-07 18:38:41 -0700
committerByunghun Jeon <bjeon@codeaurora.org>2015-09-03 14:12:44 -0700
commitd63d1133742bd03b13a1bbf6dce031291cf9729d (patch)
tree5052a049509f33a0ded82401420c39a346700f86 /src
parent007b0d24e854630caa4fdf07899e3aa5f4ad301b (diff)
downloadandroid_packages_apps_Snap-d63d1133742bd03b13a1bbf6dce031291cf9729d.tar.gz
android_packages_apps_Snap-d63d1133742bd03b13a1bbf6dce031291cf9729d.tar.bz2
android_packages_apps_Snap-d63d1133742bd03b13a1bbf6dce031291cf9729d.zip
SnapdragonCamera: limit longshot captures
Limit the number of shots captured during longshot/continuous capture mode. The limit will be based on sysprop: "persist.camera.longshot.shotnum". Reset the value to 0 to remove the limit. Change-Id: Ib8994d2e851fc95feab6b1a3817fc66c75836ccc
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/PhotoModule.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index cdeb490ed..b2dc7d08c 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -196,6 +196,9 @@ public class PhotoModule
private boolean mRefocus = false;
private boolean mLastPhotoTakenWithRefocus = false;
+ private int mLongShotCaptureCount;
+ private int mLongShotCaptureCountLimit;
+
// The degrees of the device rotated clockwise from its natural orientation.
private int mOrientation = OrientationEventListener.ORIENTATION_UNKNOWN;
private ComboPreferences mPreferences;
@@ -964,9 +967,16 @@ public class PhotoModule
return;
}
+ if(mLongShotCaptureCount == mLongShotCaptureCountLimit) {
+ mLongshotActive = false;
+ return;
+ }
+
mUI.doShutterAnimation();
Location loc = getLocationAccordPictureFormat(mParameters.get(KEY_PICTURE_FORMAT));
+
+ mLongShotCaptureCount++;
if (mLongshotSave) {
mCameraDevice.takePicture(mHandler,
new LongshotShutterCallback(),
@@ -1554,6 +1564,9 @@ public class PhotoModule
}
if (mCameraState == LONGSHOT) {
+ mLongShotCaptureCountLimit = SystemProperties.getInt(
+ "persist.camera.longshot.shotnum", 0);
+ mLongShotCaptureCount = 1;
if(mLongshotSave) {
mCameraDevice.takePicture(mHandler,
new LongshotShutterCallback(),