summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-11-30 10:40:29 +0100
committerArne Coucheron <arco68@gmail.com>2018-01-26 01:09:21 +0100
commitcb1704cf036e12d972f1f9a2c37adb9113f85067 (patch)
tree9c1db10752376c1b391d9226d0a9a3f8ec0e18b3
parent90c68408a266dacc69ab0b062623d77b95234b15 (diff)
downloadandroid_packages_apps_Snap-cb1704cf036e12d972f1f9a2c37adb9113f85067.zip
android_packages_apps_Snap-cb1704cf036e12d972f1f9a2c37adb9113f85067.tar.gz
android_packages_apps_Snap-cb1704cf036e12d972f1f9a2c37adb9113f85067.tar.bz2
Initialize focus manager in onResume().
Since commit 87b4a40d588a7ae8a61cb353c4cff8df37f7b483 moved camera initialization (and focus manager initialization with it) to a background thread, the focus manager initialization now races against the onPreviewRectChanged() call triggered by SurfaceView initialization in the main thread, potentially leaving the focus manager in an uninitialized state that prevented taking pictures. Change-Id: I8cf650d6a67768acd131b3cddad175ed198e0838
-rw-r--r--src/com/android/camera/PhotoModule.java1
-rw-r--r--src/com/android/camera/VideoModule.java1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 9b1e22d..18a315f 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2691,6 +2691,7 @@ public class PhotoModule
@Override
public void onResumeBeforeSuper() {
mPaused = false;
+ if (mFocusManager == null) initializeFocusManager();
}
private void openCamera() {
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 8d438ee..5487bcf 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1227,6 +1227,7 @@ public class VideoModule implements CameraModule,
@Override
public void onResumeBeforeSuper() {
mPaused = false;
+ if (mFocusManager == null) initializeFocusManager();
}
@Override