trezor-firmware
trezor-firmware copied to clipboard
Add busy screen
This PR implements a new SetBusy message in core which causes Trezor T to show a "Do not disconnect" screen instead of the standard homescreen or lockscreen. Suite will need to display this screen at the moment before it commits to participate in a CoinJoin round. The message should appear for about 2 minutes, after which the CoinJoin transaction will be signed. During these two minutes Trezor is just waiting for the signing phase. It is possible for other operations to be called, but UI workflows should be discouraged, because if the UI workflow is running when Suite needs to sign the CoinJoin, then the workflow will be interrupted. Applications should check the busy parameter in Features and prevent the user from launching a UI workflow if busy == True, e.g. by disabling the "Receive" button in Suite.
The message has an optional parameter expiry_ms that sets the time after which the "Do not disconnect" screen will automatically disappear. This is to prevent the message from appearing on the Trezor forever in case the desktop app shuts down in the middle of the CoinJoin workflow. Applications should explicitly hide the busy screen when the workflow is complete by calling SetBusy with expiry_ms=0 or not set.
In the future we can add an enum to SetBusy which will indicate the reason for the busy state. Right now it only makes sense to show CoinJoin as the reason.
