summaryrefslogtreecommitdiffhomepage
path: root/ios/PacketTunnel/DeviceCheck/DeviceStateAccessor.swift
blob: e970c197c5e170c2da9f47af758fc0188cea9965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
//  DeviceStateAccessor.swift
//  PacketTunnel
//
//  Created by pronebird on 30/05/2023.
//  Copyright © 2025 Mullvad VPN AB. All rights reserved.
//

import Foundation
import MullvadSettings
import MullvadTypes

/// An object that provides access to `DeviceState` used by `DeviceCheckOperation`.
struct DeviceStateAccessor: DeviceStateAccessorProtocol {
    func read() throws -> DeviceState {
        try SettingsManager.readDeviceState()
    }

    func write(_ deviceState: DeviceState) throws {
        try SettingsManager.writeDeviceState(deviceState)
    }
}