Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 136e0062 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioTrack: update javadoc for missing DEAD_OBJECT return code

Update the javadoc of the write() methods to indicate they can
  return AudioManager.DEAD_OBJECT.

Bug 19169728

Change-Id: I560c5efba37c2cc8b870573558e0cab634cb3f5d
parent 954850ce
Loading
Loading
Loading
Loading
+9 −3
Original line number Original line Diff line number Diff line
@@ -1499,7 +1499,9 @@ public class AudioTrack
     * @param sizeInShorts the number of shorts to read in audioData after the offset.
     * @param sizeInShorts the number of shorts to read in audioData after the offset.
     * @return the number of shorts that were written or {@link #ERROR_INVALID_OPERATION}
     * @return the number of shorts that were written or {@link #ERROR_INVALID_OPERATION}
     *    if the object wasn't properly initialized, or {@link #ERROR_BAD_VALUE} if
     *    if the object wasn't properly initialized, or {@link #ERROR_BAD_VALUE} if
     *    the parameters don't resolve to valid data and indexes.
     *    the parameters don't resolve to valid data and indexes, or
     *    {@link AudioManager#ERROR_DEAD_OBJECT} if the AudioTrack is not valid anymore and
     *    needs to be recreated.
     */
     */


    public int write(short[] audioData, int offsetInShorts, int sizeInShorts) {
    public int write(short[] audioData, int offsetInShorts, int sizeInShorts) {
@@ -1559,7 +1561,9 @@ public class AudioTrack
     *     queuing as much audio data for playback as possible without blocking.
     *     queuing as much audio data for playback as possible without blocking.
     * @return the number of floats that were written, or {@link #ERROR_INVALID_OPERATION}
     * @return the number of floats that were written, or {@link #ERROR_INVALID_OPERATION}
     *    if the object wasn't properly initialized, or {@link #ERROR_BAD_VALUE} if
     *    if the object wasn't properly initialized, or {@link #ERROR_BAD_VALUE} if
     *    the parameters don't resolve to valid data and indexes.
     *    the parameters don't resolve to valid data and indexes, or
     *    {@link AudioManager#ERROR_DEAD_OBJECT} if the AudioTrack is not valid anymore and
     *    needs to be recreated.
     */
     */
    public int write(float[] audioData, int offsetInFloats, int sizeInFloats,
    public int write(float[] audioData, int offsetInFloats, int sizeInFloats,
            @WriteMode int writeMode) {
            @WriteMode int writeMode) {
@@ -1620,7 +1624,9 @@ public class AudioTrack
     *     <BR>With {@link #WRITE_NON_BLOCKING}, the write will return immediately after
     *     <BR>With {@link #WRITE_NON_BLOCKING}, the write will return immediately after
     *     queuing as much audio data for playback as possible without blocking.
     *     queuing as much audio data for playback as possible without blocking.
     * @return 0 or a positive number of bytes that were written, or
     * @return 0 or a positive number of bytes that were written, or
     *     {@link #ERROR_BAD_VALUE}, {@link #ERROR_INVALID_OPERATION}
     *     {@link #ERROR_BAD_VALUE}, {@link #ERROR_INVALID_OPERATION}, or
     *     {@link AudioManager#ERROR_DEAD_OBJECT} if the AudioTrack is not valid anymore and
     *     needs to be recreated.
     */
     */
    public int write(ByteBuffer audioData, int sizeInBytes,
    public int write(ByteBuffer audioData, int sizeInBytes,
            @WriteMode int writeMode) {
            @WriteMode int writeMode) {