diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2010-08-07 21:30:22 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2010-08-07 21:30:22 +0000 |
| commit | ca4439ff65bdc93fc44f4cc1be52aab50217ce78 (patch) | |
| tree | 06578c5243a9c7b0c4c5dcb322ffb9a4609b5e7a /apps/misc.c | |
| parent | f1184f963aea4cb16a5886c71cc662a0503e1cd5 (diff) | |
| download | rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.zip rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.gz rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.bz2 rockbox-ca4439ff65bdc93fc44f4cc1be52aab50217ce78.tar.xz | |
Android port: handle incoming calls.
Stop explicitely if a call comes in, and resume playback (if it was playing before the call) upon hang up.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27746 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/misc.c')
| -rw-r--r-- | apps/misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
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; } |