diff options
author | Wu-cheng Li <wuchengli@google.com> | 2009-06-02 15:46:20 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2009-06-02 16:24:38 +0800 |
commit | fbdbae6005e1720f2108d9bb345196cb87b22572 (patch) | |
tree | 9842b4f6cc1b56c120168e54e0a766cf8e191cca /src | |
parent | 6d1226eeb40b7c55f6f49c7254b0dd3b7e656ef0 (diff) | |
download | LegacyCamera-fbdbae6005e1720f2108d9bb345196cb87b22572.zip LegacyCamera-fbdbae6005e1720f2108d9bb345196cb87b22572.tar.gz LegacyCamera-fbdbae6005e1720f2108d9bb345196cb87b22572.tar.bz2 |
Lock camera before releasing it. Skip keys after pausing.
Fix 1715862, 1882912, 1890705, and 1889929.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 751015b..a51a7ac 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -531,6 +531,8 @@ public class VideoCamera extends Activity implements View.OnClickListener, Log.d(TAG, "already stopped."); return; } + // If we don't lock the camera, release() will fail. + mCameraDevice.lock(); mCameraDevice.release(); mCameraDevice = null; mPreviewing = false; @@ -546,6 +548,8 @@ public class VideoCamera extends Activity implements View.OnClickListener, protected void onPause() { super.onPause(); + mPausing = true; + // This is similar to what mShutterButton.performClick() does, // but not quite the same. if (mMediaRecorderRecording) { @@ -557,8 +561,7 @@ public class VideoCamera extends Activity implements View.OnClickListener, } else { stopVideoRecording(); } - - mPausing = true; + closeCamera(); unregisterReceiver(mReceiver); setScreenTimeoutSystemDefault(); @@ -572,13 +575,16 @@ public class VideoCamera extends Activity implements View.OnClickListener, mStorageHint = null; } - closeCamera(); - mHandler.removeMessages(UPDATE_LAST_VIDEO); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { + // Do not handle any key if the activity is paused. + if (mPausing) { + return true; + } + setScreenTimeoutLong(); switch (keyCode) { |