summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaxwen <max.weninger@gmail.com>2016-05-25 21:52:46 +0200
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 22:18:23 +0200
commitd75ba683840cc1c5bc8df8ae1cbd3a6911b70e32 (patch)
treebe934f4642922eae628c88358629b23679b83a62
parent8dc08285fa22c1deb761b6ea48dd82823d9271a7 (diff)
downloadandroid_packages_apps_Snap-d75ba683840cc1c5bc8df8ae1cbd3a6911b70e32.zip
android_packages_apps_Snap-d75ba683840cc1c5bc8df8ae1cbd3a6911b70e32.tar.gz
android_packages_apps_Snap-d75ba683840cc1c5bc8df8ae1cbd3a6911b70e32.tar.bz2
Snap: Remove storage menu if no external storage available
Change-Id: I9807c7f9303f17eb971ff1a82fbd35dfbdbfa529 Signed-off-by: Zdrowy Gosciu <ZdrowyGosciu+GITHUB@gmail.com>
-rw-r--r--src/com/android/camera/CameraSettings.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 29c5530..24ce888 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -1003,6 +1003,7 @@ public class CameraSettings {
ListPreference seeMoreMode = group.findPreference(KEY_SEE_MORE);
ListPreference videoEncoder = group.findPreference(KEY_VIDEO_ENCODER);
ListPreference noiseReductionMode = group.findPreference(KEY_NOISE_REDUCTION);
+ ListPreference savePath = group.findPreference(KEY_CAMERA_SAVEPATH);
// Since the screen could be loaded from different resources, we need
// to check if the preference is available here
@@ -1127,7 +1128,7 @@ public class CameraSettings {
final String CAMERA_SAVEPATH_SDCARD = "1";
final int CAMERA_SAVEPATH_SDCARD_IDX = 1;
final int CAMERA_SAVEPATH_PHONE_IDX = 0;
- ListPreference savePath = group.findPreference(KEY_CAMERA_SAVEPATH);
+
SharedPreferences pref = group.getSharedPreferences();
String savePathValue = null;
if (pref != null) {
@@ -1143,7 +1144,13 @@ public class CameraSettings {
Log.d(TAG, "set Phone as save path when sdCard is unavailable.");
savePath.setValueIndex(CAMERA_SAVEPATH_PHONE_IDX);
}
- }
+ }
+ }
+ if (savePath != null) {
+ Log.d(TAG, "check storage menu " + SDCard.instance().isWriteable());
+ if (!SDCard.instance().isWriteable()) {
+ removePreference(group, savePath.getKey());
+ }
}
qcomInitPreferences(group);