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

Commit a16a9793 authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Update comments for AudioRecord IllegalArgumentException

Also explicitly list IllegalArgumentException in throws clause of the
constructor helper methods, as that is a critical side-effect of these methods.

Change-Id: I5cae5dfd807235fbdd827ef4ebc7cf05bfd11c02
parent 19294ca0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ public class AudioRecord


    // Convenience method for the constructor's parameter checks.
    // This is where constructor IllegalArgumentException-s are thrown
    // This and audioBuffSizeCheck are where constructor IllegalArgumentException-s are thrown
    // postconditions:
    //    mRecordSource is valid
    //    mChannelCount is valid
@@ -250,7 +250,8 @@ public class AudioRecord
    //    mAudioFormat is valid
    //    mSampleRate is valid
    private void audioParamCheck(int audioSource, int sampleRateInHz,
                                 int channelConfig, int audioFormat) {
                                 int channelConfig, int audioFormat)
            throws IllegalArgumentException {

        //--------------
        // audio source
@@ -314,7 +315,7 @@ public class AudioRecord
    //    mAudioFormat is AudioFormat.ENCODING_PCM_8BIT OR AudioFormat.ENCODING_PCM_16BIT
    // postcondition:
    //    mNativeBufferSizeInBytes is valid (multiple of frame size, positive)
    private void audioBuffSizeCheck(int audioBufferSize) {
    private void audioBuffSizeCheck(int audioBufferSize) throws IllegalArgumentException {
        // NB: this section is only valid with PCM data.
        // To update when supporting compressed formats
        int frameSizeInBytes = mChannelCount