summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/WideAnglePanoramaModule.java
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-09-30 10:36:49 +0800
committerlikaid <likaid@codeaurora.org>2015-09-30 10:36:49 +0800
commit3d8d6ba90712366ba7a399d635d65486633ba5ab (patch)
tree30ced755bafe8a6309583c1744bb44528c2d2251 /src/com/android/camera/WideAnglePanoramaModule.java
parentbfafad4ed983c9a5332b1e23cace941a29dbb18e (diff)
downloadandroid_packages_apps_Snap-3d8d6ba90712366ba7a399d635d65486633ba5ab.tar.gz
android_packages_apps_Snap-3d8d6ba90712366ba7a399d635d65486633ba5ab.tar.bz2
android_packages_apps_Snap-3d8d6ba90712366ba7a399d635d65486633ba5ab.zip
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
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaModule.java')
-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 26a8cb972..71972f025 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -384,10 +384,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;
@@ -970,7 +974,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;