Commit c185e7da authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

callProvider: update audio output

Change-Id: I25932706d9654bd76b00e55a842031a825a16732
parent 4c9f821a
...@@ -331,9 +331,6 @@ class CallViewModel: Stateable, ViewModel { ...@@ -331,9 +331,6 @@ class CallViewModel: Stateable, ViewModel {
return callUUID == self.call?.callUUID.uuidString return callUUID == self.call?.callUUID.uuidString
}).subscribe(onNext: { [unowned self] serviceEvent in }).subscribe(onNext: { [unowned self] serviceEvent in
if serviceEvent.eventType == ServiceEventType.callProviderAnswerCall { if serviceEvent.eventType == ServiceEventType.callProviderAnswerCall {
if !self.audioService.isHeadsetConnected.value {
self.switchSpeaker()
}
self.answerCall() self.answerCall()
.subscribe() .subscribe()
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
...@@ -347,6 +344,7 @@ class CallViewModel: Stateable, ViewModel { ...@@ -347,6 +344,7 @@ class CallViewModel: Stateable, ViewModel {
serviceEvent.eventType == .audioActivated serviceEvent.eventType == .audioActivated
}).subscribe(onNext: { [unowned self] _ in }).subscribe(onNext: { [unowned self] _ in
if !self.audioService.isHeadsetConnected.value { if !self.audioService.isHeadsetConnected.value {
self.switchSpeaker()
self.isAudioOnly ? self.isAudioOnly ?
self.audioService.overrideToReceiver() : self.audioService.overrideToSpeaker() self.audioService.overrideToReceiver() : self.audioService.overrideToSpeaker()
} }
......
...@@ -168,16 +168,5 @@ extension CallsProviderDelegate: CXProviderDelegate { ...@@ -168,16 +168,5 @@ extension CallsProviderDelegate: CXProviderDelegate {
let serviceEventType: ServiceEventType = .audioActivated let serviceEventType: ServiceEventType = .audioActivated
let serviceEvent = ServiceEvent(withEventType: serviceEventType) let serviceEvent = ServiceEvent(withEventType: serviceEventType)
self.responseStream.onNext(serviceEvent) self.responseStream.onNext(serviceEvent)
print("didActivate")
// Start call audio media, now that the audio session has been activated after having its priority boosted.
} }
func provider(_ provider: CXProvider, didDeactivate audioSession: AVAudioSession) {
print("didActivate")
/*
Restart any non-call related audio now that the app's audio session has been
de-activated after having its priority restored to normal.
*/
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment