summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/menu.c13
-rw-r--r--apps/misc.c19
2 files changed, 30 insertions, 2 deletions
diff --git a/apps/menu.c b/apps/menu.c
index a88d725..e6afec2 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -341,6 +341,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
const struct menu_item_ex *temp, *menu;
int ret = 0, i;
bool redraw_lists;
+ int old_audio_status = audio_status();
FOR_NB_SCREENS(i)
viewportmanager_theme_enable(i, !hide_theme, NULL);
@@ -380,6 +381,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
#endif
while (!done)
{
+ int new_old_audio_statusus;
redraw_lists = false;
if (!hide_theme)
{
@@ -389,6 +391,15 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
}
action = get_action(CONTEXT_MAINMENU,
list_do_action_timeout(&lists, HZ));
+
+ /* query audio status to see if it changed */
+ new_old_audio_statusus = audio_status();
+ if (old_audio_status != new_old_audio_statusus)
+ { /* force a redraw if anything changed the audio status
+ * from outside */
+ redraw_lists = true;
+ old_audio_status = new_old_audio_statusus;
+ }
/* HZ so the status bar redraws corectly */
if (menu_callback)
@@ -410,8 +421,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
if (gui_synclist_do_button(&lists, &action, LIST_WRAP_UNLESS_HELD))
continue;
- if (action == ACTION_NONE)
- continue;
#ifdef HAVE_QUICKSCREEN
else if (action == ACTION_STD_QUICKSCREEN)
{
diff --git a/apps/misc.c b/apps/misc.c
index ed69861..9fbdd43 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -517,6 +517,9 @@ static void unplug_change(bool inserted)
long default_event_handler_ex(long event, void (*callback)(void *), void *parameter)
{
+#if CONFIG_PLATFORM & PLATFORM_ANDROID
+ static bool resume = false;
+#endif
switch(event)
{
case SYS_BATTERY_UPDATE:
@@ -606,6 +609,22 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
iap_handlepkt();
return SYS_IAP_HANDLEPKT;
#endif
+#if CONFIG_PLATFORM & PLATFORM_ANDROID
+ /* stop playback if we receive a call */
+ case SYS_CALL_INCOMING:
+ resume = (audio_status() & AUDIO_STATUS_PLAY) != 0;
+ list_stop_handler();
+ return SYS_CALL_INCOMING;
+ /* resume playback if needed */
+ case SYS_CALL_HUNG_UP:
+ if (resume && playlist_resume() != -1)
+ {
+ playlist_start(global_status.resume_index,
+ global_status.resume_offset);
+ }
+ resume = false;
+ return SYS_CALL_HUNG_UP;
+#endif
}
return 0;
}