summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-09-30 10:36:49 +0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-16 15:44:53 +0200
commit45f5ede011e3ebdbfa644c2fe4bf93e41f653192 (patch)
treef75911bec992460dfa78c91955958da09e1e15fd
parente2f694ecf5a08fea6f38c4acb29265ec98066210 (diff)
downloadandroid_packages_apps_Snap-45f5ede011e3ebdbfa644c2fe4bf93e41f653192.zip
android_packages_apps_Snap-45f5ede011e3ebdbfa644c2fe4bf93e41f653192.tar.gz
android_packages_apps_Snap-45f5ede011e3ebdbfa644c2fe4bf93e41f653192.tar.bz2
SnapdragonCamera: Fix to make camera display normally
Camera params is initialized twice when power on screen which cause this bug happen. Add judgement to make Camera params only be initialized once. CRs-Fixed: 914993 Change-Id: I825afe1e8fa9cda0d971c6f9bb4fe5677e06d809
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 06e9710..e8ef589 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -387,10 +387,14 @@ public class WideAnglePanoramaModule
// This is also forward compatible if we have a new facing other than
// back or front in the future.
if (cameraId == -1) cameraId = 0;
- mCameraDevice = CameraUtil.openCamera(mActivity, cameraId,
- mMainHandler, mActivity.getCameraOpenErrorCallback());
+
+ // If mCameraDevice has already exist,there is no need to obtain again
if (mCameraDevice == null) {
- return false;
+ mCameraDevice = CameraUtil.openCamera(mActivity, cameraId,
+ mMainHandler, mActivity.getCameraOpenErrorCallback());
+ if (mCameraDevice == null) {
+ return false;
+ }
}
mCameraOrientation = CameraUtil.getCameraOrientation(cameraId);
if (cameraId == CameraHolder.instance().getFrontCameraId()) mUsingFrontCamera = true;
@@ -974,7 +978,9 @@ public class WideAnglePanoramaModule
} else {
// Camera must be initialized before MosaicFrameProcessor is
// initialized. The preview size has to be decided by camera device.
- initMosaicFrameProcessorIfNeeded();
+ if (! mMosaicFrameProcessorInitialized) {
+ initMosaicFrameProcessorIfNeeded();
+ }
Point size = mUI.getPreviewAreaSize();
mPreviewUIWidth = size.x;
mPreviewUIHeight = size.y;