From a17322a1caa2520f96f167a3d779abcbf7e6d641 Mon Sep 17 00:00:00 2001 From: Byunghun Jeon Date: Wed, 8 Jun 2016 10:38:11 -0700 Subject: SnapdragonCamera: Fix picture saved when no sdcard inserted Fix picture being saved when save path is set to sdcard but no sdcard present. In this case, picture should not be saved Check this before taking a picture Change-Id: I7313d67f2f5c489c2db230b8ae165b89ecfbc4c6 CRs-Fixed: 1025784 --- src/com/android/camera/CaptureModule.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index c053655f5..36f787be4 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1762,6 +1762,12 @@ public class CaptureModule implements CameraModule, PhotoController, @Override public void onShutterButtonClick() { + if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) { + Log.i(TAG, "Not enough space or storage not ready. remaining=" + + mActivity.getStorageSpaceBytes()); + return; + } + String timer = mSettingsManager.getValue(SettingsManager.KEY_TIMER); int seconds = Integer.parseInt(timer); -- cgit v1.2.3