Skip to content

Commit 9f33fc8

Browse files
committed
Fix compilation issues
1 parent d80c8a6 commit 9f33fc8

File tree

5 files changed

+32
-35
lines changed

5 files changed

+32
-35
lines changed

Sources/StreamVideo/Utils/AudioSession/CallAudioSession.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class CallAudioSession: @unchecked Sendable {
4040
.setCategoryAndModeAndCategoryOptions(
4141
.playAndRecord,
4242
mode: .voiceChat,
43-
categoryOptions: [.allowBluetoothHFP, .allowBluetoothA2DP]
43+
categoryOptions: [.allowBluetooth, .allowBluetoothA2DP]
4444
)
4545
)
4646
)
@@ -146,7 +146,7 @@ final class CallAudioSession: @unchecked Sendable {
146146
.avAudioSession(
147147
.setOverrideOutputAudioPort(configuration.overrideOutputAudioPort ?? .none)
148148
),
149-
.setActive(configuration.isActive),
149+
.setActive(configuration.isActive)
150150
]
151151

152152
if ownCapabilities.contains(.sendAudio) {

Sources/StreamVideo/Utils/AudioSession/RTCAudioStore/Components/RTCAudioStore+AVAudioSessionConfigurationValidator.swift

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
//
2-
// Validator.swift
3-
// StreamVideo
4-
//
5-
// Created by Ilias Pavlidakis on 9/10/25.
2+
// Copyright © 2025 Stream.io Inc. All rights reserved.
63
//
74

8-
import Foundation
95
import AVFoundation
6+
import Foundation
107

118
extension RTCAudioStore.StoreState.AVAudioSessionConfiguration {
129

@@ -58,27 +55,27 @@ extension RTCAudioStore.StoreState.AVAudioSessionConfiguration {
5855

5956
// .playAndRecord
6057
var playAndRecordModes: Set<AVAudioSession.Mode> =
61-
makeModes(
62-
[
63-
.default,
64-
.voiceChat,
65-
.videoChat,
66-
.gameChat,
67-
.videoRecording,
68-
.measurement,
69-
.spokenAudio
70-
]
71-
)
58+
makeModes(
59+
[
60+
.default,
61+
.voiceChat,
62+
.videoChat,
63+
.gameChat,
64+
.videoRecording,
65+
.measurement,
66+
.spokenAudio
67+
]
68+
)
7269
if #available(iOS 15.0, *) { playAndRecordModes.insert(.voicePrompt) }
7370
var playAndRecordOptions: AVAudioSession.CategoryOptions =
74-
[
75-
.mixWithOthers,
76-
.duckOthers,
77-
.interruptSpokenAudioAndMixWithOthers,
78-
.defaultToSpeaker,
79-
.allowBluetoothHFP,
80-
.allowBluetoothA2DP
81-
]
71+
[
72+
.mixWithOthers,
73+
.duckOthers,
74+
.interruptSpokenAudioAndMixWithOthers,
75+
.defaultToSpeaker,
76+
.allowBluetooth,
77+
.allowBluetoothA2DP
78+
]
8279
map[.playAndRecord] = AllowedConfiguration(
8380
modes: playAndRecordModes,
8481
options: playAndRecordOptions

StreamVideoTests/Utils/AudioSession/CallAudioSession/CallAudioSession_Tests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class CallAudioSession_Tests: XCTestCase, @unchecked Sendable {
3737
isActive: true,
3838
category: .playAndRecord,
3939
mode: .voiceChat,
40-
options: [.allowBluetoothHFP, .allowBluetoothA2DP]
40+
options: [.allowBluetooth, .allowBluetoothA2DP]
4141
)
4242
)
4343

@@ -47,7 +47,7 @@ final class CallAudioSession_Tests: XCTestCase, @unchecked Sendable {
4747
let configuration = self.mockAudioStore.audioStore.state.audioSessionConfiguration
4848
return configuration.category == .playAndRecord
4949
&& configuration.mode == .voiceChat
50-
&& configuration.options.contains(.allowBluetoothHFP)
50+
&& configuration.options.contains(.allowBluetooth)
5151
&& configuration.options.contains(.allowBluetoothA2DP)
5252
}
5353
}
@@ -62,7 +62,7 @@ final class CallAudioSession_Tests: XCTestCase, @unchecked Sendable {
6262
isActive: true,
6363
category: .playAndRecord,
6464
mode: .voiceChat,
65-
options: [.allowBluetoothHFP, .allowBluetoothA2DP],
65+
options: [.allowBluetooth, .allowBluetoothA2DP],
6666
overrideOutputAudioPort: .speaker
6767
)
6868
policy.stub(for: .configuration, with: policyConfiguration)
@@ -158,7 +158,7 @@ final class CallAudioSession_Tests: XCTestCase, @unchecked Sendable {
158158
isActive: true,
159159
category: .playAndRecord,
160160
mode: .voiceChat,
161-
options: [.allowBluetoothHFP],
161+
options: [.allowBluetooth],
162162
overrideOutputAudioPort: .speaker
163163
)
164164
)
@@ -176,7 +176,7 @@ final class CallAudioSession_Tests: XCTestCase, @unchecked Sendable {
176176
capabilitiesSubject.send([.sendAudio])
177177

178178
await fulfillment {
179-
self.mockAudioStore.audioStore.state.audioSessionConfiguration.options.contains(.allowBluetoothHFP)
179+
self.mockAudioStore.audioStore.state.audioSessionConfiguration.options.contains(.allowBluetooth)
180180
}
181181

182182
let updatedPolicy = MockAudioSessionPolicy()

StreamVideoTests/Utils/AudioSession/RTCAudioStore/Components/RTCAudioStore_AVAudioSessionConfigurationValidatorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class RTCAudioStore_AVAudioSessionConfigurationValidatorTests: XCTestCase,
3232
subject = .init(
3333
category: .playAndRecord,
3434
mode: .voiceChat,
35-
options: [.allowBluetoothHFP, .defaultToSpeaker],
35+
options: [.allowBluetooth, .defaultToSpeaker],
3636
overrideOutputAudioPort: .none
3737
)
3838

StreamVideoTests/Utils/AudioSession/RTCAudioStore/Namespace/Reducers/RTCAudioStore_AVAudioSessionReducerTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ final class RTCAudioStore_AVAudioSessionReducerTests: XCTestCase, @unchecked Sen
105105
let state = makeState(
106106
category: .playAndRecord,
107107
mode: .voiceChat,
108-
options: [.allowBluetoothHFP]
108+
options: [.allowBluetooth]
109109
)
110110
session.category = AVAudioSession.Category.playAndRecord.rawValue
111111
session.mode = AVAudioSession.Mode.voiceChat.rawValue
112-
session.categoryOptions = [.allowBluetoothHFP]
112+
session.categoryOptions = [.allowBluetooth]
113113
session.isActive = true
114114

115115
let result = try subject.reduce(
116116
state: state,
117-
action: .avAudioSession(.setCategoryOptions([.allowBluetoothHFP, .defaultToSpeaker])),
117+
action: .avAudioSession(.setCategoryOptions([.allowBluetooth, .defaultToSpeaker])),
118118
file: #file,
119119
function: #function,
120120
line: #line

0 commit comments

Comments
 (0)