From c0c769c5a86c56c2ab2c9e88515a64da98575182 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Sat, 29 Jan 2011 20:47:32 +0000 Subject: Add widgets to android port. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29170 a1c6a512-1295-4272-9138-f99709370657 --- apps/hosted/notification.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/hosted/notification.c b/apps/hosted/notification.c index 3c623aad1d..fa8c286808 100644 --- a/apps/hosted/notification.c +++ b/apps/hosted/notification.c @@ -30,7 +30,7 @@ extern JNIEnv *env_ptr; extern jclass RockboxService_class; extern jobject RockboxService_instance; -static jmethodID updateNotification; +static jmethodID updateNotification, finishNotification; static jobject NotificationManager_instance; static jstring title, artist, album; @@ -66,6 +66,16 @@ static void track_changed_callback(void *param) } } +/* + * notify about track finishing */ +static void track_finished_callback(void *param) +{ + (void)param; + JNIEnv e = *env_ptr; + e->CallVoidMethod(env_ptr, NotificationManager_instance, + finishNotification); +} + void notification_init(void) { JNIEnv e = *env_ptr; @@ -79,6 +89,9 @@ void notification_init(void) "(Ljava/lang/String;" "Ljava/lang/String;" "Ljava/lang/String;)V"); + finishNotification = e->GetMethodID(env_ptr, class, "finishNotification", + "()V"); add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback); + add_event(PLAYBACK_EVENT_TRACK_FINISH, false, track_finished_callback); } -- cgit v1.2.3