refactor(core): close other workflows when starting `ProgressLayout`
What changed, and why it matters
This commit moves the responsibility for closing other on-screen workflows into the ProgressLayout class itself, rather than having each individual feature call a separate 'close others' function. It is a code cleanup (refactor) and does not appear to introduce or fix a security vulnerability. The change makes UI behavior more consistent but does not change what the device ultimately allows.
No security action required. Treat as normal code-quality refactor during review.
Security signals we found
workflow.close_others() moved into ProgressLayout.start()
no new authorization or validation logic introduced
no change to message parsing, cryptography, or memory handling
commit title and message label it as a refactor with no changelog
Evidence from the diff
The patch removes explicit workflow.close_others() calls from bitcoin sign_tx progress, mnemonic progress, and language-change code, and instead places a single workflow.close_others() call inside ProgressLayout.start(). The comment ‘request exclusive UI access’ indicates the intent is to ensure the progress layout has exclusive screen access. This is a consolidation of existing behavior, not a change in security semantics.
Changed components
core/src/trezor/ui/__init__.pycore/src/apps/bitcoin/sign_tx/progress.pycore/src/apps/common/mnemonic.pycore/src/apps/management/change_language.pyInspect captured patch +4 / −8
diff --git a/core/src/apps/bitcoin/sign_tx/progress.py b/core/src/apps/bitcoin/sign_tx/progress.py
index 90d15237..362963ac 100644
--- a/core/src/apps/bitcoin/sign_tx/progress.py
+++ b/core/src/apps/bitcoin/sign_tx/progress.py
@@ -109,11 +109,10 @@ class Progress:
self.report()
def report_init(self) -> None:
- from trezor import TR, workflow
+ from trezor import TR
from trezor.ui.layouts.progress import bitcoin_progress, coinjoin_progress
progress_layout = coinjoin_progress if self.is_coinjoin else bitcoin_progress
- workflow.close_others()
text = (
TR.progress__signing_transaction
if self.signing
diff --git a/core/src/apps/common/mnemonic.py b/core/src/apps/common/mnemonic.py
index 0fa7b79f..64b8b170 100644
--- a/core/src/apps/common/mnemonic.py
+++ b/core/src/apps/common/mnemonic.py
@@ -107,14 +107,10 @@ _progress_obj: ProgressLayout | None = None
def _start_progress() -> None:
- from trezor import workflow
from trezor.ui.layouts.progress import progress
global _progress_obj
- # Because we are drawing to the screen manually, without a layout, we
- # should make sure that no other layout is running.
- workflow.close_others()
_progress_obj = progress()
diff --git a/core/src/apps/management/change_language.py b/core/src/apps/management/change_language.py
index b5de25a8..06d9fc2f 100644
--- a/core/src/apps/management/change_language.py
+++ b/core/src/apps/management/change_language.py
@@ -11,11 +11,10 @@ if TYPE_CHECKING:
async def change_language(msg: ChangeLanguage) -> Success:
- from trezor import utils, workflow
+ from trezor import utils
from trezor.messages import Success
from trezor.ui.layouts.progress import progress
- workflow.close_others()
loader: ProgressLayout | None = None
def report(value: int) -> None:
diff --git a/core/src/trezor/ui/__init__.py b/core/src/trezor/ui/__init__.py
index 8d301289..ffd042d8 100644
--- a/core/src/trezor/ui/__init__.py
+++ b/core/src/trezor/ui/__init__.py
@@ -568,6 +568,8 @@ class ProgressLayout:
self.value = value
def start(self) -> None:
+ workflow.close_others() # request exclusive UI access
+
if CURRENT_LAYOUT is not self and CURRENT_LAYOUT is not None:
CURRENT_LAYOUT.stop()
Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.