mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add experimental native calls behind a developer flag (#6159)
Add the element-call-ios dependency and a developer option for native calls The package carries the call UI and the matrix-rust-rtc media stack, pinned by exact version the way the SDK is, with the local path kept commented out for working against a checkout. Its media xcframework has no Intel simulator slice and a package cannot say so for the projects that consume it, hence the excluded architecture at the project level. The developer option is off by default and nothing reads it yet. It is placed next to the Element Call URL override, which only applies to the web view that native calls replace.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
import AnalyticsEvents
|
||||
import AVFoundation
|
||||
import CallKit
|
||||
import ElementCall
|
||||
import Foundation
|
||||
import LocalAuthentication
|
||||
import Photos
|
||||
@@ -1853,6 +1854,40 @@ nonisolated class CLLocationManagerMock: CLLocationManagerProtocol, @unchecked S
|
||||
stopUpdatingLocationClosure?()
|
||||
}
|
||||
}
|
||||
nonisolated class CXCallControllerMock: CXCallControllerProtocol, @unchecked Sendable {
|
||||
|
||||
//MARK: - request
|
||||
|
||||
private let requestCompletionCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var requestCompletionUnderlyingCallsCount = 0
|
||||
var requestCompletionCallsCount: Int {
|
||||
get { requestCompletionCallsCountLock.withLock { requestCompletionUnderlyingCallsCount } }
|
||||
set { requestCompletionCallsCountLock.withLock { requestCompletionUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var requestCompletionCalled: Bool {
|
||||
return requestCompletionCallsCount > 0
|
||||
}
|
||||
private let requestCompletionReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var requestCompletionUnderlyingReceivedArguments: (transaction: CXTransaction, completion: (Error?) -> Void)?
|
||||
var requestCompletionReceivedArguments: (transaction: CXTransaction, completion: (Error?) -> Void)? {
|
||||
get { requestCompletionReceivedArgumentsLock.withLock { requestCompletionUnderlyingReceivedArguments } }
|
||||
set { requestCompletionReceivedArgumentsLock.withLock { requestCompletionUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let requestCompletionReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var requestCompletionUnderlyingReceivedInvocations: [(transaction: CXTransaction, completion: (Error?) -> Void)] = []
|
||||
var requestCompletionReceivedInvocations: [(transaction: CXTransaction, completion: (Error?) -> Void)] {
|
||||
get { requestCompletionReceivedInvocationsLock.withLock { requestCompletionUnderlyingReceivedInvocations } }
|
||||
set { requestCompletionReceivedInvocationsLock.withLock { requestCompletionUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var requestCompletionClosure: ((CXTransaction, @Sendable @escaping (Error?) -> Void) -> Void)?
|
||||
|
||||
func request(_ transaction: CXTransaction, completion: @Sendable @escaping (Error?) -> Void) {
|
||||
requestCompletionCallsCountLock.withLock { requestCompletionUnderlyingCallsCount += 1 }
|
||||
requestCompletionReceivedArguments = (transaction: transaction, completion: completion)
|
||||
requestCompletionReceivedInvocationsLock.withLock { requestCompletionUnderlyingReceivedInvocations.append((transaction: transaction, completion: completion)) }
|
||||
requestCompletionClosure?(transaction, completion)
|
||||
}
|
||||
}
|
||||
nonisolated class CXProviderMock: CXProviderProtocol, @unchecked Sendable {
|
||||
|
||||
//MARK: - setDelegate
|
||||
@@ -1917,6 +1952,99 @@ nonisolated class CXProviderMock: CXProviderProtocol, @unchecked Sendable {
|
||||
reportNewIncomingCallWithUpdateCompletionReceivedInvocationsLock.withLock { reportNewIncomingCallWithUpdateCompletionUnderlyingReceivedInvocations.append((uuid: uuid, update: update, completion: completion)) }
|
||||
reportNewIncomingCallWithUpdateCompletionClosure?(uuid, update, completion)
|
||||
}
|
||||
//MARK: - reportOutgoingCall
|
||||
|
||||
private let reportOutgoingCallWithStartedConnectingAtCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithStartedConnectingAtUnderlyingCallsCount = 0
|
||||
var reportOutgoingCallWithStartedConnectingAtCallsCount: Int {
|
||||
get { reportOutgoingCallWithStartedConnectingAtCallsCountLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingCallsCount } }
|
||||
set { reportOutgoingCallWithStartedConnectingAtCallsCountLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var reportOutgoingCallWithStartedConnectingAtCalled: Bool {
|
||||
return reportOutgoingCallWithStartedConnectingAtCallsCount > 0
|
||||
}
|
||||
private let reportOutgoingCallWithStartedConnectingAtReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedArguments: (uuid: UUID, startedConnectingAt: Date?)?
|
||||
var reportOutgoingCallWithStartedConnectingAtReceivedArguments: (uuid: UUID, startedConnectingAt: Date?)? {
|
||||
get { reportOutgoingCallWithStartedConnectingAtReceivedArgumentsLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedArguments } }
|
||||
set { reportOutgoingCallWithStartedConnectingAtReceivedArgumentsLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let reportOutgoingCallWithStartedConnectingAtReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedInvocations: [(uuid: UUID, startedConnectingAt: Date?)] = []
|
||||
var reportOutgoingCallWithStartedConnectingAtReceivedInvocations: [(uuid: UUID, startedConnectingAt: Date?)] {
|
||||
get { reportOutgoingCallWithStartedConnectingAtReceivedInvocationsLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedInvocations } }
|
||||
set { reportOutgoingCallWithStartedConnectingAtReceivedInvocationsLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var reportOutgoingCallWithStartedConnectingAtClosure: ((UUID, Date?) -> Void)?
|
||||
|
||||
func reportOutgoingCall(with uuid: UUID, startedConnectingAt: Date?) {
|
||||
reportOutgoingCallWithStartedConnectingAtCallsCountLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingCallsCount += 1 }
|
||||
reportOutgoingCallWithStartedConnectingAtReceivedArguments = (uuid: uuid, startedConnectingAt: startedConnectingAt)
|
||||
reportOutgoingCallWithStartedConnectingAtReceivedInvocationsLock.withLock { reportOutgoingCallWithStartedConnectingAtUnderlyingReceivedInvocations.append((uuid: uuid, startedConnectingAt: startedConnectingAt)) }
|
||||
reportOutgoingCallWithStartedConnectingAtClosure?(uuid, startedConnectingAt)
|
||||
}
|
||||
//MARK: - reportOutgoingCall
|
||||
|
||||
private let reportOutgoingCallWithConnectedAtCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithConnectedAtUnderlyingCallsCount = 0
|
||||
var reportOutgoingCallWithConnectedAtCallsCount: Int {
|
||||
get { reportOutgoingCallWithConnectedAtCallsCountLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingCallsCount } }
|
||||
set { reportOutgoingCallWithConnectedAtCallsCountLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var reportOutgoingCallWithConnectedAtCalled: Bool {
|
||||
return reportOutgoingCallWithConnectedAtCallsCount > 0
|
||||
}
|
||||
private let reportOutgoingCallWithConnectedAtReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithConnectedAtUnderlyingReceivedArguments: (uuid: UUID, connectedAt: Date?)?
|
||||
var reportOutgoingCallWithConnectedAtReceivedArguments: (uuid: UUID, connectedAt: Date?)? {
|
||||
get { reportOutgoingCallWithConnectedAtReceivedArgumentsLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingReceivedArguments } }
|
||||
set { reportOutgoingCallWithConnectedAtReceivedArgumentsLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let reportOutgoingCallWithConnectedAtReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportOutgoingCallWithConnectedAtUnderlyingReceivedInvocations: [(uuid: UUID, connectedAt: Date?)] = []
|
||||
var reportOutgoingCallWithConnectedAtReceivedInvocations: [(uuid: UUID, connectedAt: Date?)] {
|
||||
get { reportOutgoingCallWithConnectedAtReceivedInvocationsLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingReceivedInvocations } }
|
||||
set { reportOutgoingCallWithConnectedAtReceivedInvocationsLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var reportOutgoingCallWithConnectedAtClosure: ((UUID, Date?) -> Void)?
|
||||
|
||||
func reportOutgoingCall(with uuid: UUID, connectedAt: Date?) {
|
||||
reportOutgoingCallWithConnectedAtCallsCountLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingCallsCount += 1 }
|
||||
reportOutgoingCallWithConnectedAtReceivedArguments = (uuid: uuid, connectedAt: connectedAt)
|
||||
reportOutgoingCallWithConnectedAtReceivedInvocationsLock.withLock { reportOutgoingCallWithConnectedAtUnderlyingReceivedInvocations.append((uuid: uuid, connectedAt: connectedAt)) }
|
||||
reportOutgoingCallWithConnectedAtClosure?(uuid, connectedAt)
|
||||
}
|
||||
//MARK: - reportCall
|
||||
|
||||
private let reportCallWithUpdatedCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallWithUpdatedUnderlyingCallsCount = 0
|
||||
var reportCallWithUpdatedCallsCount: Int {
|
||||
get { reportCallWithUpdatedCallsCountLock.withLock { reportCallWithUpdatedUnderlyingCallsCount } }
|
||||
set { reportCallWithUpdatedCallsCountLock.withLock { reportCallWithUpdatedUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var reportCallWithUpdatedCalled: Bool {
|
||||
return reportCallWithUpdatedCallsCount > 0
|
||||
}
|
||||
private let reportCallWithUpdatedReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallWithUpdatedUnderlyingReceivedArguments: (uuid: UUID, update: CXCallUpdate)?
|
||||
var reportCallWithUpdatedReceivedArguments: (uuid: UUID, update: CXCallUpdate)? {
|
||||
get { reportCallWithUpdatedReceivedArgumentsLock.withLock { reportCallWithUpdatedUnderlyingReceivedArguments } }
|
||||
set { reportCallWithUpdatedReceivedArgumentsLock.withLock { reportCallWithUpdatedUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let reportCallWithUpdatedReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallWithUpdatedUnderlyingReceivedInvocations: [(uuid: UUID, update: CXCallUpdate)] = []
|
||||
var reportCallWithUpdatedReceivedInvocations: [(uuid: UUID, update: CXCallUpdate)] {
|
||||
get { reportCallWithUpdatedReceivedInvocationsLock.withLock { reportCallWithUpdatedUnderlyingReceivedInvocations } }
|
||||
set { reportCallWithUpdatedReceivedInvocationsLock.withLock { reportCallWithUpdatedUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var reportCallWithUpdatedClosure: ((UUID, CXCallUpdate) -> Void)?
|
||||
|
||||
func reportCall(with uuid: UUID, updated update: CXCallUpdate) {
|
||||
reportCallWithUpdatedCallsCountLock.withLock { reportCallWithUpdatedUnderlyingCallsCount += 1 }
|
||||
reportCallWithUpdatedReceivedArguments = (uuid: uuid, update: update)
|
||||
reportCallWithUpdatedReceivedInvocationsLock.withLock { reportCallWithUpdatedUnderlyingReceivedInvocations.append((uuid: uuid, update: update)) }
|
||||
reportCallWithUpdatedClosure?(uuid, update)
|
||||
}
|
||||
//MARK: - reportCall
|
||||
|
||||
private let reportCallWithEndedAtReasonCallsCountLock = NSLock()
|
||||
@@ -2453,6 +2581,34 @@ nonisolated class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
|
||||
}
|
||||
nonisolated(unsafe) var underlyingLiveLocationOwnInfoUpdatesPublisher: AnyPublisher<LiveLocationOwnInfoUpdate, Never>!
|
||||
|
||||
//MARK: - makeNativeCallTransport
|
||||
|
||||
private let makeNativeCallTransportCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var makeNativeCallTransportUnderlyingCallsCount = 0
|
||||
var makeNativeCallTransportCallsCount: Int {
|
||||
get { makeNativeCallTransportCallsCountLock.withLock { makeNativeCallTransportUnderlyingCallsCount } }
|
||||
set { makeNativeCallTransportCallsCountLock.withLock { makeNativeCallTransportUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var makeNativeCallTransportCalled: Bool {
|
||||
return makeNativeCallTransportCallsCount > 0
|
||||
}
|
||||
|
||||
private let makeNativeCallTransportReturnValueLock = NSLock()
|
||||
private nonisolated(unsafe) var makeNativeCallTransportUnderlyingReturnValue: ElementCallMatrixTransportProtocol?
|
||||
var makeNativeCallTransportReturnValue: ElementCallMatrixTransportProtocol? {
|
||||
get { makeNativeCallTransportReturnValueLock.withLock { makeNativeCallTransportUnderlyingReturnValue } }
|
||||
set { makeNativeCallTransportReturnValueLock.withLock { makeNativeCallTransportUnderlyingReturnValue = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var makeNativeCallTransportClosure: (() -> ElementCallMatrixTransportProtocol?)?
|
||||
|
||||
func makeNativeCallTransport() -> ElementCallMatrixTransportProtocol? {
|
||||
makeNativeCallTransportCallsCountLock.withLock { makeNativeCallTransportUnderlyingCallsCount += 1 }
|
||||
if let makeNativeCallTransportClosure = makeNativeCallTransportClosure {
|
||||
return makeNativeCallTransportClosure()
|
||||
} else {
|
||||
return makeNativeCallTransportReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - isOnlyDeviceLeft
|
||||
|
||||
private let isOnlyDeviceLeftCallsCountLock = NSLock()
|
||||
@@ -4842,85 +4998,208 @@ nonisolated class ElementCallServiceMock: ElementCallServiceProtocol, @unchecked
|
||||
set(value) { underlyingOngoingCallRoomIDPublisher = value }
|
||||
}
|
||||
nonisolated(unsafe) var underlyingOngoingCallRoomIDPublisher: CurrentValuePublisher<String?, Never>!
|
||||
nonisolated(unsafe) var nativeCallController: ElementCallController?
|
||||
|
||||
//MARK: - setClientProxy
|
||||
//MARK: - setUserSession
|
||||
|
||||
private let setClientProxyCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var setClientProxyUnderlyingCallsCount = 0
|
||||
var setClientProxyCallsCount: Int {
|
||||
get { setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount } }
|
||||
set { setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount = newValue } }
|
||||
private let setUserSessionCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var setUserSessionUnderlyingCallsCount = 0
|
||||
var setUserSessionCallsCount: Int {
|
||||
get { setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount } }
|
||||
set { setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var setClientProxyCalled: Bool {
|
||||
return setClientProxyCallsCount > 0
|
||||
var setUserSessionCalled: Bool {
|
||||
return setUserSessionCallsCount > 0
|
||||
}
|
||||
private let setClientProxyReceivedClientProxyLock = NSLock()
|
||||
private nonisolated(unsafe) var setClientProxyUnderlyingReceivedClientProxy: ClientProxyProtocol?
|
||||
var setClientProxyReceivedClientProxy: ClientProxyProtocol? {
|
||||
get { setClientProxyReceivedClientProxyLock.withLock { setClientProxyUnderlyingReceivedClientProxy } }
|
||||
set { setClientProxyReceivedClientProxyLock.withLock { setClientProxyUnderlyingReceivedClientProxy = newValue } }
|
||||
private let setUserSessionReceivedUserSessionLock = NSLock()
|
||||
private nonisolated(unsafe) var setUserSessionUnderlyingReceivedUserSession: UserSessionProtocol?
|
||||
var setUserSessionReceivedUserSession: UserSessionProtocol? {
|
||||
get { setUserSessionReceivedUserSessionLock.withLock { setUserSessionUnderlyingReceivedUserSession } }
|
||||
set { setUserSessionReceivedUserSessionLock.withLock { setUserSessionUnderlyingReceivedUserSession = newValue } }
|
||||
}
|
||||
private let setClientProxyReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var setClientProxyUnderlyingReceivedInvocations: [ClientProxyProtocol] = []
|
||||
var setClientProxyReceivedInvocations: [ClientProxyProtocol] {
|
||||
get { setClientProxyReceivedInvocationsLock.withLock { setClientProxyUnderlyingReceivedInvocations } }
|
||||
set { setClientProxyReceivedInvocationsLock.withLock { setClientProxyUnderlyingReceivedInvocations = newValue } }
|
||||
private let setUserSessionReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var setUserSessionUnderlyingReceivedInvocations: [UserSessionProtocol?] = []
|
||||
var setUserSessionReceivedInvocations: [UserSessionProtocol?] {
|
||||
get { setUserSessionReceivedInvocationsLock.withLock { setUserSessionUnderlyingReceivedInvocations } }
|
||||
set { setUserSessionReceivedInvocationsLock.withLock { setUserSessionUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var setClientProxyClosure: ((ClientProxyProtocol) -> Void)?
|
||||
nonisolated(unsafe) var setUserSessionClosure: ((UserSessionProtocol?) -> Void)?
|
||||
|
||||
func setClientProxy(_ clientProxy: ClientProxyProtocol) {
|
||||
setClientProxyCallsCountLock.withLock { setClientProxyUnderlyingCallsCount += 1 }
|
||||
setClientProxyReceivedClientProxy = clientProxy
|
||||
setClientProxyReceivedInvocationsLock.withLock { setClientProxyUnderlyingReceivedInvocations.append(clientProxy) }
|
||||
setClientProxyClosure?(clientProxy)
|
||||
func setUserSession(_ userSession: UserSessionProtocol?) {
|
||||
setUserSessionCallsCountLock.withLock { setUserSessionUnderlyingCallsCount += 1 }
|
||||
setUserSessionReceivedUserSession = userSession
|
||||
setUserSessionReceivedInvocationsLock.withLock { setUserSessionUnderlyingReceivedInvocations.append(userSession) }
|
||||
setUserSessionClosure?(userSession)
|
||||
}
|
||||
//MARK: - handleNativeCallRequest
|
||||
|
||||
private let handleNativeCallRequestRoomProxyIsVoiceCallCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingCallsCount = 0
|
||||
var handleNativeCallRequestRoomProxyIsVoiceCallCallsCount: Int {
|
||||
get { handleNativeCallRequestRoomProxyIsVoiceCallCallsCountLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingCallsCount } }
|
||||
set { handleNativeCallRequestRoomProxyIsVoiceCallCallsCountLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var handleNativeCallRequestRoomProxyIsVoiceCallCalled: Bool {
|
||||
return handleNativeCallRequestRoomProxyIsVoiceCallCallsCount > 0
|
||||
}
|
||||
private let handleNativeCallRequestRoomProxyIsVoiceCallReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, isVoiceCall: Bool)?
|
||||
var handleNativeCallRequestRoomProxyIsVoiceCallReceivedArguments: (roomProxy: JoinedRoomProxyProtocol, isVoiceCall: Bool)? {
|
||||
get { handleNativeCallRequestRoomProxyIsVoiceCallReceivedArgumentsLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedArguments } }
|
||||
set { handleNativeCallRequestRoomProxyIsVoiceCallReceivedArgumentsLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let handleNativeCallRequestRoomProxyIsVoiceCallReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, isVoiceCall: Bool)] = []
|
||||
var handleNativeCallRequestRoomProxyIsVoiceCallReceivedInvocations: [(roomProxy: JoinedRoomProxyProtocol, isVoiceCall: Bool)] {
|
||||
get { handleNativeCallRequestRoomProxyIsVoiceCallReceivedInvocationsLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedInvocations } }
|
||||
set { handleNativeCallRequestRoomProxyIsVoiceCallReceivedInvocationsLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
|
||||
private let handleNativeCallRequestRoomProxyIsVoiceCallReturnValueLock = NSLock()
|
||||
private nonisolated(unsafe) var handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReturnValue: Bool!
|
||||
var handleNativeCallRequestRoomProxyIsVoiceCallReturnValue: Bool! {
|
||||
get { handleNativeCallRequestRoomProxyIsVoiceCallReturnValueLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReturnValue } }
|
||||
set { handleNativeCallRequestRoomProxyIsVoiceCallReturnValueLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReturnValue = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var handleNativeCallRequestRoomProxyIsVoiceCallClosure: ((JoinedRoomProxyProtocol, Bool) -> Bool)?
|
||||
|
||||
@discardableResult
|
||||
func handleNativeCallRequest(roomProxy: JoinedRoomProxyProtocol, isVoiceCall: Bool) -> Bool {
|
||||
handleNativeCallRequestRoomProxyIsVoiceCallCallsCountLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingCallsCount += 1 }
|
||||
handleNativeCallRequestRoomProxyIsVoiceCallReceivedArguments = (roomProxy: roomProxy, isVoiceCall: isVoiceCall)
|
||||
handleNativeCallRequestRoomProxyIsVoiceCallReceivedInvocationsLock.withLock { handleNativeCallRequestRoomProxyIsVoiceCallUnderlyingReceivedInvocations.append((roomProxy: roomProxy, isVoiceCall: isVoiceCall)) }
|
||||
if let handleNativeCallRequestRoomProxyIsVoiceCallClosure = handleNativeCallRequestRoomProxyIsVoiceCallClosure {
|
||||
return handleNativeCallRequestRoomProxyIsVoiceCallClosure(roomProxy, isVoiceCall)
|
||||
} else {
|
||||
return handleNativeCallRequestRoomProxyIsVoiceCallReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - minimizeNativeCall
|
||||
|
||||
private let minimizeNativeCallCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var minimizeNativeCallUnderlyingCallsCount = 0
|
||||
var minimizeNativeCallCallsCount: Int {
|
||||
get { minimizeNativeCallCallsCountLock.withLock { minimizeNativeCallUnderlyingCallsCount } }
|
||||
set { minimizeNativeCallCallsCountLock.withLock { minimizeNativeCallUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var minimizeNativeCallCalled: Bool {
|
||||
return minimizeNativeCallCallsCount > 0
|
||||
}
|
||||
nonisolated(unsafe) var minimizeNativeCallClosure: (() -> Void)?
|
||||
|
||||
func minimizeNativeCall() {
|
||||
minimizeNativeCallCallsCountLock.withLock { minimizeNativeCallUnderlyingCallsCount += 1 }
|
||||
minimizeNativeCallClosure?()
|
||||
}
|
||||
//MARK: - restoreNativeCall
|
||||
|
||||
private let restoreNativeCallCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var restoreNativeCallUnderlyingCallsCount = 0
|
||||
var restoreNativeCallCallsCount: Int {
|
||||
get { restoreNativeCallCallsCountLock.withLock { restoreNativeCallUnderlyingCallsCount } }
|
||||
set { restoreNativeCallCallsCountLock.withLock { restoreNativeCallUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var restoreNativeCallCalled: Bool {
|
||||
return restoreNativeCallCallsCount > 0
|
||||
}
|
||||
nonisolated(unsafe) var restoreNativeCallClosure: (() -> Void)?
|
||||
|
||||
func restoreNativeCall() {
|
||||
restoreNativeCallCallsCountLock.withLock { restoreNativeCallUnderlyingCallsCount += 1 }
|
||||
restoreNativeCallClosure?()
|
||||
}
|
||||
//MARK: - setupCallSession
|
||||
|
||||
private let setupCallSessionRoomIDRoomDisplayNameCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount = 0
|
||||
var setupCallSessionRoomIDRoomDisplayNameCallsCount: Int {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount = newValue } }
|
||||
private let setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingCallsCount = 0
|
||||
var setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCount: Int {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingCallsCount } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var setupCallSessionRoomIDRoomDisplayNameCalled: Bool {
|
||||
return setupCallSessionRoomIDRoomDisplayNameCallsCount > 0
|
||||
var setupCallSessionRoomIDRoomDisplayNameIsVideoCalled: Bool {
|
||||
return setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCount > 0
|
||||
}
|
||||
private let setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments: (roomID: String, roomDisplayName: String)?
|
||||
var setupCallSessionRoomIDRoomDisplayNameReceivedArguments: (roomID: String, roomDisplayName: String)? {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedArguments = newValue } }
|
||||
private let setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedArgumentsLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedArguments: (roomID: String, roomDisplayName: String, isVideo: Bool)?
|
||||
var setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedArguments: (roomID: String, roomDisplayName: String, isVideo: Bool)? {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedArguments } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedArgumentsLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedArguments = newValue } }
|
||||
}
|
||||
private let setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations: [(roomID: String, roomDisplayName: String)] = []
|
||||
var setupCallSessionRoomIDRoomDisplayNameReceivedInvocations: [(roomID: String, roomDisplayName: String)] {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations = newValue } }
|
||||
private let setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedInvocations: [(roomID: String, roomDisplayName: String, isVideo: Bool)] = []
|
||||
var setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedInvocations: [(roomID: String, roomDisplayName: String, isVideo: Bool)] {
|
||||
get { setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedInvocations } }
|
||||
set { setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameClosure: ((String, String) async -> Void)?
|
||||
nonisolated(unsafe) var setupCallSessionRoomIDRoomDisplayNameIsVideoClosure: ((String, String, Bool) async -> Void)?
|
||||
|
||||
@concurrent func setupCallSession(roomID: String, roomDisplayName: String) async {
|
||||
setupCallSessionRoomIDRoomDisplayNameCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingCallsCount += 1 }
|
||||
setupCallSessionRoomIDRoomDisplayNameReceivedArguments = (roomID: roomID, roomDisplayName: roomDisplayName)
|
||||
setupCallSessionRoomIDRoomDisplayNameReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameUnderlyingReceivedInvocations.append((roomID: roomID, roomDisplayName: roomDisplayName)) }
|
||||
await setupCallSessionRoomIDRoomDisplayNameClosure?(roomID, roomDisplayName)
|
||||
@concurrent func setupCallSession(roomID: String, roomDisplayName: String, isVideo: Bool) async {
|
||||
setupCallSessionRoomIDRoomDisplayNameIsVideoCallsCountLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingCallsCount += 1 }
|
||||
setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedArguments = (roomID: roomID, roomDisplayName: roomDisplayName, isVideo: isVideo)
|
||||
setupCallSessionRoomIDRoomDisplayNameIsVideoReceivedInvocationsLock.withLock { setupCallSessionRoomIDRoomDisplayNameIsVideoUnderlyingReceivedInvocations.append((roomID: roomID, roomDisplayName: roomDisplayName, isVideo: isVideo)) }
|
||||
await setupCallSessionRoomIDRoomDisplayNameIsVideoClosure?(roomID, roomDisplayName, isVideo)
|
||||
}
|
||||
//MARK: - reportCallSessionConnected
|
||||
|
||||
private let reportCallSessionConnectedRoomIDCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallSessionConnectedRoomIDUnderlyingCallsCount = 0
|
||||
var reportCallSessionConnectedRoomIDCallsCount: Int {
|
||||
get { reportCallSessionConnectedRoomIDCallsCountLock.withLock { reportCallSessionConnectedRoomIDUnderlyingCallsCount } }
|
||||
set { reportCallSessionConnectedRoomIDCallsCountLock.withLock { reportCallSessionConnectedRoomIDUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var reportCallSessionConnectedRoomIDCalled: Bool {
|
||||
return reportCallSessionConnectedRoomIDCallsCount > 0
|
||||
}
|
||||
private let reportCallSessionConnectedRoomIDReceivedRoomIDLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallSessionConnectedRoomIDUnderlyingReceivedRoomID: String?
|
||||
var reportCallSessionConnectedRoomIDReceivedRoomID: String? {
|
||||
get { reportCallSessionConnectedRoomIDReceivedRoomIDLock.withLock { reportCallSessionConnectedRoomIDUnderlyingReceivedRoomID } }
|
||||
set { reportCallSessionConnectedRoomIDReceivedRoomIDLock.withLock { reportCallSessionConnectedRoomIDUnderlyingReceivedRoomID = newValue } }
|
||||
}
|
||||
private let reportCallSessionConnectedRoomIDReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var reportCallSessionConnectedRoomIDUnderlyingReceivedInvocations: [String] = []
|
||||
var reportCallSessionConnectedRoomIDReceivedInvocations: [String] {
|
||||
get { reportCallSessionConnectedRoomIDReceivedInvocationsLock.withLock { reportCallSessionConnectedRoomIDUnderlyingReceivedInvocations } }
|
||||
set { reportCallSessionConnectedRoomIDReceivedInvocationsLock.withLock { reportCallSessionConnectedRoomIDUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var reportCallSessionConnectedRoomIDClosure: ((String) -> Void)?
|
||||
|
||||
func reportCallSessionConnected(roomID: String) {
|
||||
reportCallSessionConnectedRoomIDCallsCountLock.withLock { reportCallSessionConnectedRoomIDUnderlyingCallsCount += 1 }
|
||||
reportCallSessionConnectedRoomIDReceivedRoomID = roomID
|
||||
reportCallSessionConnectedRoomIDReceivedInvocationsLock.withLock { reportCallSessionConnectedRoomIDUnderlyingReceivedInvocations.append(roomID) }
|
||||
reportCallSessionConnectedRoomIDClosure?(roomID)
|
||||
}
|
||||
//MARK: - tearDownCallSession
|
||||
|
||||
private let tearDownCallSessionCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var tearDownCallSessionUnderlyingCallsCount = 0
|
||||
var tearDownCallSessionCallsCount: Int {
|
||||
get { tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount } }
|
||||
set { tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount = newValue } }
|
||||
private let tearDownCallSessionRoomIDCallsCountLock = NSLock()
|
||||
private nonisolated(unsafe) var tearDownCallSessionRoomIDUnderlyingCallsCount = 0
|
||||
var tearDownCallSessionRoomIDCallsCount: Int {
|
||||
get { tearDownCallSessionRoomIDCallsCountLock.withLock { tearDownCallSessionRoomIDUnderlyingCallsCount } }
|
||||
set { tearDownCallSessionRoomIDCallsCountLock.withLock { tearDownCallSessionRoomIDUnderlyingCallsCount = newValue } }
|
||||
}
|
||||
var tearDownCallSessionCalled: Bool {
|
||||
return tearDownCallSessionCallsCount > 0
|
||||
var tearDownCallSessionRoomIDCalled: Bool {
|
||||
return tearDownCallSessionRoomIDCallsCount > 0
|
||||
}
|
||||
nonisolated(unsafe) var tearDownCallSessionClosure: (() -> Void)?
|
||||
private let tearDownCallSessionRoomIDReceivedRoomIDLock = NSLock()
|
||||
private nonisolated(unsafe) var tearDownCallSessionRoomIDUnderlyingReceivedRoomID: String?
|
||||
var tearDownCallSessionRoomIDReceivedRoomID: String? {
|
||||
get { tearDownCallSessionRoomIDReceivedRoomIDLock.withLock { tearDownCallSessionRoomIDUnderlyingReceivedRoomID } }
|
||||
set { tearDownCallSessionRoomIDReceivedRoomIDLock.withLock { tearDownCallSessionRoomIDUnderlyingReceivedRoomID = newValue } }
|
||||
}
|
||||
private let tearDownCallSessionRoomIDReceivedInvocationsLock = NSLock()
|
||||
private nonisolated(unsafe) var tearDownCallSessionRoomIDUnderlyingReceivedInvocations: [String] = []
|
||||
var tearDownCallSessionRoomIDReceivedInvocations: [String] {
|
||||
get { tearDownCallSessionRoomIDReceivedInvocationsLock.withLock { tearDownCallSessionRoomIDUnderlyingReceivedInvocations } }
|
||||
set { tearDownCallSessionRoomIDReceivedInvocationsLock.withLock { tearDownCallSessionRoomIDUnderlyingReceivedInvocations = newValue } }
|
||||
}
|
||||
nonisolated(unsafe) var tearDownCallSessionRoomIDClosure: ((String) -> Void)?
|
||||
|
||||
func tearDownCallSession() {
|
||||
tearDownCallSessionCallsCountLock.withLock { tearDownCallSessionUnderlyingCallsCount += 1 }
|
||||
tearDownCallSessionClosure?()
|
||||
func tearDownCallSession(roomID: String) {
|
||||
tearDownCallSessionRoomIDCallsCountLock.withLock { tearDownCallSessionRoomIDUnderlyingCallsCount += 1 }
|
||||
tearDownCallSessionRoomIDReceivedRoomID = roomID
|
||||
tearDownCallSessionRoomIDReceivedInvocationsLock.withLock { tearDownCallSessionRoomIDUnderlyingReceivedInvocations.append(roomID) }
|
||||
tearDownCallSessionRoomIDClosure?(roomID)
|
||||
}
|
||||
//MARK: - setAudioEnabled
|
||||
|
||||
|
||||
Reference in New Issue
Block a user