summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2019-11-15 09:54:42 +0800
committerjunjiez <junjiez@codeaurora.org>2019-11-15 09:54:42 +0800
commit6bb719c84f7bc359bae05905aaffc571bdf6f056 (patch)
tree5f513801bb44aabbe2e66e59f6881e50e0c50247
parentf3b7cacf2b53b3239fc29ffddc2028be6dba89a2 (diff)
downloadandroid_packages_apps_Snap-6bb719c84f7bc359bae05905aaffc571bdf6f056.zip
android_packages_apps_Snap-6bb719c84f7bc359bae05905aaffc571bdf6f056.tar.gz
android_packages_apps_Snap-6bb719c84f7bc359bae05905aaffc571bdf6f056.tar.bz2
SnapdraongCamera:Fix recording pause
Catch IllegalStateException when fails to pause video recording. Change-Id: Id1c4978db58bd040dd695313bf246202fd7357c7 CRs-Fixed: 2565211
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index d4db0b7..6f5c8c8 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -3118,7 +3118,7 @@ public class CaptureModule implements CameraModule, PhotoController,
} catch (InterruptedException e) {
mCameraOpenCloseLock.release();
throw new RuntimeException("Interrupted while trying to lock camera closing.", e);
- } catch (CameraAccessException e) {
+ } catch (CameraAccessException | IllegalStateException e) {
e.printStackTrace();
} finally {
mCameraOpenCloseLock.release();
@@ -5180,7 +5180,13 @@ public class CaptureModule implements CameraModule, PhotoController,
boolean noNeedEndOfStreamInHFR = mHighSpeedCapture &&
((int)mHighSpeedFPSRange.getUpper() >= HIGH_SESSION_MAX_FPS);
if (noNeedEndofStreamWhenPause || noNeedEndOfStreamInHFR) {
- mMediaRecorder.pause();
+ try{
+ mMediaRecorder.pause();
+ } catch (IllegalStateException e){
+ e.printStackTrace();
+ mMediaRecorderPausing = false;
+ }
+
} else {
setEndOfStream(false, false);
}