diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-05-05 01:18:49 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-05-05 01:18:49 -0700 |
commit | eb035ca7ff76f01d053724bb065bc6e6225d5743 (patch) | |
tree | 617bcebf3722a65ec4b6b1a14b4cc3a68cc55d53 /src/com | |
parent | 4bc162998337775368584dcdf4165eff004c35e1 (diff) | |
parent | 2c8e62861dba447a6f4ff698593401e9c1db749c (diff) | |
download | android_packages_apps_Snap-eb035ca7ff76f01d053724bb065bc6e6225d5743.tar.gz android_packages_apps_Snap-eb035ca7ff76f01d053724bb065bc6e6225d5743.tar.bz2 android_packages_apps_Snap-eb035ca7ff76f01d053724bb065bc6e6225d5743.zip |
Merge "SnapdragonCamera: Fix camera parameters concurrent modification."
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 59 |
1 files changed, 36 insertions, 23 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index cf1de18f3..4781efeba 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1522,28 +1522,31 @@ public class PhotoModule // Set rotation and gps data. int orientation = mOrientation; mJpegRotation = CameraUtil.getJpegRotation(mCameraId, orientation); - mParameters.setRotation(mJpegRotation); String pictureFormat = mParameters.get(KEY_PICTURE_FORMAT); Location loc = getLocationAccordPictureFormat(pictureFormat); - CameraUtil.setGpsParameters(mParameters, loc); - if (mRefocus) { - mParameters.set(CameraSettings.KEY_QC_LEGACY_BURST, - CameraSettings.KEY_QC_RE_FOCUS_COUNT); - } else { - mParameters.remove(CameraSettings.KEY_QC_LEGACY_BURST); - } + synchronized (mCameraDevice) { + mParameters.setRotation(mJpegRotation); + CameraUtil.setGpsParameters(mParameters, loc); - // Unlock AE&AWB, if they continue - // to be locked during snapshot, then - // side effects could be triggered w.r.t. - // flash. - mFocusManager.setAeAwbLock(false); - setAutoExposureLockIfSupported(); - setAutoWhiteBalanceLockIfSupported(); + if (mRefocus) { + mParameters.set(CameraSettings.KEY_QC_LEGACY_BURST, + CameraSettings.KEY_QC_RE_FOCUS_COUNT); + } else { + mParameters.remove(CameraSettings.KEY_QC_LEGACY_BURST); + } - mCameraDevice.setParameters(mParameters); - mParameters = mCameraDevice.getParameters(); + // Unlock AE&AWB, if they continue + // to be locked during snapshot, then + // side effects could be triggered w.r.t. + // flash. + mFocusManager.setAeAwbLock(false); + setAutoExposureLockIfSupported(); + setAutoWhiteBalanceLockIfSupported(); + + mCameraDevice.setParameters(mParameters); + mParameters = mCameraDevice.getParameters(); + } mBurstSnapNum = mParameters.getInt("num-snaps-per-shutter"); mReceivedSnapNum = 0; @@ -1887,8 +1890,10 @@ public class PhotoModule if (oldOrientation != mOrientation) { if (mParameters != null && mCameraDevice != null && mCameraState == IDLE) { Log.v(TAG, "onOrientationChanged, update parameters"); - setFlipValue(); - mCameraDevice.setParameters(mParameters); + synchronized (mCameraDevice) { + setFlipValue(); + mCameraDevice.setParameters(mParameters); + } } mUI.setOrientation(mOrientation, true); if (mGraphView != null) { @@ -4288,10 +4293,12 @@ public class PhotoModule mZoomValue = index; if (mParameters == null || mCameraDevice == null) return index; // Set zoom parameters asynchronously - mParameters.setZoom(mZoomValue); - mCameraDevice.setParameters(mParameters); - Parameters p = mCameraDevice.getParameters(); - if (p != null) return p.getZoom(); + synchronized (mCameraDevice) { + mParameters.setZoom(mZoomValue); + mCameraDevice.setParameters(mParameters); + Parameters p = mCameraDevice.getParameters(); + if (p != null) return p.getZoom(); + } return index; } @@ -4385,6 +4392,12 @@ public class PhotoModule @Override public void onMakeupLevel(String key, String value) { + synchronized (mCameraDevice) { + onMakeupLevelSync(key, value); + } + } + + public void onMakeupLevelSync(String key, String value) { Log.d(TAG, "PhotoModule.onMakeupLevel(): key is " + key + ", value is " + value); if(TextUtils.isEmpty(value)) { |