Android: Remove IsCommunicationModeEnabled() from AudioManager

This method is only used for logging and is blocking further refactoring
work. Once the refactoring and cleanup of the external AudioDeviceModule
is complete, we can revisit what logging we want and need and add it in
a cleaner way.

Bug: webrtc:7452
Change-Id: If08bcfb37860e9e7b9b5105cb75f748b53775f69
Reviewed-on: https://webrtc-review.googlesource.com/65460
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22678}
This commit is contained in:
Magnus Jedvert
2018-03-29 12:31:15 +02:00
committed by Commit Bot
parent 6c2c13af06
commit a21090b770
4 changed files with 0 additions and 23 deletions

View File

@ -252,10 +252,6 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
return 0;
}
audio_device_buffer_->StartPlayout();
if (!audio_manager_->IsCommunicationModeEnabled()) {
RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
}
int32_t result = output_->StartPlayout();
RTC_LOG(INFO) << "output: " << result;
RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
@ -290,10 +286,6 @@ class AndroidAudioDeviceModule : public AudioDeviceModule {
if (Recording()) {
return 0;
}
if (!audio_manager_->IsCommunicationModeEnabled()) {
RTC_LOG(WARNING)
<< "The application should use MODE_IN_COMMUNICATION audio mode!";
}
audio_device_buffer_->StartRecording();
int32_t result = input_->StartRecording();
RTC_LOG(INFO) << "output: " << result;

View File

@ -98,13 +98,6 @@ bool AudioManager::Close() {
return true;
}
bool AudioManager::IsCommunicationModeEnabled() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
JNIEnv* env = AttachCurrentThreadIfNeeded();
return Java_WebRtcAudioManager_isCommunicationModeEnabled(env,
j_audio_manager_);
}
bool AudioManager::IsAcousticEchoCancelerSupported() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
JNIEnv* env = AttachCurrentThreadIfNeeded();

View File

@ -43,9 +43,6 @@ class AudioManager {
// Revert any setting done by Init().
bool Close();
// Returns true if current audio mode is AudioManager.MODE_IN_COMMUNICATION.
bool IsCommunicationModeEnabled() const;
// Native audio parameters stored during construction.
const AudioParameters& GetPlayoutAudioParameters();
const AudioParameters& GetRecordAudioParameters();