diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-02-28 18:30:22 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-02-28 18:38:43 +0800 |
commit | 4a70e66b58207703f8a705548efcd5353106e452 (patch) | |
tree | caab44fe72261abb2c313d704920918beb7775e4 | |
parent | 842b44f24ab621122183a149e20a852e5d8e0200 (diff) | |
download | LegacyCamera-4a70e66b58207703f8a705548efcd5353106e452.zip LegacyCamera-4a70e66b58207703f8a705548efcd5353106e452.tar.gz LegacyCamera-4a70e66b58207703f8a705548efcd5353106e452.tar.bz2 |
Fix settings are not retained when we toggle from still & video mode.
"Restore defaults" clears the preferences of both cameras. Previously
the preferences variable was incorrectly pointed to the preferences of
front camera after restore defaults. After that, any camera setting change
were written to the front camera even if the current camera is back camera.
bug:3417946
Change-Id: I675ccd20bfdf9d44e53e90238c410228b55ee376
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/ComboPreferences.java | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java index 7cda110..86dacd0 100644 --- a/src/com/android/camera/CameraSettings.java +++ b/src/com/android/camera/CameraSettings.java @@ -399,6 +399,10 @@ public class CameraSettings { editor.apply(); } + // Switch back to the preferences of the current camera. Otherwise, + // we may write the preference to wrong camera later. + preferences.setLocalId(context, currentCameraId); + upgradeGlobalPreferences(preferences.getGlobal()); upgradeLocalPreferences(preferences.getLocal()); diff --git a/src/com/android/camera/ComboPreferences.java b/src/com/android/camera/ComboPreferences.java index f613d76..b8705cc 100644 --- a/src/com/android/camera/ComboPreferences.java +++ b/src/com/android/camera/ComboPreferences.java @@ -49,6 +49,8 @@ public class ComboPreferences implements SharedPreferences, OnSharedPreferenceCh } } + // Sets the camera id and reads its preferences. Each camera has its own + // preferences. public void setLocalId(Context context, int cameraId) { String prefName = context.getPackageName() + "_preferences_" + cameraId; if (mPrefLocal != null) { |