From 148d371e3fff32318cdff34803b992c5fe82c469 Mon Sep 17 00:00:00 2001 From: chiz Date: Tue, 17 Sep 2013 09:10:08 +0800 Subject: 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 --- src/com/android/camera/CameraActivity.java | 3 +++ 1 file changed, 3 insertions(+) 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(); -- cgit v1.2.3