From 3cd9eaf5e82bfe448fec65d799172e7bd7622017 Mon Sep 17 00:00:00 2001 From: henrika Date: Wed, 1 Apr 2015 12:00:00 +0200 Subject: [PATCH] Ensures that AudioManager.isVolumeFixed() is only used for Android L and above TBR=perkj BUG=NONE TEST=./webrtc/build/android/test_runner.py gtest -s modules_unittests --gtest_filter=AudioDevice* --num_retries=0 Review URL: https://webrtc-codereview.appspot.com/51499004 Cr-Commit-Position: refs/heads/master@{#8909} --- .../java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java index 5161dc33e..23ad5fe39 100644 --- a/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java +++ b/webrtc/modules/audio_device/android/java/src/org/webrtc/voiceengine/WebRtcAudioTrack.java @@ -228,9 +228,11 @@ class WebRtcAudioTrack { private boolean SetStreamVolume(int volume) { Logd("SetStreamVolume(" + volume + ")"); assertTrue(audioManager != null); - if (audioManager.isVolumeFixed()) { - Loge("The device implements a fixed volume policy."); - return false; + if (WebRtcAudioUtils.runningOnLollipopOrHigher()) { + if (audioManager.isVolumeFixed()) { + Loge("The device implements a fixed volume policy."); + return false; + } } audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL, volume, 0); return true;