mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 13:28:36 -07:00
Desktop: Fix PIN locked with no PIN set edge case
This commit is contained in:
@@ -13,5 +13,6 @@
|
||||
- Desktop:
|
||||
- Fix disabling keybinds (by @Willy-JL)
|
||||
- Sanity check PIN length for good measure (by @Willy-JL)
|
||||
- Fix PIN locked with no PIN set edge case (by @Willy-JL)
|
||||
- Settings: Fix duplicates in Power Settings when opening submenus (by @Willy-JL)
|
||||
- RGB Backlight: Fix config migration (by @Willy-JL)
|
||||
|
||||
@@ -384,20 +384,20 @@ void desktop_lock(Desktop* desktop, bool with_pin) {
|
||||
furi_assert(!desktop->locked);
|
||||
|
||||
with_pin = with_pin && desktop_pin_code_is_set();
|
||||
if(!furi_hal_rtc_is_flag_set(FuriHalRtcFlagLock)) {
|
||||
if(with_pin) {
|
||||
furi_hal_rtc_set_flag(FuriHalRtcFlagLock);
|
||||
} else {
|
||||
furi_hal_rtc_reset_flag(FuriHalRtcFlagLock);
|
||||
furi_hal_rtc_set_pin_fails(0);
|
||||
}
|
||||
|
||||
if(with_pin) {
|
||||
furi_hal_rtc_set_flag(FuriHalRtcFlagLock);
|
||||
if(!momentum_settings.allow_locked_rpc_commands) {
|
||||
Cli* cli = furi_record_open(RECORD_CLI);
|
||||
cli_session_close(cli);
|
||||
furi_record_close(RECORD_CLI);
|
||||
Bt* bt = furi_record_open(RECORD_BT);
|
||||
bt_close_rpc_connection(bt);
|
||||
furi_record_close(RECORD_BT);
|
||||
}
|
||||
if(with_pin && !momentum_settings.allow_locked_rpc_commands) {
|
||||
Cli* cli = furi_record_open(RECORD_CLI);
|
||||
cli_session_close(cli);
|
||||
furi_record_close(RECORD_CLI);
|
||||
Bt* bt = furi_record_open(RECORD_BT);
|
||||
bt_close_rpc_connection(bt);
|
||||
furi_record_close(RECORD_BT);
|
||||
}
|
||||
|
||||
desktop_auto_lock_inhibit(desktop);
|
||||
|
||||
Reference in New Issue
Block a user