From f38de1f33a6fcf1b7e804617158b506e1ffa4374 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Tue, 21 Jun 2016 11:39:17 -0700 Subject: SnapdragonCamera: Fix the camera setting corruption issue Two instances of camera preference were created and caused the wrong preference instance is referenced when changing the camera2 mode. Due to this, it corrupted the camera setting on the other camera device. To resolve the issue, create single instance of camera preference and re-use it. Change-Id: Ia1a6923a10b83e4c5777fb1318677c1f191942fb CRs-fixed: 1025776 --- src/com/android/camera/WideAnglePanoramaModule.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/com/android/camera/WideAnglePanoramaModule.java') diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index 9a0e9ce7e..3f825dd39 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); @@ -960,7 +964,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()); -- cgit v1.2.3