diff options
| -rw-r--r-- | media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java index fe3929d..0304640 100644 --- a/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java +++ b/media/tests/ScoAudioTest/src/com/android/scoaudiotest/ScoAudioTest.java @@ -429,7 +429,7 @@ public class ScoAudioTest extends Activity { mMediaRecorder.start(); mState = 1; } catch (Exception e) { - Log.e(TAG, "Could start MediaRecorder: " + e.toString()); + Log.e(TAG, "Could start MediaRecorder: ", e); mMediaRecorder.release(); mMediaRecorder = null; mState = 0; @@ -439,7 +439,7 @@ public class ScoAudioTest extends Activity { mMediaRecorder.stop(); mMediaRecorder.reset(); } catch (Exception e) { - Log.e(TAG, "Could not stop MediaRecorder: " + e.toString()); + Log.e(TAG, "Could not stop MediaRecorder: ", e); mMediaRecorder.release(); mMediaRecorder = null; } finally { @@ -466,7 +466,7 @@ public class ScoAudioTest extends Activity { mMediaRecorder.prepare(); } catch (Exception e) { - Log.e(TAG, "Could not prepare MediaRecorder: " + e.toString()); + Log.e(TAG, "Could not prepare MediaRecorder: ", e); mMediaRecorder.release(); mMediaRecorder = null; } @@ -475,9 +475,14 @@ public class ScoAudioTest extends Activity { @Override public void stop() { if (mMediaRecorder != null) { - mMediaRecorder.stop(); - mMediaRecorder.release(); - mMediaRecorder = null; + try { + mMediaRecorder.stop(); + } catch (Exception e) { + Log.e(TAG, "Could not stop MediaRecorder: ", e); + } finally { + mMediaRecorder.release(); + mMediaRecorder = null; + } } updatePlayPauseButton(); } |
