SIGN IN SIGN UP

refactor(device): type the host-switch monitor's stop reason

`monitor_host_switch` returned `(Option<u8>, bool)`: the requested host, and
whether teardown may still write through the channel that armed the session.
It is the untyped sibling of capture's `CaptureStop`, and its one caller had
to know what the bool meant.

It returns `HostSwitchStop { Pressed(u8), Shutdown, ChannelChanged }` now.
`Shutdown` is only produced while inventory still publishes the channel, as
capture's `stop_for_current_publication` does; a lost keyboard, a dropped stop
sender, a closed registry and a retired publication are all `ChannelChanged`,
the cases where the bool was false. The session derives "may reuse the armed
channel" from the reason.

One sampling point moves: for a press, whether the channel is still current is
now read by the session right after the monitor returns rather than inside
the monitor's press arm. No await separates the two, and the only way they
could differ is a registry write from another thread landing in between, which
the old read was exposed to as well.

A table test pins the mapping for a current channel: graceful stop, lost
device, dropped stop sender, and a press.
A
AprilNEA committed
51f4117e4bdd34c9878aa8ad24de207a574d45be
Parent: f412a1a