usb: only set the usb connect activity when it is initially created
What changed, and why it matters
This is a small user-interface fix in Blockstream Jade's USB storage mode. It moves one line of code so that the 'please plug in USB device' screen is only set as the current screen when it is first created, not repeatedly every time the code checks for events. The change appears to prevent the screen from being reset/redrawn unnecessarily after help text is shown. There is no direct evidence in the commit that this is a security fix.
Treat as a routine UI/UX fix. No immediate security action required. If auditing, verify that gui_set_current_activity behavior after help-screen dismissal does not introduce race conditions or unexpected UI states, though the change appears to reduce rather than increase such risk.
Security signals we found
No security-relevant keywords in commit title or message
Change is purely UI flow / activity management
No input validation, memory handling, or cryptographic changes
No references to vulnerabilities, CVEs, or security reports
Evidence from the diff
In main/usbhmsc/usbmode.c, the call to gui_set_current_activity(act_prompt) is moved inside the block that creates the activity, rather than being called on every iteration of the event-handling loop. The commit message states the activity is ‘already re-set for us after help is shown.’ This suggests the previous behavior caused the prompt activity to be reshown/reasserted when returning from a help screen, which was redundant and possibly caused UI flicker or incorrect focus. The patch is a one-line relocation with no obvious security-relevant change.
Changed components
Blockstream Jade firmwaremain/usbhmsc/usbmode.cUSB mass-storage host mode UI promptInspect captured patch +1 / −1
diff --git a/main/usbhmsc/usbmode.c b/main/usbhmsc/usbmode.c
index 01ee6e3..1592588 100644
--- a/main/usbhmsc/usbmode.c
+++ b/main/usbhmsc/usbmode.c
@@ -358,12 +358,12 @@ static bool handle_usbstorage_action(const char* title, usbstorage_action_fn_t u
// Prompt user to plug a usbstorage device
act_prompt = make_usb_connect_activity(title);
+ gui_set_current_activity(act_prompt);
}
// Handle any events from that screen
if (act_prompt) {
int32_t ev_id;
- gui_set_current_activity(act_prompt);
if (gui_activity_wait_event(
act_prompt, GUI_BUTTON_EVENT, ESP_EVENT_ANY_ID, NULL, &ev_id, NULL, 100 / portTICK_PERIOD_MS)) {
Why this scored 16/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.