summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2009-05-13 16:49:00 +0800
committerWu-cheng Li <wuchengli@google.com>2009-05-13 17:02:31 +0800
commitd16a06161fe9e10ae8f656bca4d4482b235cd172 (patch)
treeb6fd70945c536556aa98cf017a313ca9e825eee3 /src/com/android
parentdfedc5bad4632e3128af96933883257ea0718d6b (diff)
downloadLegacyCamera-d16a06161fe9e10ae8f656bca4d4482b235cd172.zip
LegacyCamera-d16a06161fe9e10ae8f656bca4d4482b235cd172.tar.gz
LegacyCamera-d16a06161fe9e10ae8f656bca4d4482b235cd172.tar.bz2
Remove messages in onPause. Remove onStop.
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/camera/Camera.java35
1 files changed, 8 insertions, 27 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index a098a04..eaaf10d 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -586,7 +586,7 @@ public class Camera extends Activity implements View.OnClickListener,
/**
* Initiate the capture of an image.
*/
- public void initiate(boolean captureOnly) {
+ public void initiate() {
if (mCameraDevice == null) {
return;
}
@@ -594,7 +594,7 @@ public class Camera extends Activity implements View.OnClickListener,
mCancel = false;
mCapturing = true;
- capture(captureOnly);
+ capture();
}
public Uri getLastCaptureUri() {
@@ -605,7 +605,7 @@ public class Camera extends Activity implements View.OnClickListener,
return mCaptureOnlyBitmap;
}
- private void capture(boolean captureOnly) {
+ private void capture() {
mPreviewing = false;
mCaptureOnlyBitmap = null;
@@ -685,12 +685,7 @@ public class Camera extends Activity implements View.OnClickListener,
mKeepAndRestartPreview = true;
- boolean getContentAction = mIsImageCaptureIntent;
- if (getContentAction) {
- mImageCapture.initiate(true);
- } else {
- mImageCapture.initiate(false);
- }
+ mImageCapture.initiate();
}
private void clearLastBitmap() {
@@ -1103,15 +1098,6 @@ public class Camera extends Activity implements View.OnClickListener,
}
@Override
- public void onStop() {
- keep();
- stopPreview();
- closeCamera();
- mHandler.removeMessages(CLEAR_SCREEN_DELAY);
- super.onStop();
- }
-
- @Override
protected void onPause() {
keep();
@@ -1148,6 +1134,10 @@ public class Camera extends Activity implements View.OnClickListener,
mImageCapture = null;
hidePostCaptureAlert();
+ // Remove the messages in the event queue.
+ mHandler.removeMessages(CLEAR_SCREEN_DELAY);
+ mHandler.removeMessages(RESTART_PREVIEW);
+
super.onPause();
}
@@ -1227,15 +1217,6 @@ public class Camera extends Activity implements View.OnClickListener,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
switch (keyCode) {
- // TODO: change the following two handlers to OSD control.
- case KeyEvent.KEYCODE_DPAD_LEFT:
- adjustBrightness(-1);
- break;
-
- case KeyEvent.KEYCODE_DPAD_RIGHT:
- adjustBrightness(1);
- break;
-
case KeyEvent.KEYCODE_BACK:
if (mStatus == SNAPSHOT_IN_PROGRESS) {
// ignore backs while we're taking a picture