summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorchiz <chiz@codeaurora.org>2013-09-17 09:10:08 +0800
committerSteve Kondik <shade@chemlab.org>2013-10-01 03:32:39 -0700
commit148d371e3fff32318cdff34803b992c5fe82c469 (patch)
tree027acae25a9d4dcc39facf2055b827473e431be2 /src
parent1fe582839c48822d35bdf7e5ef86adfc5c585c30 (diff)
downloadandroid_packages_apps_Gallery2-148d371e3fff32318cdff34803b992c5fe82c469.tar.gz
android_packages_apps_Gallery2-148d371e3fff32318cdff34803b992c5fe82c469.tar.bz2
android_packages_apps_Gallery2-148d371e3fff32318cdff34803b992c5fe82c469.zip
Camera: Fix crash during open and close camera
When we open camera for the second time after opening camera, switching to camcorder and exit camcorder rapidly, crash will be observed. It's due to the assertion of double open. When app receives pause event, it should cancel the switch animation, as we as it's listener. Change-Id: Id351d3e5db63c54646d592b728a4624e3d6e1211
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/CameraActivity.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 8924d110b..8b89e5d23 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -323,6 +323,9 @@ public class CameraActivity extends ActivityBase
@Override
public void onPause() {
+ if (mCameraSwitchAnimator != null && mCameraSwitchAnimator.isRunning()) {
+ mCameraSwitchAnimator.cancel();
+ }
mPaused = true;
mOrientationListener.disable();
mCurrentModule.onPauseBeforeSuper();