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}
This commit is contained in:
Joe Chen 2019-12-23 11:18:02 -08:00 committed by Commit Bot
parent df2c601616
commit 81dcfda823

View File

@ -385,6 +385,10 @@ NSString * const kRTCAudioSessionOutputVolumeSelector = @"outputVolume";
if (success) {
if (shouldSetActive) {
self.isActive = active;
if (active && self.isInterrupted) {
self.isInterrupted = NO;
[self notifyDidEndInterruptionWithShouldResumeSession:YES];
}
}
if (active) {
[self incrementActivationCount];