 Chromium Code Reviews
 Chromium Code Reviews Issue 1418483004:
  Deactivate the audio session after a call ends using the AVAudioSessionSetActiveOptionNotifyOthersO…  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master
    
  
    Issue 1418483004:
  Deactivate the audio session after a call ends using the AVAudioSessionSetActiveOptionNotifyOthersO…  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master| Index: webrtc/modules/audio_device/ios/audio_device_ios.mm | 
| diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.mm b/webrtc/modules/audio_device/ios/audio_device_ios.mm | 
| index f26e9f1cc7463657a2646aa28f4789cc9bbe73b2..b94ea17b7f62a96d78be7f2f85f92a18d8630edb 100644 | 
| --- a/webrtc/modules/audio_device/ios/audio_device_ios.mm | 
| +++ b/webrtc/modules/audio_device/ios/audio_device_ios.mm | 
| @@ -86,13 +86,21 @@ static void ActivateAudioSession(AVAudioSession* session, bool activate) { | 
| NSError* error = nil; | 
| BOOL success = NO; | 
| - // Deactivate the audio session and return if |activate| is false. | 
| if (!activate) { | 
| - success = [session setActive:NO error:&error]; | 
| + // Deactivate the audio session using an extra option and then return. | 
| + // AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation is used to | 
| + // ensure that other audio sessions that were interrupted by our session | 
| + // can return to their active state. It is recommended for VoIP apps to | 
| + // use this option. | 
| + success = [session | 
| 
tkchin_webrtc
2015/11/16 21:40:34
nit: 
maybe just break it onto next line (you can
 
henrika_webrtc
2015/11/17 13:52:32
withOptions:AVAudioSessionSetActiveOptionNotifyOth
 | 
| + setActive:NO | 
| + withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation | 
| + error:&error]; | 
| RTC_DCHECK(CheckAndLogError(success, error)); | 
| return; | 
| } | 
| + // Go ahead and active our own audio session since |activate| is true. | 
| // Use a category which supports simultaneous recording and playback. | 
| // By default, using this category implies that our app’s audio is | 
| // nonmixable, hence activating the session will interrupt any other |