[iOS] Don't deactivate audio session
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jul 2018 00:24:03 +0000 (00:24 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Jul 2018 00:24:03 +0000 (00:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188127
<rdar://problem/42544143>

Reviewed by Jon Lee.

r233435 includes a change that deactivates the shared audio session when there are no more
active media sessions. This is a good in WK2 because it allows other applications to resume
playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
app may also be playing audio.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234339 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp

index abcadb0..7c37773 100644 (file)
@@ -1,3 +1,19 @@
+2018-07-27  Eric Carlson  <eric.carlson@apple.com>
+
+        [iOS] Don't deactivate audio session
+        https://bugs.webkit.org/show_bug.cgi?id=188127
+        <rdar://problem/42544143>
+
+        Reviewed by Jon Lee.
+        
+        r233435 includes a change that deactivates the shared audio session when there are no more
+        active media sessions. This is a good in WK2 because it allows other applications to resume
+        playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
+        app may also be playing audio.
+
+        * platform/audio/PlatformMediaSessionManager.cpp:
+        (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
+
 2018-07-27  Chris Dumez  <cdumez@apple.com>
 
         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
index ca72d42..f8c531a 100644 (file)
@@ -162,9 +162,6 @@ void PlatformMediaSessionManager::removeSession(PlatformMediaSession& session)
     if (m_sessions.isEmpty() || std::all_of(m_sessions.begin(), m_sessions.end(), std::logical_not<void>())) {
         m_remoteCommandListener = nullptr;
         m_audioHardwareListener = nullptr;
-#if USE(AUDIO_SESSION)
-        AudioSession::sharedSession().tryToSetActive(false);
-#endif
     }
 
     scheduleUpdateSessionState();