package com.peachpasswords.sync import kotlinx.coroutines.CompletableDeferred /** * The user's SAS decision, handed to the UI and awaited by the live pairing * session. * * The handler blocks inside the connection while the two screens are compared, * so the decision has to reach it out of band rather than as a return value. * * Lived in the retired LAN `CodePairingServer` until relay-only pairing * (docs/sync-lan-retirement.md); it was never LAN-specific. */ class PairingSession internal constructor() { private val decision = CompletableDeferred() fun confirm(matches: Boolean) { decision.complete(matches) } internal suspend fun await(): Boolean = decision.await() }