summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorjinwu <jinwu@codeaurora.org>2018-06-15 16:28:28 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-26 03:53:51 -0700
commit0e830bed24cb87b40a0f5a3d0a38ea9b7c667783 (patch)
treeb846c6f3c7fd5a46414e3b26c3a0177042ad3b62 /src/com
parent5c6f94ef09cea25b002934154f11f811022e8be1 (diff)
downloadandroid_packages_apps_Snap-0e830bed24cb87b40a0f5a3d0a38ea9b7c667783.tar.gz
android_packages_apps_Snap-0e830bed24cb87b40a0f5a3d0a38ea9b7c667783.tar.bz2
android_packages_apps_Snap-0e830bed24cb87b40a0f5a3d0a38ea9b7c667783.zip
Fix FC in MonkeyTest
Catch more exceptions in startRecordingVideo. Change-Id: I4f1ffc7cabf7c45b44bbdbbff0f01a96c3601ef9
Diffstat (limited to 'src/com')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 68f462eef..fb4e8994f 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -3867,23 +3867,31 @@ public class CaptureModule implements CameraModule, PhotoController,
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
+ quitRecordingWithError("IOException");
} 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);
+ e.printStackTrace();
+ quitRecordingWithError("IllegalArgumentException");
} catch (IllegalStateException e) {
e.printStackTrace();
+ quitRecordingWithError("IllegalStateException");
+ } catch (NullPointerException e) {
+ e.printStackTrace();
+ quitRecordingWithError("NullPointException");
}
return true;
}
+ private void quitRecordingWithError(String msg) {
+ Toast.makeText(mActivity,"Could not start media recorder.\n " +
+ msg, Toast.LENGTH_LONG).show();
+ releaseMediaRecorder();
+ releaseAudioFocus();
+ mStartRecPending = false;
+ mIsRecordingVideo = false;
+ mUI.showUIafterRecording();
+ mFrameProcessor.setVideoOutputSurface(null);
+ restartSession(true);
+ }
private boolean startMediaRecorder() {
if (mUnsupportedResolution == true ) {
Log.v(TAG, "Unsupported Resolution according to target");