summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/Camera.java23
-rw-r--r--src/com/android/camera/MenuHelper.java3
2 files changed, 16 insertions, 10 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index ddb6611..cdf8735 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -601,14 +601,25 @@ public class Camera extends Activity implements View.OnClickListener,
mJpegPictureCallbackTime - mRawPictureCallbackTime;
Log.v(TAG, "mRawPictureAndJpegPictureCallbackTime = "
+ mRawPictureAndJpegPictureCallbackTime + "ms");
- mImageCapture.storeImage(jpegData, camera, mLocation);
if (!mIsImageCaptureIntent) {
+ // We want to show the taken picture for a while, so we wait
+ // for at least 1.2 second before restarting the preview.
long delay = 1200 - (
System.currentTimeMillis() - mRawPictureCallbackTime);
- mHandler.sendEmptyMessageDelayed(
- RESTART_PREVIEW, Math.max(delay, 0));
+ if (delay < 0) {
+ restartPreview();
+ } else {
+ mHandler.sendEmptyMessageDelayed(RESTART_PREVIEW, delay);
+ }
}
+ mImageCapture.storeImage(jpegData, camera, mLocation);
+
+ // Calculate this in advance of each shot so we don't add to shutter
+ // latency. It's true that someone else could write to the SD card in
+ // the mean time and fill it, but that could have happened between the
+ // shutter press and saving the JPEG too.
+ calculatePicturesRemaining();
}
}
@@ -1538,12 +1549,6 @@ public class Camera extends Activity implements View.OnClickListener,
showCameraErrorAndFinish();
return;
}
-
- // Calculate this in advance of each shot so we don't add to shutter
- // latency. It's true that someone else could write to the SD card in
- // the mean time and fill it, but that could have happened between the
- // shutter press and saving the JPEG too.
- calculatePicturesRemaining();
}
private void setPreviewDisplay(SurfaceHolder holder) {
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java
index 453d629..0ab7612 100644
--- a/src/com/android/camera/MenuHelper.java
+++ b/src/com/android/camera/MenuHelper.java
@@ -1066,8 +1066,9 @@ public class MenuHelper {
String storageDirectory =
Environment.getExternalStorageDirectory().toString();
StatFs stat = new StatFs(storageDirectory);
+ final int PICTURE_BYTES = 1500000;
float remaining = ((float) stat.getAvailableBlocks()
- * (float) stat.getBlockSize()) / 400000F;
+ * (float) stat.getBlockSize()) / PICTURE_BYTES;
return (int) remaining;
}
} catch (Exception ex) {