summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2019-11-10 16:16:53 (GMT)
committerRashed Abdel-Tawab <rashedabdeltawab@gmail.com>2019-11-24 23:34:55 (GMT)
commitcdf13feab683c09c43aa1279be4cbe4e3943575e (patch)
tree684efd6680e90918a84eec87fb0b161447a4912e
parent4fbfaff93c9abd0825453c7b91c1528a38bd4564 (diff)
downloadandroid_packages_apps_Snap-lineage-17.0.zip
android_packages_apps_Snap-lineage-17.0.tar.gz
android_packages_apps_Snap-lineage-17.0.tar.bz2
Snap: Handle SDCard-removed caselineage-17.0
* 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 e7d66e7..f92f7b2 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) {
@@ -2033,6 +2035,12 @@ public class CameraActivity extends Activity
}
protected void updateStorageSpaceAndHint() {
+ if (mIsStartup) {
+ if (!SDCard.instance().isWriteable()) {
+ Storage.setSaveSDCard(false);
+ }
+ mIsStartup = false;
+ }
updateStorageSpace();
updateStorageHint(mStorageSpaceBytes);
}