Update RTCAudioSession isInterrupted state when audio session is activated while interrupted.
This will avoid getting into an inconsistent state where isInterrupted==YES while isActive==YES.
Bug: webrtc:11112
Change-Id: Ia4db85483e1e7a339f520d52a2feb475a73c262e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160140
Commit-Queue: Joe Chen <jsphchn@google.com>
Reviewed-by: Zeke Chin <tkchin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30306}
diff --git a/sdk/objc/components/audio/RTCAudioSession.mm b/sdk/objc/components/audio/RTCAudioSession.mm
index 229a6ea..260529d 100644
--- a/sdk/objc/components/audio/RTCAudioSession.mm
+++ b/sdk/objc/components/audio/RTCAudioSession.mm
@@ -385,6 +385,10 @@
if (success) {
if (shouldSetActive) {
self.isActive = active;
+ if (active && self.isInterrupted) {
+ self.isInterrupted = NO;
+ [self notifyDidEndInterruptionWithShouldResumeSession:YES];
+ }
}
if (active) {
[self incrementActivationCount];