Skip to content

Commit a35379a

Browse files
author
James Dong
committed
Add MEDIA_ERROR_SERVER_DIED error constant to MediaRecorder.java class
o As a result, applications can listen for death notification from MediaRecorder onError callbacks Change-Id: I49896c4ae8130bd67b52deff6eb97a22b43d3f32
1 parent 6624afe commit a35379a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

api/current.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11505,6 +11505,7 @@ package android.media {
1150511505
method public void setVideoSource(int) throws java.lang.IllegalStateException;
1150611506
method public void start() throws java.lang.IllegalStateException;
1150711507
method public void stop() throws java.lang.IllegalStateException;
11508+
field public static final int MEDIA_ERROR_SERVER_DIED = 100; // 0x64
1150811509
field public static final int MEDIA_RECORDER_ERROR_UNKNOWN = 1; // 0x1
1150911510
field public static final int MEDIA_RECORDER_INFO_MAX_DURATION_REACHED = 800; // 0x320
1151011511
field public static final int MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED = 801; // 0x321

media/java/android/media/MediaRecorder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,12 +721,17 @@ public void reset() {
721721
public native int getMaxAmplitude() throws IllegalStateException;
722722

723723
/* Do not change this value without updating its counterpart
724-
* in include/media/mediarecorder.h!
724+
* in include/media/mediarecorder.h or mediaplayer.h!
725725
*/
726726
/** Unspecified media recorder error.
727727
* @see android.media.MediaRecorder.OnErrorListener
728728
*/
729729
public static final int MEDIA_RECORDER_ERROR_UNKNOWN = 1;
730+
/** Media server died. In this case, the application must release the
731+
* MediaRecorder object and instantiate a new one.
732+
* @see android.media.MediaRecorder.OnErrorListener
733+
*/
734+
public static final int MEDIA_ERROR_SERVER_DIED = 100;
730735

731736
/**
732737
* Interface definition for a callback to be invoked when an error
@@ -741,6 +746,7 @@ public interface OnErrorListener
741746
* @param what the type of error that has occurred:
742747
* <ul>
743748
* <li>{@link #MEDIA_RECORDER_ERROR_UNKNOWN}
749+
* <li>{@link #MEDIA_ERROR_SERVER_DIED}
744750
* </ul>
745751
* @param extra an extra code, specific to the error type
746752
*/

0 commit comments

Comments
 (0)