From 5e13fa176e5c78290230e98cfb164c2a164bd8c1 Mon Sep 17 00:00:00 2001 From: junjiez Date: Thu, 14 Dec 2017 13:26:52 +0800 Subject: SnapdragonCamera:Fix recording If the surface of mediaRecorder is not valid, catch the exception when create session to avoid FC CRs-Fixed: 2158245 Change-Id: I031d06f49129b34f0378f863a630be91c222c25e --- src/com/android/camera/CaptureModule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 62e5bfa13..4fa1de0ea 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -3367,6 +3367,17 @@ public class CaptureModule implements CameraModule, PhotoController, e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); + } catch (IllegalArgumentException e) { + //surface of mediaRecorder is not valid + Toast.makeText(mActivity,"Could not start media recorder.\n " + + "Can't start video recording.", Toast.LENGTH_LONG).show(); + releaseMediaRecorder(); + releaseAudioFocus(); + mStartRecPending = false; + mIsRecordingVideo = false; + mUI.showUIafterRecording(); + mFrameProcessor.setVideoOutputSurface(null); + restartSession(true); } mStartRecPending = false; return true; -- cgit v1.2.3