summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2016-11-30 10:40:29 +0100
committerMichael Bestas <mikeioannina@gmail.com>2016-12-23 00:35:55 -0800
commit95b4bc976f57ea41048f208e0276fe841aaf37c7 (patch)
tree6efaf81d7e75e3cb6c82bf36002810801665472b
parentf29da1211f7814a59b1ef648274478125ce23c8d (diff)
downloadandroid_packages_apps_Snap-95b4bc976f57ea41048f208e0276fe841aaf37c7.zip
android_packages_apps_Snap-95b4bc976f57ea41048f208e0276fe841aaf37c7.tar.gz
android_packages_apps_Snap-95b4bc976f57ea41048f208e0276fe841aaf37c7.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 6883a36..aaa7ca7 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2484,6 +2484,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
@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 86cf1d8..ea78bb4 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1239,6 +1239,7 @@ public class VideoModule extends BaseModule<VideoUI> implements
@Override
public void onResumeBeforeSuper() {
mPaused = false;
+ if (mFocusManager == null) initializeFocusManager();
}
@Override