OSDN Git Service

Fix WB indicator override
authorMichael Kolb <kolby@google.com>
Mon, 24 Jun 2013 20:22:52 +0000 (13:22 -0700)
committerAlan Newberger <alann@google.com>
Tue, 3 Dec 2013 18:20:52 +0000 (10:20 -0800)
Patching into Carlsbad from Bryce.

  Bug: 9372794

Change-Id: I4f23f05ca1acaef84a24034237e82001aac09f78

src/com/android/camera/PhotoUI.java

index 8308e15..5018c16 100644 (file)
@@ -526,12 +526,15 @@ public class PhotoUI implements PieListener,
         mOnScreenIndicators.updateExposureOnScreenIndicator(params,
                 CameraSettings.readExposure(prefs));
         mOnScreenIndicators.updateFlashOnScreenIndicator(params.getFlashMode());
-        int wbIndex = 2;
+        int wbIndex = -1;
+        String wb = params.getWhiteBalance();
         ListPreference pref = group.findPreference(CameraSettings.KEY_WHITE_BALANCE);
         if (pref != null) {
-            wbIndex = pref.getCurrentIndex();
+            wbIndex = pref.findIndexOfValue(wb);
         }
-        mOnScreenIndicators.updateWBIndicator(wbIndex);
+        // make sure the correct value was found
+        // otherwise use auto index
+        mOnScreenIndicators.updateWBIndicator(wbIndex < 0 ? 2 : wbIndex);
         boolean location = RecordLocationPreference.get(
                 prefs, mActivity.getContentResolver());
         mOnScreenIndicators.updateLocationIndicator(location);