From a11ce3b74e6c5e7983e0769d97e3c7ba75d5b226 Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Mon, 30 Jun 2014 16:31:14 +0800 Subject: Camera2: fix white balance still work when turn on the HDR mode Tested on target : 8916 Tested on Branch : kk Tested on AU \ tip : AU_LINUX_ANDROID_LNX.LA.3.7.1.04.04.03.031.203 Test case Verified : Yes CR Moved to Fix : Yes R notes filled : Yes DC set : Yes LOST approved (if new file \ feature added): Yes Voted on required Trunk : NA App need clear the whitebalance effect when set scene mode not auto, but the value getWhiteBalance still is not auto when change scene mode. So set white balance auto value forcely when scene mode is not auto. CRs-Fixed: 685240 Change-Id: Ib94b9cb1f3cc0c8ef63412ef75d65359ba797f37 --- src/com/android/camera/PhotoModule.java | 8 +++++--- src/com/android/camera/PhotoUI.java | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index ce4a6916e..c3345be04 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1502,9 +1502,7 @@ public class PhotoModule if (!Parameters.SCENE_MODE_AUTO.equals(mSceneMode) || CameraSettings.isSlowShutterEnabled(mParameters)) { String flashMode = mParameters.getFlashMode(); - String whiteBalance = mPreferences.getString( - CameraSettings.KEY_WHITE_BALANCE, - mActivity.getString(R.string.pref_camera_whitebalance_default)); + String whiteBalance = Parameters.WHITE_BALANCE_AUTO; String focusMode = mFocusManager.getFocusMode(); overrideCameraSettings(flashMode, whiteBalance, focusMode, @@ -2820,6 +2818,10 @@ public class PhotoModule } else { mParameters.setFlashMode(Parameters.FLASH_MODE_AUTO); } + if (CameraUtil.isSupported(Parameters.WHITE_BALANCE_AUTO, + mParameters.getSupportedWhiteBalance())) { + mParameters.setWhiteBalance(Parameters.WHITE_BALANCE_AUTO); + } } if (mContinuousFocusSupported && ApiHelper.HAS_AUTO_FOCUS_MOVE_CALLBACK) { diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 8cc1cacc7..3a1e7c0bf 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -620,7 +620,10 @@ public class PhotoUI implements PieListener, CameraSettings.readExposure(prefs)); mOnScreenIndicators.updateFlashOnScreenIndicator(params.getFlashMode()); int wbIndex = -1; - String wb = params.getWhiteBalance(); + String wb = Camera.Parameters.WHITE_BALANCE_AUTO; + if (Camera.Parameters.SCENE_MODE_AUTO.equals(params.getSceneMode())) { + wb = params.getWhiteBalance(); + } ListPreference pref = group.findPreference(CameraSettings.KEY_WHITE_BALANCE); if (pref != null) { wbIndex = pref.findIndexOfValue(wb); -- cgit v1.2.3