summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-03-25 13:02:27 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-27 00:41:42 +0100
commitf7a65f9be424a0f2de57556d69f97cc171889a67 (patch)
tree8c5e2007d5c22405bf7f4d826fff49a58e83986f
parent272fd0070cfe4c947e7c842a824f604ca95652b9 (diff)
downloadandroid_packages_apps_Snap-f7a65f9be424a0f2de57556d69f97cc171889a67.zip
android_packages_apps_Snap-f7a65f9be424a0f2de57556d69f97cc171889a67.tar.gz
android_packages_apps_Snap-f7a65f9be424a0f2de57556d69f97cc171889a67.tar.bz2
Protect against multiple shutter callbacks per frame in longshot mode.
Some devices send multiple shutter callbacks for one captured frame in longshot mode. As this causes mismatch between the calculated number of captured frames and the calculated number of JPEGs received for those, which in turn leads to longshot mode never being ended properly, protect against that scenario by discarding all but the first callback. Change-Id: I0c3a270f664a0cd16354fb0a13c5941a52001650
-rw-r--r--src/com/android/camera/PhotoModule.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e41eda4..5777944 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1100,6 +1100,11 @@ public class PhotoModule
private final class LongshotShutterCallback
implements CameraShutterCallback {
+ private int mExpectedLongshotSnapNum;
+
+ public LongshotShutterCallback() {
+ mExpectedLongshotSnapNum = mLongshotSnapNum;
+ }
@Override
public void onShutter(CameraProxy camera) {
@@ -1107,6 +1112,9 @@ public class PhotoModule
mShutterLag = mShutterCallbackTime - mCaptureStartTime;
Log.e(TAG, "[KPI Perf] PROFILE_SHUTTER_LAG mShutterLag = " + mShutterLag + "ms");
synchronized(mCameraDevice) {
+ if (mExpectedLongshotSnapNum != mLongshotSnapNum) {
+ return;
+ }
if (++mLongshotSnapNum >= mLongShotMaxSnap &&
(mLongShotMaxSnap != -1)) {