summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2019-11-10 17:16:53 +0100
committerMichael W <baddaemon87@gmail.com>2019-11-10 18:02:52 +0100
commitd8b746143cd497ac25ad8ead3dc76c1af735ffcb (patch)
treeb231e2e2f6206ca524f86cbe89bec45a69d9c784
parent5ef1d7f911e122f3154f814f3005ecafe450b990 (diff)
downloadandroid_packages_apps_Snap-d8b746143cd497ac25ad8ead3dc76c1af735ffcb.tar.gz
android_packages_apps_Snap-d8b746143cd497ac25ad8ead3dc76c1af735ffcb.tar.bz2
android_packages_apps_Snap-d8b746143cd497ac25ad8ead3dc76c1af735ffcb.zip
Snap: Handle SDCard-removed case
* When the storage path has been set to SDCard but the card has been removed, there is currently no way to alter the setting and to get your cam to work properly again * Check the writeable-state of the sdcard on startup and fall back to using the internal storage in that case * The startup-flag is used to keep the current behaviour with removed SDcards while cam is still active * Fixes: https://gitlab.com/LineageOS/issues/android/issues/1376 Change-Id: Ib408883a6810693c93488f8a02fe061c56932d1d
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 2933ed4e5..31edc9a5a 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -280,6 +280,8 @@ public class CameraActivity extends Activity
private WakeLock mWakeLock;
private static final int REFOCUS_ACTIVITY_CODE = 1;
+ private boolean mIsStartup = true;
+
private class MyOrientationEventListener
extends OrientationEventListener {
public MyOrientationEventListener(Context context) {
@@ -2017,6 +2019,12 @@ public class CameraActivity extends Activity
}
protected void updateStorageSpaceAndHint() {
+ if (mIsStartup) {
+ if (!SDCard.instance().isWriteable()) {
+ Storage.setSaveSDCard(false);
+ }
+ mIsStartup = false;
+ }
updateStorageSpace();
updateStorageHint(mStorageSpaceBytes);
}