From 7eeb60e17ecd31b964cdc169f60ae314c6e9831d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=82=E3=81=8F?= <alleteam@gmail.com> Date: Wed, 3 Jan 2024 22:00:56 +0900 Subject: [PATCH 1/2] Desktop: fix rpc unlock on pin input screen (#3334) --- applications/services/desktop/desktop.c | 2 +- applications/services/desktop/scenes/desktop_scene_locked.c | 1 + applications/services/desktop/scenes/desktop_scene_pin_input.c | 1 + applications/services/desktop/views/desktop_events.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/applications/services/desktop/desktop.c b/applications/services/desktop/desktop.c index 547883e9a..7a49dd51e 100644 --- a/applications/services/desktop/desktop.c +++ b/applications/services/desktop/desktop.c @@ -414,7 +414,7 @@ bool desktop_api_is_locked(Desktop* instance) { void desktop_api_unlock(Desktop* instance) { furi_assert(instance); - view_dispatcher_send_custom_event(instance->view_dispatcher, DesktopLockedEventUnlocked); + view_dispatcher_send_custom_event(instance->view_dispatcher, DesktopGlobalApiUnlock); } FuriPubSub* desktop_api_get_status_pubsub(Desktop* instance) { diff --git a/applications/services/desktop/scenes/desktop_scene_locked.c b/applications/services/desktop/scenes/desktop_scene_locked.c index 034eedb8a..c4cd5748f 100644 --- a/applications/services/desktop/scenes/desktop_scene_locked.c +++ b/applications/services/desktop/scenes/desktop_scene_locked.c @@ -83,6 +83,7 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) { if(event.type == SceneManagerEventTypeCustom) { switch(event.event) { case DesktopLockedEventUnlocked: + case DesktopGlobalApiUnlock: desktop_unlock(desktop); consumed = true; break; diff --git a/applications/services/desktop/scenes/desktop_scene_pin_input.c b/applications/services/desktop/scenes/desktop_scene_pin_input.c index 0e248def6..a21c59e38 100644 --- a/applications/services/desktop/scenes/desktop_scene_pin_input.c +++ b/applications/services/desktop/scenes/desktop_scene_pin_input.c @@ -126,6 +126,7 @@ bool desktop_scene_pin_input_on_event(void* context, SceneManagerEvent event) { consumed = true; break; case DesktopPinInputEventUnlocked: + case DesktopGlobalApiUnlock: desktop_unlock(desktop); consumed = true; break; diff --git a/applications/services/desktop/views/desktop_events.h b/applications/services/desktop/views/desktop_events.h index 5dc51fd85..bce9c09d1 100644 --- a/applications/services/desktop/views/desktop_events.h +++ b/applications/services/desktop/views/desktop_events.h @@ -50,4 +50,5 @@ typedef enum { DesktopGlobalBeforeAppStarted, DesktopGlobalAfterAppFinished, DesktopGlobalAutoLock, + DesktopGlobalApiUnlock, } DesktopEvent; From 00d9c605157aabf2bc0d7105777e0036483eae5d Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 5 Jan 2024 18:24:09 +0300 Subject: [PATCH 2/2] subghz use long press to exit transmitter [ci skip] to avoid unwanted 2 buttons hold condition holding arrow button and exit causes default button change, which is stays as hidden feature but this change makes it harder to call it accidentally --- applications/main/subghz/views/transmitter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/main/subghz/views/transmitter.c b/applications/main/subghz/views/transmitter.c index 16a2ea110..f75bbc661 100644 --- a/applications/main/subghz/views/transmitter.c +++ b/applications/main/subghz/views/transmitter.c @@ -127,7 +127,8 @@ bool subghz_view_transmitter_input(InputEvent* event, void* context) { SubGhzViewTransmitter* subghz_transmitter = context; bool can_be_sent = false; - if(event->key == InputKeyBack && event->type == InputTypeShort) { + if(event->key == InputKeyBack && event->type == InputTypeLong) { + // Reset view model with_view_model( subghz_transmitter->view, SubGhzViewTransmitterModel * model,