summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2009-09-29 14:27:59 -0700
committerChih-Chung Chang <chihchung@google.com>2009-09-29 14:52:29 -0700
commit4c9266ef8f43c6b057b6f560645475272c66ff8a (patch)
tree6585436894ca9cf8fde436844074b9ad22c1a7c3 /src/com/android/camera
parent121c88051d51739cab5c5ed968e1bf2c97f35a01 (diff)
downloadLegacyCamera-4c9266ef8f43c6b057b6f560645475272c66ff8a.zip
LegacyCamera-4c9266ef8f43c6b057b6f560645475272c66ff8a.tar.gz
LegacyCamera-4c9266ef8f43c6b057b6f560645475272c66ff8a.tar.bz2
Fix 2153860: VideoCamera app have to set scene mode to auto
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/CameraHolder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraHolder.java b/src/com/android/camera/CameraHolder.java
index 94fd322..7fd2b4e 100644
--- a/src/com/android/camera/CameraHolder.java
+++ b/src/com/android/camera/CameraHolder.java
@@ -18,6 +18,7 @@ package com.android.camera;
import static com.android.camera.Util.Assert;
+import android.hardware.Camera.Parameters;
import android.os.Build;
import android.os.Handler;
import android.os.HandlerThread;
@@ -45,6 +46,12 @@ public class CameraHolder {
private final Handler mHandler;
private int mUsers = 0; // number of open() - number of release()
+ // We store the camera parameters when we actually open the device,
+ // so we can restore them in the subsequent open() requests by the user.
+ // This prevents the parameters set by the Camera activity used by
+ // the VideoCamera activity inadvertently.
+ private Parameters mParameters;
+
// Use a singleton.
private static CameraHolder sHolder;
public static synchronized CameraHolder instance() {
@@ -86,6 +93,7 @@ public class CameraHolder {
Log.e(TAG, "fail to connect Camera", e);
throw new CameraHardwareException(e);
}
+ mParameters = mCameraDevice.getParameters();
} else {
try {
mCameraDevice.reconnect();
@@ -93,6 +101,7 @@ public class CameraHolder {
Log.e(TAG, "reconnect failed.");
throw new CameraHardwareException(e);
}
+ mCameraDevice.setParameters(mParameters);
}
++mUsers;
mHandler.removeMessages(RELEASE_CAMERA);