summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-15 23:22:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-15 23:22:08 -0700
commitac61c19695a619182977fb66d768bf12c131c7e7 (patch)
tree43c3009e5af579026c634d4af6c090f7cd8f64b1 /src/com/android/camera
parentf8c1a126fdd54d32cd8d08d1ef62a64893b9ae03 (diff)
parent05309120f233e2f3a2d6319d0efd996254e86c16 (diff)
downloadLegacyCamera-ac61c19695a619182977fb66d768bf12c131c7e7.zip
LegacyCamera-ac61c19695a619182977fb66d768bf12c131c7e7.tar.gz
LegacyCamera-ac61c19695a619182977fb66d768bf12c131c7e7.tar.bz2
Merge change 4305 into donut
* changes: Fix NPE in zoomIn.
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/Camera.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index a44de8d..f53fab7 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1239,7 +1239,9 @@ public class Camera extends Activity implements View.OnClickListener,
}
private void autoFocus() {
- if (isCameraIdle() && mCameraDevice != null) {
+ // Initiate autofocus only when preview is started and snapshot is not
+ // in progress.
+ if (isCameraIdle() && mPreviewing) {
Log.v(TAG, "Start autofocus.");
mZoomButtons.setVisible(false);
mFocusStartTime = System.currentTimeMillis();
@@ -1325,13 +1327,13 @@ public class Camera extends Activity implements View.OnClickListener,
@Override
public boolean onTouchEvent(MotionEvent event) {
- if (mPausing || !isCameraIdle()) {
- return true;
- }
-
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
- if (mZoomButtons != null) {
+ // Show zoom buttons only when preview is started and snapshot
+ // is not in progress. mZoomButtons may be null if it is not
+ // initialized.
+ if (!mPausing && isCameraIdle() && mPreviewing
+ && mZoomButtons != null) {
mZoomButtons.setVisible(true);
}
return true;