fix(core): restore driver setting after wake up
What changed, and why it matters
This commit fixes a bug where a Trezor hardware wallet does not restore certain hardware settings after waking from sleep. Specifically, after the device wakes up, it now reapplies the screen rotation, haptic feedback, and RGB LED settings that the user had configured. Without this fix, those settings could be left in an unintended state following suspend/resume, which could confuse the user or subtly alter the device's behavior.
Treat as a low-severity reliability fix. Review whether any other drivers or security-relevant settings (e.g., brightness, auto-lock timer, secure-element state) are also not restored after suspend. No immediate security response appears necessary based solely on this diff.
Security signals we found
State inconsistency after device suspend/resume
UI/UX setting not restored could lead to confused-deputy or spoofing-like conditions
No explicit security claim in commit message
Evidence from the diff
In core/src/apps/common/lock_manager.py, the wake-up path in lock_manager was missing driver reconfiguration after suspend_device(). The patch imports display and, after suspend_device() returns, restores display.orientation() from storage_device.get_rotation(), re-enables haptic feedback if USE_HAPTIC, and re-enables RGB LED if USE_RGB_LED. This is a state-consistency fix for the suspend/resume lifecycle.
Changed components
core/src/apps/common/lock_manager.pyTrezor Core lock/suspend managerDisplay orientation driverHaptic feedback driverRGB LED driverInspect captured patch +8 / −1
diff --git a/core/src/apps/common/lock_manager.py b/core/src/apps/common/lock_manager.py
index c71455281..8711448d1 100644
--- a/core/src/apps/common/lock_manager.py
+++ b/core/src/apps/common/lock_manager.py
@@ -60,7 +60,7 @@ else:
The function will only return after Trezor has woken up.
"""
- from trezor.ui import CURRENT_LAYOUT
+ from trezor.ui import CURRENT_LAYOUT, display
global _SHOULD_SUSPEND
@@ -69,6 +69,13 @@ else:
# suspend the device
suspend_device()
+ # reconfigure drivers
+ display.orientation(storage_device.get_rotation())
+ if utils.USE_HAPTIC:
+ io.haptic.haptic_set_enabled(storage_device.get_haptic_feedback())
+ if utils.USE_RGB_LED:
+ io.rgb_led.rgb_led_set_enabled(storage_device.get_rgb_led())
+
# redraw the screen and touch idle timer
workflow.idle_timer.touch()
if CURRENT_LAYOUT is not None:
Why this scored 45/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.