From e122243bb0c80e582c15360d4c334345aefdc9c9 Mon Sep 17 00:00:00 2001 From: Roman Artiukhin Date: Sat, 3 Feb 2024 15:54:14 +0200 Subject: [PATCH] plugins: playing time: fix possible crash on sys event Change-Id: I7b3580c56e2b285f56b9e2195fbf3c14b6cd96e5 --- apps/plugins/playing_time.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/plugins/playing_time.c b/apps/plugins/playing_time.c index 942513c499..354c5a3e06 100644 --- a/apps/plugins/playing_time.c +++ b/apps/plugins/playing_time.c @@ -351,8 +351,13 @@ static bool playing_time(void) if (rb->list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0 && key!=ACTION_NONE && key!=ACTION_UNKNOWN) { + bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED; + + if (!usb && IS_SYSEVENT(key)) + continue; + rb->talk_force_shutup(); - return(rb->default_event_handler(key) == SYS_USB_CONNECTED); + return usb; } }