summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2016-02-29 16:58:39 -0800
committerSteve Kondik <steve@cyngn.com>2016-08-21 18:46:32 -0700
commit09b60ae2e1ab8a42b093c5232f36f28c1a3658bb (patch)
tree206ec937c2e268abacd64f8cceabb5fedaae239b
parenta85e9c010d6f5fa66f6dd62f67f796813356464b (diff)
downloadandroid_packages_apps_Snap-09b60ae2e1ab8a42b093c5232f36f28c1a3658bb.zip
android_packages_apps_Snap-09b60ae2e1ab8a42b093c5232f36f28c1a3658bb.tar.gz
android_packages_apps_Snap-09b60ae2e1ab8a42b093c5232f36f28c1a3658bb.tar.bz2
SnapdragonCamera: Fix timing of preference initialization
Initialize preference before making the views visible. Change-Id: Ie3d541c7fcb29ed86e0e9fd52a1a1e4ea870f009 CRs-Fixed: 982842
-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 5252883..15d894f 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 b7f3d8a..deab80e 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 4ac9bce..19bbcab 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