NodeRestartTracker

class NodeRestartTracker(scope: CoroutineScope)(source)

Tracks a window in which the locally connected node is expected to restart (a config save the firmware applies with a reboot, or an explicit reboot command). While the window is open, an observed transport disconnect is the expected consequence of the restart — the UI presents "restarting" instead of the alarming disconnected state, and the foreground-service notification stays on a connecting presentation.

The window closes when the node completes its post-reboot config handshake (onConnected) or after DEFAULT_WINDOW if the node never comes back — after that, a persisting disconnect is a real problem and is shown as one.

Constructors

Link copied to clipboard
constructor(scope: CoroutineScope)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val restartExpected: StateFlow<Boolean>

True while a node restart (and its transport disconnect) is expected.

Functions

Link copied to clipboard
fun expectRestart(window: Duration = DEFAULT_WINDOW)

Opens (or extends) the expected-restart window. Call at the moment the restart-causing action is sent.

Link copied to clipboard

Closes the window; call when the node is fully back online (config handshake complete).