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
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 8924d11..8b89e5d 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -323,6 +323,9 @@
@Override
public void onPause() {
+ if (mCameraSwitchAnimator != null && mCameraSwitchAnimator.isRunning()) {
+ mCameraSwitchAnimator.cancel();
+ }
mPaused = true;
mOrientationListener.disable();
mCurrentModule.onPauseBeforeSuper();