mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Ensure that the current user is the device owner before linking a new device. (#5773)
This commit is contained in:
@@ -25,15 +25,26 @@ nonisolated class LAContextMock: LAContext {
|
||||
internalEvaluatedPolicyDomainStateValue
|
||||
}
|
||||
|
||||
var canEvaluatePolicyReturnValue: Bool?
|
||||
override func canEvaluatePolicy(_ policy: LAPolicy, error: NSErrorPointer) -> Bool {
|
||||
let result = super.canEvaluatePolicy(policy, error: error)
|
||||
let result = canEvaluatePolicyReturnValue ?? super.canEvaluatePolicy(policy, error: error)
|
||||
updateInternalValues()
|
||||
return result
|
||||
}
|
||||
|
||||
var evaluatePolicyReturnValue: Bool!
|
||||
var evaluatePolicyThrowableError: Error?
|
||||
var evaluatePolicyCallsCount = 0
|
||||
var evaluatePolicyCalled: Bool {
|
||||
evaluatePolicyCallsCount > 0
|
||||
}
|
||||
|
||||
override func evaluatePolicy(_ policy: LAPolicy, localizedReason: String) async throws -> Bool {
|
||||
evaluatePolicyCallsCount += 1
|
||||
updateInternalValues()
|
||||
if let evaluatePolicyThrowableError {
|
||||
throw evaluatePolicyThrowableError
|
||||
}
|
||||
return evaluatePolicyReturnValue
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user