Index: webrtc/modules/audio_device/android/audio_manager.cc |
diff --git a/webrtc/modules/audio_device/android/audio_manager.cc b/webrtc/modules/audio_device/android/audio_manager.cc |
index 25735eb441b6931970e866025d90644398399d50..81fabdf9fec08a996de2b057679dddbaf4f1276f 100644 |
--- a/webrtc/modules/audio_device/android/audio_manager.cc |
+++ b/webrtc/modules/audio_device/android/audio_manager.cc |
@@ -34,7 +34,10 @@ AudioManager::JavaAudioManager::JavaAudioManager( |
init_(native_reg->GetMethodId("init", "()Z")), |
dispose_(native_reg->GetMethodId("dispose", "()V")), |
is_communication_mode_enabled_( |
- native_reg->GetMethodId("isCommunicationModeEnabled", "()Z")) { |
+ native_reg->GetMethodId("isCommunicationModeEnabled", "()Z")), |
+ is_device_blacklisted_for_open_sles_usage_( |
+ native_reg->GetMethodId( |
+ "isDeviceBlacklistedForOpenSLESUsage", "()Z")) { |
ALOGD("JavaAudioManager::ctor%s", GetThreadInfo().c_str()); |
} |
@@ -54,6 +57,11 @@ bool AudioManager::JavaAudioManager::IsCommunicationModeEnabled() { |
return audio_manager_->CallBooleanMethod(is_communication_mode_enabled_); |
} |
+bool AudioManager::JavaAudioManager::IsDeviceBlacklistedForOpenSLESUsage() { |
+ return audio_manager_->CallBooleanMethod( |
+ is_device_blacklisted_for_open_sles_usage_); |
+} |
+ |
// AudioManager implementation |
AudioManager::AudioManager() |
: j_environment_(JVM::GetInstance()->environment()), |
@@ -139,10 +147,10 @@ bool AudioManager::IsAcousticEchoCancelerSupported() const { |
bool AudioManager::IsLowLatencyPlayoutSupported() const { |
DCHECK(thread_checker_.CalledOnValidThread()); |
ALOGD("IsLowLatencyPlayoutSupported()"); |
- // TODO(henrika): enable again once issue in b/21485703 has been sorted out. |
- // This is just a temporary fix. |
- ALOGW("NOTE: OpenSL ES output is currently disabled!"); |
- return false; |
+ // Some devices are blacklisted for usage of OpenSL ES even if they report |
+ // that low-latency playout is supported. See b/21485703 for details. |
+ return j_audio_manager_->IsDeviceBlacklistedForOpenSLESUsage() ? |
+ false : low_latency_playout_; |
} |
int AudioManager::GetDelayEstimateInMilliseconds() const { |