summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CameraActivity.java4
-rw-r--r--src/com/android/camera/PhotoModule.java12
-rw-r--r--src/com/android/camera/VideoModule.java13
3 files changed, 19 insertions, 10 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 525288370..15d894fa3 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -2059,6 +2059,8 @@ public class CameraActivity extends Activity
if (mVideoModule == null) {
mVideoModule = new VideoModule();
mVideoModule.init(this, mCameraVideoModuleRootView);
+ } else {
+ mVideoModule.reinit();
}
mCurrentModule = mVideoModule;
mCameraVideoModuleRootView.setVisibility(View.VISIBLE);
@@ -2100,6 +2102,8 @@ public class CameraActivity extends Activity
if (mPhotoModule == null) {
mPhotoModule = new PhotoModule();
mPhotoModule.init(this, mCameraPhotoModuleRootView);
+ } else {
+ mPhotoModule.reinit();
}
mCurrentModule = mPhotoModule;
mCameraPhotoModuleRootView.setVisibility(View.VISIBLE);
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index b7f3d8a48..deab80e01 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -541,6 +541,13 @@ public class PhotoModule
}
}
+ public void reinit() {
+ mPreferences = new ComboPreferences(mActivity);
+ CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
+ mCameraId = getPreferredCameraId(mPreferences);
+ mPreferences.setLocalId(mActivity, mCameraId);
+ CameraSettings.upgradeLocalPreferences(mPreferences.getLocal());
+ }
@Override
public void init(CameraActivity activity, View parent) {
@@ -2380,11 +2387,6 @@ public class PhotoModule
@Override
public void onResumeBeforeSuper() {
mPaused = false;
- mPreferences = new ComboPreferences(mActivity);
- CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
- mCameraId = getPreferredCameraId(mPreferences);
- mPreferences.setLocalId(mActivity, mCameraId);
- CameraSettings.upgradeLocalPreferences(mPreferences.getLocal());
}
private void openCamera() {
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 4ac9bce78..19bbcabd7 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -446,6 +446,14 @@ public class VideoModule implements CameraModule,
}
}
+ public void reinit() {
+ mPreferences = new ComboPreferences(mActivity);
+ CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
+ mCameraId = getPreferredCameraId(mPreferences);
+ mPreferences.setLocalId(mActivity, mCameraId);
+ CameraSettings.upgradeLocalPreferences(mPreferences.getLocal());
+ }
+
@Override
public void init(CameraActivity activity, View root) {
mActivity = activity;
@@ -1142,11 +1150,6 @@ public class VideoModule implements CameraModule,
@Override
public void onResumeBeforeSuper() {
mPaused = false;
- mPreferences = new ComboPreferences(mActivity);
- CameraSettings.upgradeGlobalPreferences(mPreferences.getGlobal(), mActivity);
- mCameraId = getPreferredCameraId(mPreferences);
- mPreferences.setLocalId(mActivity, mCameraId);
- CameraSettings.upgradeLocalPreferences(mPreferences.getLocal());
}
@Override