mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fixes #2707 - Prevent the app from locking while recording a voice message
This commit is contained in:
committed by
Stefan Ceriu
parent
effe3b6a9b
commit
1e810f91ff
@@ -748,16 +748,16 @@ class AppLockServiceMock: AppLockServiceProtocol {
|
||||
}
|
||||
}
|
||||
class AppMediatorMock: AppMediatorProtocol {
|
||||
var backgroundTimeRemaining: TimeInterval {
|
||||
get { return underlyingBackgroundTimeRemaining }
|
||||
set(value) { underlyingBackgroundTimeRemaining = value }
|
||||
}
|
||||
var underlyingBackgroundTimeRemaining: TimeInterval!
|
||||
var appState: UIApplication.State {
|
||||
get { return underlyingAppState }
|
||||
set(value) { underlyingAppState = value }
|
||||
}
|
||||
var underlyingAppState: UIApplication.State!
|
||||
var backgroundTimeRemaining: TimeInterval {
|
||||
get { return underlyingBackgroundTimeRemaining }
|
||||
set(value) { underlyingBackgroundTimeRemaining = value }
|
||||
}
|
||||
var underlyingBackgroundTimeRemaining: TimeInterval!
|
||||
|
||||
//MARK: - beginBackgroundTask
|
||||
|
||||
@@ -936,6 +936,45 @@ class AppMediatorMock: AppMediatorProtocol {
|
||||
openAppSettingsCallsCount += 1
|
||||
openAppSettingsClosure?()
|
||||
}
|
||||
//MARK: - setIdleTimerDisabled
|
||||
|
||||
var setIdleTimerDisabledUnderlyingCallsCount = 0
|
||||
var setIdleTimerDisabledCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return setIdleTimerDisabledUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = setIdleTimerDisabledUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
setIdleTimerDisabledUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
setIdleTimerDisabledUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var setIdleTimerDisabledCalled: Bool {
|
||||
return setIdleTimerDisabledCallsCount > 0
|
||||
}
|
||||
var setIdleTimerDisabledReceivedDisabled: Bool?
|
||||
var setIdleTimerDisabledReceivedInvocations: [Bool] = []
|
||||
var setIdleTimerDisabledClosure: ((Bool) -> Void)?
|
||||
|
||||
func setIdleTimerDisabled(_ disabled: Bool) {
|
||||
setIdleTimerDisabledCallsCount += 1
|
||||
setIdleTimerDisabledReceivedDisabled = disabled
|
||||
setIdleTimerDisabledReceivedInvocations.append(disabled)
|
||||
setIdleTimerDisabledClosure?(disabled)
|
||||
}
|
||||
}
|
||||
class AudioConverterMock: AudioConverterProtocol {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user