From 87c039e34609ee94b09ad1315bd77407e5a7b84b Mon Sep 17 00:00:00 2001 From: Sokiwar Date: Wed, 8 May 2024 16:13:07 +0900 Subject: [PATCH] =?UTF-8?q?AudioSessionManager=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=EC=9C=BC=EB=A1=9C=20updateAudioSession()=20?= =?UTF-8?q?=EC=88=98=ED=96=89=ED=95=98=EB=8D=98=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#1159)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - AudioSessionManager에서 중복으로 updateAudioSession() 수행하던 현상 수정 - Delegate를 통해 이벤트를 전달 하고, 전달 받는 쪽에서 이미 updateAudioSession()을 수행하고 있기 때문에, 중복하여 호출하는 부분 제거 --- NuguClientKit/Sources/Audio/AudioSessionManager.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/NuguClientKit/Sources/Audio/AudioSessionManager.swift b/NuguClientKit/Sources/Audio/AudioSessionManager.swift index 56cb80e9..18bea87d 100644 --- a/NuguClientKit/Sources/Audio/AudioSessionManager.swift +++ b/NuguClientKit/Sources/Audio/AudioSessionManager.swift @@ -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) { @@ -220,10 +220,6 @@ private extension AudioSessionManager { } case .categoryChange, .routeConfigurationChange: self?.delegate?.audioSessionRouteChanged(reason: .categoryChange) - - if self?.isCarplayConnected() == true { - self?.updateAudioSession() - } default: break } })