diff --git a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java index ae1c696d6d..6ead58fe02 100644 --- a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java +++ b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioRecord.java @@ -262,14 +262,6 @@ public class WebRtcAudioRecord { releaseAudioResources(); return false; } - - // Verify the recording state up to two times (with a sleep in between) - // before returning false and reporting an error. - int numberOfStateChecks = 0; - while (audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING && - ++numberOfStateChecks < 2) { - threadSleep(200); - } if (audioRecord.getRecordingState() != AudioRecord.RECORDSTATE_RECORDING) { reportWebRtcAudioRecordStartError( AudioRecordStartErrorCode.AUDIO_RECORD_START_STATE_MISMATCH, @@ -391,14 +383,4 @@ public class WebRtcAudioRecord { errorCallback.onWebRtcAudioRecordError(errorMessage); } } - - // Causes the currently executing thread to sleep for the specified number - // of milliseconds. - private void threadSleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - Logging.e(TAG, "Thread.sleep failed: " + e.getMessage()); - } - } } diff --git a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java index e5522651a4..15b9a0d597 100644 --- a/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java +++ b/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java @@ -309,14 +309,6 @@ public class WebRtcAudioTrack { releaseAudioResources(); return false; } - - // Verify the playout state up to two times (with a sleep in between) - // before returning false and reporting an error. - int numberOfStateChecks = 0; - while (audioTrack.getPlayState() != AudioTrack.PLAYSTATE_PLAYING && - ++numberOfStateChecks < 2) { - threadSleep(200); - } if (audioTrack.getPlayState() != AudioTrack.PLAYSTATE_PLAYING) { reportWebRtcAudioTrackStartError( AudioTrackStartErrorCode.AUDIO_TRACK_START_STATE_MISMATCH, @@ -525,14 +517,4 @@ public class WebRtcAudioTrack { errorCallback.onWebRtcAudioTrackError(errorMessage); } } - - // Causes the currently executing thread to sleep for the specified number - // of milliseconds. - private void threadSleep(long millis) { - try { - Thread.sleep(millis); - } catch (InterruptedException e) { - Logging.e(TAG, "Thread.sleep failed: " + e.getMessage()); - } - } }