mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 06:48:16 +00:00
fsm: allow auto-lock delay configuration
This commit is contained in:
parent
987b686f63
commit
159df8d24f
@ -635,7 +635,8 @@ void fsm_msgClearSession(ClearSession *msg)
|
||||
|
||||
void fsm_msgApplySettings(ApplySettings *msg)
|
||||
{
|
||||
CHECK_PARAM(msg->has_label || msg->has_language || msg->has_use_passphrase || msg->has_homescreen, _("No setting provided"));
|
||||
CHECK_PARAM(msg->has_label || msg->has_language || msg->has_use_passphrase || msg->has_homescreen || msg->has_auto_lock_delay_ms,
|
||||
_("No setting provided"));
|
||||
|
||||
CHECK_PIN
|
||||
|
||||
@ -672,6 +673,15 @@ void fsm_msgApplySettings(ApplySettings *msg)
|
||||
}
|
||||
}
|
||||
|
||||
if (msg->has_auto_lock_delay_ms) {
|
||||
layoutDialogSwipe(&bmp_icon_question, _("Cancel"), _("Confirm"), NULL, _("Do you really want to"), _("change auto-lock"), _("delay?"), NULL, NULL, NULL);
|
||||
if (!protectButton(ButtonRequestType_ButtonRequest_ProtectCall, false)) {
|
||||
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);
|
||||
layoutHome();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (msg->has_label) {
|
||||
storage_setLabel(msg->label);
|
||||
}
|
||||
@ -684,6 +694,9 @@ void fsm_msgApplySettings(ApplySettings *msg)
|
||||
if (msg->has_homescreen) {
|
||||
storage_setHomescreen(msg->homescreen.bytes, msg->homescreen.size);
|
||||
}
|
||||
if (msg->has_auto_lock_delay_ms) {
|
||||
storage_setAutoLockDelayMs(msg->auto_lock_delay_ms);
|
||||
}
|
||||
storage_update();
|
||||
fsm_sendSuccess(_("Settings applied"));
|
||||
layoutHome();
|
||||
|
2
vendor/trezor-common
vendored
2
vendor/trezor-common
vendored
@ -1 +1 @@
|
||||
Subproject commit 66a85673ed303f2cf48bdb3d027adbc7e8464364
|
||||
Subproject commit 260747dfa44ab77cd1e9f27f16db116eed0b45fc
|
Loading…
Reference in New Issue
Block a user