summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-03-03 11:54:03 +0800
committerSteve Kondik <steve@cyngn.com>2016-07-30 05:05:25 -0700
commit1fddfd09e3215be615d9402bd6e0f98c92414f44 (patch)
treebcef65ff2f6c8026d4ab2129f5e4a508b1f11c75
parent0bce7c994dce9044667adfbddebb59ab6c88f70c (diff)
downloadandroid_packages_apps_Snap-1fddfd09e3215be615d9402bd6e0f98c92414f44.zip
android_packages_apps_Snap-1fddfd09e3215be615d9402bd6e0f98c92414f44.tar.gz
android_packages_apps_Snap-1fddfd09e3215be615d9402bd6e0f98c92414f44.tar.bz2
SnapdragonCamera: fix camera FC when internal storage isn't enough
The menu may be not initialized when switch save path in PhotoModule. Check the menu initialized state before switch save path. Change-Id: Ibdc8d5510924b45f5abfc13f4d70dcf9620c8b7d CRs-Fixed: 801619
-rw-r--r--src/com/android/camera/PhotoModule.java8
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e03e809..b7e2f8e 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -817,7 +817,13 @@ public class PhotoModule
@Override
public void onSwitchSavePath() {
- mUI.setPreference(CameraSettings.KEY_CAMERA_SAVEPATH, "1");
+ if (mUI.mMenuInitialized) {
+ mUI.setPreference(CameraSettings.KEY_CAMERA_SAVEPATH, "1");
+ } else {
+ mPreferences.edit()
+ .putString(CameraSettings.KEY_CAMERA_SAVEPATH, "1")
+ .apply();
+ }
RotateTextToast.makeText(mActivity, R.string.on_switch_save_path_to_sdcard,
Toast.LENGTH_SHORT).show();
}
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 0f1396a..7b92397 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -955,7 +955,7 @@ public class WideAnglePanoramaModule
@Override
public void onSwitchSavePath() {
- mPreferences.edit().putString(CameraSettings.KEY_CAMERA_SAVEPATH, "1").apply();
+ mPreferences.getGlobal().edit().putString(CameraSettings.KEY_CAMERA_SAVEPATH, "1").apply();
RotateTextToast.makeText(mActivity, R.string.on_switch_save_path_to_sdcard,
Toast.LENGTH_SHORT).show();
}