Deactivate the audio session after a call ends using the AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation constant
since it is recommended for VoIP apps.

BUG=b/23356406
R=tkchin@webrtc.org

Review URL: https://codereview.webrtc.org/1418483004 .

Cr-Commit-Position: refs/heads/master@{#10673}
diff --git a/webrtc/modules/audio_device/ios/audio_device_ios.mm b/webrtc/modules/audio_device/ios/audio_device_ios.mm
index 1466d6a..d7668f7 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 @@
     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
+            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