mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
core: rename close_default to a more appropriate kill_default
This commit is contained in:
parent
ca484b2c06
commit
a3930d4bdb
@ -59,7 +59,7 @@ def _start_progress() -> None:
|
|||||||
# Because we are drawing to the screen manually, without a layout, we
|
# Because we are drawing to the screen manually, without a layout, we
|
||||||
# should make sure that no other layout is running. At this point, only
|
# should make sure that no other layout is running. At this point, only
|
||||||
# the homescreen should be on, so shut it down.
|
# the homescreen should be on, so shut it down.
|
||||||
workflow.close_default()
|
workflow.kill_default()
|
||||||
ui.backlight_fade(ui.BACKLIGHT_DIM)
|
ui.backlight_fade(ui.BACKLIGHT_DIM)
|
||||||
ui.display.clear()
|
ui.display.clear()
|
||||||
ui.header("Please wait")
|
ui.header("Please wait")
|
||||||
|
@ -79,9 +79,15 @@ def replace_default(constructor: Callable[[], loop.Task]) -> None:
|
|||||||
loop.finalize(default_task, None) # TODO: why not close_default()
|
loop.finalize(default_task, None) # TODO: why not close_default()
|
||||||
start_default(constructor)
|
start_default(constructor)
|
||||||
|
|
||||||
|
def kill_default() -> None:
|
||||||
|
"""Forcefully shut down default task.
|
||||||
|
|
||||||
def close_default() -> None:
|
The purpose of the call is to prevent the default task from interfering with
|
||||||
"""Explicitly close the default workflow task."""
|
a synchronous layout-less workflow (e.g., the progress bar in `mnemonic.get_seed`).
|
||||||
|
|
||||||
|
This function should only be called from a workflow registered with `on_start`.
|
||||||
|
Otherwise the default will be restarted immediately.
|
||||||
|
"""
|
||||||
if default_task:
|
if default_task:
|
||||||
if __debug__:
|
if __debug__:
|
||||||
log.debug(__name__, "close default")
|
log.debug(__name__, "close default")
|
||||||
|
Loading…
Reference in New Issue
Block a user