[feat] add privacy unlock controls and remote relocking

This commit is contained in:
dijunkun
2026-10-27 10:22:25 +08:00
parent d1e4a31efb
commit ea3a2e1faa
41 changed files with 470 additions and 72 deletions
@@ -1106,12 +1106,14 @@ final class RemoteSessionModel: NSObject, ObservableObject, CrossDeskRTCBridgeDe
privacyTimer = timer
}
func togglePrivacyScreen() {
func lockPrivacyScreen() { sendPrivacyScreen(lock: true) }
func togglePrivacyScreen() { sendPrivacyScreen(lock: false) }
private func sendPrivacyScreen(lock: Bool) {
guard hasNetworkConsent, isConnected else { return }
privacyClock = ProcessInfo.processInfo.systemUptime
let enable = !privacyScreen.active
guard let request = privacyScreen.begin(at: privacyClock) else { return }
bridge.sendPrivacyCommand(enable, blockLocalInput: true, requestID: request)
guard let request = privacyScreen.begin(at: privacyClock, lock: lock) else { return }
bridge.sendPrivacyCommand(enable, lock: lock, blockLocalInput: true, requestID: request)
}
func rtcBridge(_ bridge: CrossDeskRTCBridge, didReceivePrivacyStatus data: Data) {