summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorChih-yu Huang <akahuang@google.com>2011-09-23 17:32:09 +0800
committerChih-yu Huang <akahuang@google.com>2011-09-23 17:55:06 +0800
commitfe45771b64882d2c025e09cb5937772fa47fb345 (patch)
tree9a4b8642ec50f27a68a4e713f2ad4869ddba5a63 /src/com
parentdd28e1cc00373c02adf88dff878dbbe5d8be9e59 (diff)
downloadLegacyCamera-fe45771b64882d2c025e09cb5937772fa47fb345.zip
LegacyCamera-fe45771b64882d2c025e09cb5937772fa47fb345.tar.gz
LegacyCamera-fe45771b64882d2c025e09cb5937772fa47fb345.tar.bz2
Clear zoom listener and error callback when leaving.
bug:5336037 Change-Id: Ib1ffb7694625d63161e2cc52a7d755614d4b63bb
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/Camera.java1
-rw-r--r--src/com/android/camera/VideoCamera.java4
2 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 970d98e..982f235 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1492,6 +1492,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
CameraHolder.instance().release();
mCameraDevice.setZoomChangeListener(null);
mCameraDevice.setFaceDetectionListener(null);
+ mCameraDevice.setErrorCallback(null);
mCameraDevice = null;
mCameraState = PREVIEW_STOPPED;
mFocusManager.onCameraReleased();
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 070363b..3e2b38d 100644
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -915,6 +915,8 @@ public class VideoCamera extends ActivityBase
}
mEffectType = EffectsRecorder.EFFECT_NONE;
CameraHolder.instance().release();
+ mCameraDevice.setZoomChangeListener(null);
+ mCameraDevice.setErrorCallback(null);
mCameraDevice = null;
mPreviewing = false;
mSnapshotInProgress = false;
@@ -2115,7 +2117,7 @@ public class VideoCamera extends ActivityBase
mZoomControl.setZoomMax(mZoomMax);
mZoomControl.setZoomIndex(mParameters.getZoom());
mZoomControl.setSmoothZoomSupported(mSmoothZoomSupported);
- mZoomControl.setOnZoomChangeListener(new ZoomChangeListener() );
+ mZoomControl.setOnZoomChangeListener(new ZoomChangeListener());
mCameraDevice.setZoomChangeListener(mZoomListener);
}