fix(core): make lock_manager repaint the screen properly after resume from suspend
What changed, and why it matters
This commit fixes a screen-repainting bug in the Trezor hardware wallet's lock/suspend feature. After the device wakes from sleep, it now fades the backlight back in and repaints the screen correctly, instead of relying on an older autodim-clear routine that could leave the display in a stale or partially drawn state. There is no direct evidence in the commit that this is a security vulnerability, but incorrect screen state after resume could in theory mislead a user about what the device is showing or asking them to confirm.
Treat as a normal bugfix. No urgent security action is indicated by the commit itself. If reviewing for security, verify that repaint() correctly restores the full trusted UI state and that no sensitive screen content from before suspend can persist or be misrendered after wake.
Security signals we found
UI state inconsistency after resume from suspend
Removal of autodim_clear routine that may have left display stale
Potential for user confusion about on-screen prompts after wake
No explicit security claim in commit or references
Evidence from the diff
The change is in core/src/apps/common/lock_manager.py. It removes the import of autodim_clear and replaces the post-suspend wakeup path: instead of calling autodim_clear() and then layout.request_complete_repaint(), it now fades the backlight to BacklightLevels.NONE before suspend, and after a button wakeup calls CURRENT_LAYOUT.repaint() directly. The commit message frames this as a UI fix for proper repainting after resume from suspend. No security impact is stated by the vendor.
Changed components
core/src/apps/common/lock_manager.pyTrezor Core suspend/resume flowTrezor display/backlight managementInspect captured patch +6 / −3
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index f1ea13bd5..b12357f4b 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -8,7 +8,7 @@ from trezor.wire.message_handler import filters, remove_filter
if utils.USE_POWER_MANAGER:
from trezor import io
- from trezor.power_management.autodim import autodim_display, autodim_clear
+ from trezor.power_management.autodim import autodim_display
from trezor.power_management.suspend import suspend_device
if TYPE_CHECKING:
@@ -59,16 +59,19 @@ else:
The function will only return after Trezor has woken up.
"""
from trezor.ui import CURRENT_LAYOUT
+ from trezorui_api import BacklightLevels, backlight_fade
global _SHOULD_SUSPEND
+ # fadeout the screen
+ backlight_fade(BacklightLevels.NONE)
+ # suspend the device
wakeup_flag = suspend_device()
if wakeup_flag == io.pm.WAKEUP_FLAG_BUTTON:
- autodim_clear()
workflow.idle_timer.touch()
if CURRENT_LAYOUT is not None:
- CURRENT_LAYOUT.layout.request_complete_repaint()
+ CURRENT_LAYOUT.repaint()
_SHOULD_SUSPEND = False
set_homescreen()
Why this scored 19/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.