mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 16:48:35 -07:00
Prevent autolock based on RPC too --nobuild
This commit is contained in:
@@ -138,8 +138,13 @@ static bool desktop_custom_event_callback(void* context, uint32_t event) {
|
||||
} else if(event == DesktopGlobalAutoLock) {
|
||||
if(!desktop->app_running && !desktop->locked) {
|
||||
// Disable AutoLock if usb_inhibit_autolock option enabled and device have active USB session.
|
||||
if((desktop->settings.usb_inhibit_auto_lock) && (furi_hal_usb_is_locked())) {
|
||||
return true;
|
||||
if(desktop->settings.usb_inhibit_auto_lock) {
|
||||
Rpc* rpc = furi_record_open(RECORD_RPC);
|
||||
bool inhibit_auto_lock = furi_hal_usb_is_locked() || rpc_get_sessions_count(rpc);
|
||||
furi_record_close(RECORD_RPC);
|
||||
if(inhibit_auto_lock) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
desktop_lock(desktop, desktop->settings.auto_lock_with_pin);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user