summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-11-30 10:40:29 +0100
committerBruno Martins <bgcngm@gmail.com>2018-11-20 12:31:36 +0000
commit863e2e42e09555cac274b9b95022b4784a34bca9 (patch)
tree8baca0c69aee9795aa4e43bd2de9f67377a35e00 /src/com
parentdebdf5c9c067184b5efa51832ff05b898500a2b5 (diff)
downloadandroid_packages_apps_Snap-863e2e42e09555cac274b9b95022b4784a34bca9.tar.gz
android_packages_apps_Snap-863e2e42e09555cac274b9b95022b4784a34bca9.tar.bz2
android_packages_apps_Snap-863e2e42e09555cac274b9b95022b4784a34bca9.zip
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
Diffstat (limited to 'src/com')
-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 58b6d79de..7f0a1a704 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2554,6 +2554,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 1d34990bd..0fdb858a1 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1225,6 +1225,7 @@ public class VideoModule implements CameraModule,
@Override
public void onResumeBeforeSuper() {
mPaused = false;
+ if (mFocusManager == null) initializeFocusManager();
}
@Override