summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/PhotoModule.java11
-rw-r--r--src/com/android/camera/SettingsManager.java5
-rw-r--r--src/com/android/camera/VideoModule.java12
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java12
4 files changed, 33 insertions, 7 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index deab80e..f8e5981 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -542,7 +542,10 @@ public class PhotoModule
}
public void reinit() {
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
mCameraId = getPreferredCameraId(mPreferences);
mPreferences.setLocalId(mActivity, mCameraId);
@@ -553,7 +556,11 @@ public class PhotoModule
public void init(CameraActivity activity, View parent) {
mActivity = activity;
mRootView = parent;
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
+
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), activity);
mCameraId = getPreferredCameraId(mPreferences);
mContentResolver = mActivity.getContentResolver();
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index cc75232..bd9322b 100644
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -104,7 +104,10 @@ public class SettingsManager implements ListMenu.SettingsListener {
mListeners = new ArrayList<>();
mCharacteristics = new ArrayList<>();
mContext = context;
- mPreferences = new ComboPreferences(mContext);
+ mPreferences = ComboPreferences.get(mContext);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mContext);
+ }
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mContext);
CameraManager manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 19bbcab..cb0fa95 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -447,7 +447,11 @@ public class VideoModule implements CameraModule,
}
public void reinit() {
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
+
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
mCameraId = getPreferredCameraId(mPreferences);
mPreferences.setLocalId(mActivity, mCameraId);
@@ -458,7 +462,11 @@ public class VideoModule implements CameraModule,
public void init(CameraActivity activity, View root) {
mActivity = activity;
mUI = new VideoUI(activity, this, root);
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
+
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), activity);
mCameraId = getPreferredCameraId(mPreferences);
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 8e28f81..1b0ba8e 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -301,7 +301,11 @@ public class WideAnglePanoramaModule
mDialogPanoramaFailedString = appRes.getString(R.string.pano_dialog_panorama_failed);
mDialogWaitingPreviousString = appRes.getString(R.string.pano_dialog_waiting_previous);
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
+
mPreferences.setLocalId(mActivity, getPreferredCameraId(mPreferences));
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), activity);
mLocationManager = new LocationManager(mActivity, null);
@@ -985,7 +989,11 @@ public class WideAnglePanoramaModule
@Override
public void onResumeBeforeSuper() {
mPaused = false;
- mPreferences = new ComboPreferences(mActivity);
+ mPreferences = ComboPreferences.get(mActivity);
+ if (mPreferences == null) {
+ mPreferences = new ComboPreferences(mActivity);
+ }
+
CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
mPreferences.setLocalId(mActivity, getPreferredCameraId(mPreferences));
CameraSettings.upgradeLocalPreferences(mPreferences.getLocal());