Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19776,6 +19776,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -19898,6 +19899,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1 api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -21292,6 +21292,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -21416,6 +21417,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1 api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19845,6 +19845,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -19967,6 +19968,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1 core/jni/android_media_AudioRecord.cpp +6 −10 Original line number Diff line number Diff line Loading @@ -479,17 +479,13 @@ void envReleaseArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, jint static inline jint interpretReadSizeError(ssize_t readSize) { ALOGE_IF(readSize != WOULD_BLOCK, "Error %zd during AudioRecord native read", readSize); switch (readSize) { case WOULD_BLOCK: if (readSize == WOULD_BLOCK) { return (jint)0; case BAD_VALUE: return (jint)AUDIO_JAVA_BAD_VALUE; default: // may be possible for other errors such as // NO_INIT to happen if restoreRecord_l fails. case INVALID_OPERATION: return (jint)AUDIO_JAVA_INVALID_OPERATION; } else if (readSize == NO_INIT) { return AUDIO_JAVA_DEAD_OBJECT; } else { ALOGE("Error %zd during AudioRecord native read", readSize); return nativeToJavaStatus(readSize); } } Loading core/jni/android_media_AudioTrack.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -606,6 +606,18 @@ void envReleaseArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, jint env->ReleaseFloatArrayElements(array, elems, mode); } static inline jint interpretWriteSizeError(ssize_t writeSize) { if (writeSize == WOULD_BLOCK) { return (jint)0; } else if (writeSize == NO_INIT) { return AUDIO_JAVA_DEAD_OBJECT; } else { ALOGE("Error %zd during AudioTrack native read", writeSize); return nativeToJavaStatus(writeSize); } } // ---------------------------------------------------------------------------- template <typename T> static jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const T *data, Loading @@ -628,11 +640,10 @@ static jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const T memcpy(track->sharedBuffer()->pointer(), data + offsetInSamples, sizeInBytes); written = sizeInBytes; } if (written > 0) { if (written >= 0) { return written / sizeof(T); } // for compatibility, error codes pass through unchanged return written; return interpretWriteSizeError(written); } // ---------------------------------------------------------------------------- Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19776,6 +19776,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -19898,6 +19899,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -21292,6 +21292,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -21416,6 +21417,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1
api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -19845,6 +19845,7 @@ package android.media { method public void stop() throws java.lang.IllegalStateException; field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int READ_BLOCKING = 0; // 0x0 field public static final int READ_NON_BLOCKING = 1; // 0x1 Loading Loading @@ -19967,6 +19968,7 @@ package android.media { method public int write(java.nio.ByteBuffer, int, int, long); field public static final int ERROR = -1; // 0xffffffff field public static final int ERROR_BAD_VALUE = -2; // 0xfffffffe field public static final int ERROR_DEAD_OBJECT = -6; // 0xfffffffa field public static final int ERROR_INVALID_OPERATION = -3; // 0xfffffffd field public static final int MODE_STATIC = 0; // 0x0 field public static final int MODE_STREAM = 1; // 0x1
core/jni/android_media_AudioRecord.cpp +6 −10 Original line number Diff line number Diff line Loading @@ -479,17 +479,13 @@ void envReleaseArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, jint static inline jint interpretReadSizeError(ssize_t readSize) { ALOGE_IF(readSize != WOULD_BLOCK, "Error %zd during AudioRecord native read", readSize); switch (readSize) { case WOULD_BLOCK: if (readSize == WOULD_BLOCK) { return (jint)0; case BAD_VALUE: return (jint)AUDIO_JAVA_BAD_VALUE; default: // may be possible for other errors such as // NO_INIT to happen if restoreRecord_l fails. case INVALID_OPERATION: return (jint)AUDIO_JAVA_INVALID_OPERATION; } else if (readSize == NO_INIT) { return AUDIO_JAVA_DEAD_OBJECT; } else { ALOGE("Error %zd during AudioRecord native read", readSize); return nativeToJavaStatus(readSize); } } Loading
core/jni/android_media_AudioTrack.cpp +14 −3 Original line number Diff line number Diff line Loading @@ -606,6 +606,18 @@ void envReleaseArrayElements(JNIEnv *env, jfloatArray array, jfloat *elems, jint env->ReleaseFloatArrayElements(array, elems, mode); } static inline jint interpretWriteSizeError(ssize_t writeSize) { if (writeSize == WOULD_BLOCK) { return (jint)0; } else if (writeSize == NO_INIT) { return AUDIO_JAVA_DEAD_OBJECT; } else { ALOGE("Error %zd during AudioTrack native read", writeSize); return nativeToJavaStatus(writeSize); } } // ---------------------------------------------------------------------------- template <typename T> static jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const T *data, Loading @@ -628,11 +640,10 @@ static jint writeToTrack(const sp<AudioTrack>& track, jint audioFormat, const T memcpy(track->sharedBuffer()->pointer(), data + offsetInSamples, sizeInBytes); written = sizeInBytes; } if (written > 0) { if (written >= 0) { return written / sizeof(T); } // for compatibility, error codes pass through unchanged return written; return interpretWriteSizeError(written); } // ---------------------------------------------------------------------------- Loading