Changes default audio mode in AppRTCDemo to MODE_RINGTONE.

Also prevents that we try to restore audio mode when it has not been changed.

TBR=glaznev
BUG=NONE
TEST=AppRTCDemo and verify that volume control switches from "Ringtone to Phone" mode when call starts and switches back to Ringtone mode when call ends.

Review URL: https://webrtc-codereview.appspot.com/46879004

Cr-Commit-Position: refs/heads/master@{#8975}
This commit is contained in:
henrika
2015-04-10 15:19:24 +02:00
parent e12a667d7a
commit a125d7d7ad
3 changed files with 19 additions and 7 deletions

View File

@@ -151,10 +151,10 @@ public class AppRTCAudioManager {
audioManager.requestAudioFocus(null, AudioManager.STREAM_VOICE_CALL,
AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
// The AppRTC demo shall always run in COMMUNICATION mode since it will
// result in best possible "VoIP settings", like audio routing, volume
// control etc.
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
// Start by setting RINGTONE as default audio mode. The native WebRTC
// audio layer will switch to COMMUNICATION mode when the first streaming
// session starts and return to RINGTONE mode when all streaming stops.
audioManager.setMode(AudioManager.MODE_RINGTONE);
// Always disable microphone mute during a WebRTC call.
setMicrophoneMute(false);