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

Commit 8057f24d authored by Glenn Kasten's avatar Glenn Kasten
Browse files

Verify that AudioRecord object is initialized for more APIs

Compare to AudioTrack, which already has these checks.

Change-Id: I3a239dfb4b918ceabfb723f189cc50ed6662eee6
parent 25a64b4b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -694,6 +694,9 @@ public class AudioRecord
     *  {@link #ERROR_INVALID_OPERATION}
     */
    public int setNotificationMarkerPosition(int markerInFrames) {
        if (mState == STATE_UNINITIALIZED) {
            return ERROR_INVALID_OPERATION;
        }
        return native_set_marker_pos(markerInFrames);
    }

@@ -706,6 +709,9 @@ public class AudioRecord
     * @return error code or success, see {@link #SUCCESS}, {@link #ERROR_INVALID_OPERATION}
     */
    public int setPositionNotificationPeriod(int periodInFrames) {
        if (mState == STATE_UNINITIALIZED) {
            return ERROR_INVALID_OPERATION;
        }
        return native_set_pos_update_period(periodInFrames);
    }