summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2010-01-22 16:52:31 -0800
committerOwen Lin <owenlin@google.com>2010-01-25 10:37:05 -0800
commit8791695ba110ad0b088d2e8b3b0127c0042e1865 (patch)
treeeaff47288dd80e9f00b7ca57e210ed5559ded898 /src
parent73e782de608cbe2ddffd75c055009ff2e208f78b (diff)
downloadLegacyCamera-8791695ba110ad0b088d2e8b3b0127c0042e1865.zip
LegacyCamera-8791695ba110ad0b088d2e8b3b0127c0042e1865.tar.gz
LegacyCamera-8791695ba110ad0b088d2e8b3b0127c0042e1865.tar.bz2
Add quick capture settings for Camera application.
Change-Id: Ic4ca9f9e1802559c0d6604616555a94cdee1378b Bug: 2259528
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java13
-rw-r--r--src/com/android/camera/CameraSettings.java5
2 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 92389b7..a1a99af 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -221,6 +221,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
private final Handler mHandler = new MainHandler();
private OnScreenSettings mSettings;
+ private boolean mQuickCapture;
/**
* This Handler is used to post message back onto the main thread of the
@@ -659,7 +660,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
// 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 - mPictureDisplayedToJpegCallbackTime;
- if (delay < 0) {
+ if (delay < 0 || mQuickCapture) {
restartPreview();
} else {
mHandler.sendEmptyMessageDelayed(RESTART_PREVIEW, delay);
@@ -938,6 +939,7 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
CameraSettings.upgradePreferences(mPreferences);
+ mQuickCapture = getQuickCaptureSettings();
/*
* To reduce startup time, we start the preview in another thread.
@@ -2144,6 +2146,8 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
} else {
stopReceivingLocationUpdates();
}
+ } else if (CameraSettings.KEY_QUICK_CAPTURE.equals(key)) {
+ mQuickCapture = getQuickCaptureSettings();
} else {
// All preferences except RECORD_LOCATION are camera parameters.
// Call setCameraParameters to take effect now.
@@ -2151,6 +2155,13 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
}
}
+ private boolean getQuickCaptureSettings() {
+ String value = mPreferences.getString(
+ CameraSettings.KEY_QUICK_CAPTURE,
+ getString(R.string.pref_camera_quickcapture_default));
+ return CameraSettings.QUICK_CAPTURE_ON.equals(value);
+ }
+
@Override
public void onUserInteraction() {
super.onUserInteraction();
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index fd5cfc6..db82a75 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -51,6 +51,11 @@ public class CameraSettings {
public static final String KEY_WHITE_BALANCE =
"pref_camera_whitebalance_key";
public static final String KEY_SCENE_MODE = "pref_camera_scenemode_key";
+ public static final String KEY_QUICK_CAPTURE =
+ "pref_camera_quickcapture_key";
+
+ public static final String QUICK_CAPTURE_ON = "on";
+ public static final String QUICK_CAPTURE_OFF = "off";
public static final int CURRENT_VERSION = 3;