From 0e3f8387302b4aa882c20891f1faba74030f1a4f Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Wed, 16 Nov 2011 11:34:51 -0800 Subject: Fix EffectsRecorder error path handling when ending recording. Previously, if mRunner had already been set to null, errors sent by mediarecorder would not be propagated to VideoCamera correctly. This resulted in crashes when putting device to sleep right after starting timelapse recording with effects. Bug: 5627242 Change-Id: I3ae3c713a0aaf9a4507442bbbcd3ec89971d5f95 --- src/com/android/camera/EffectsRecorder.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/EffectsRecorder.java b/src/com/android/camera/EffectsRecorder.java index 390efa6..3d2aebf 100644 --- a/src/com/android/camera/EffectsRecorder.java +++ b/src/com/android/camera/EffectsRecorder.java @@ -798,7 +798,13 @@ public class EffectsRecorder { if (result == GraphRunner.RESULT_ERROR) { // Handle error case Log.e(TAG, "Error running filter graph!"); - raiseError(mRunner == null ? null : mRunner.getError()); + Exception e = null; + if (mRunner != null) { + e = mRunner.getError(); + } else if (mOldRunner != null) { + e = mOldRunner.getError(); + } + raiseError(e); } if (mOldRunner != null) { // Tear down old graph if available -- cgit v1.1