From 94aff93adaaef84da82dfe46ac92a91c3b3fe2c8 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan
Date: Wed, 25 Dec 2013 13:50:51 +0700
Subject: Camera2: Preview needs to be stopped when changing resolution
This was done in startPreview as a hack, but was removed in
f729b85e12cfa2674048d8cce2f724014b8fc910. Specifically add it
back when the resolution is changed.
Change-Id: I306abd788bafdff4e6fba7eec4e6ff05bb3cc47c
---
src/com/android/camera/PhotoModule.java | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 89dd34689..616b629f9 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2593,6 +2593,12 @@ public class PhotoModule
mErrorCallback.setActivity(mActivity);
mCameraDevice.setErrorCallback(mErrorCallback);
+ // Preview needs to be stopped when changing resolution
+ if (mRestartPreview && mCameraState != PREVIEW_STOPPED && mCameraState != INIT) {
+ stopPreview();
+ mRestartPreview = false;
+ }
+
if (mFocusManager == null) initializeFocusManager();
if (!mSnapshotOnIdle) {
--
cgit v1.2.3