Skip to content

Commit

Permalink
AudioSessionManager에서 중복으로 updateAudioSession() 수행하던 현상 수정 (#1159)
Browse files Browse the repository at this point in the history
## Summary
- AudioSessionManager에서 중복으로 updateAudioSession() 수행하던 현상 수정
- Delegate를 통해 이벤트를 전달 하고, 전달 받는 쪽에서 이미 updateAudioSession()을 수행하고 있기
때문에, 중복하여 호출하는 부분 제거
  • Loading branch information
ParkJongSang authored May 8, 2024
1 parent 979ca10 commit 87c039e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions NuguClientKit/Sources/Audio/AudioSessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ final public class AudioSessionManager: AudioSessionManageable {

public extension AudioSessionManager {
func isCarplayConnected() -> Bool {
AVAudioSession.sharedInstance().availableInputs?.contains(where: { $0.portType == .carAudio }) ?? false
AVAudioSession.sharedInstance().currentRoute.outputs.contains(where: { $0.portType == .carAudio })
}

func requestRecordPermission(_ response: @escaping (Bool) -> Void) {
Expand Down Expand Up @@ -220,10 +220,6 @@ private extension AudioSessionManager {
}
case .categoryChange, .routeConfigurationChange:
self?.delegate?.audioSessionRouteChanged(reason: .categoryChange)

if self?.isCarplayConnected() == true {
self?.updateAudioSession()
}
default: break
}
})
Expand Down

0 comments on commit 87c039e

Please sign in to comment.