diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2011-01-29 20:47:32 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2011-01-29 20:47:32 +0000 |
commit | c0c769c5a86c56c2ab2c9e88515a64da98575182 (patch) | |
tree | 24e84b2d146bf3da39d93983d5656061e3c88ecb /apps | |
parent | e9749d1b93f23b3bc36305ad1d39ca5e5c0cb3a8 (diff) | |
download | rockbox-c0c769c5a86c56c2ab2c9e88515a64da98575182.tar.gz rockbox-c0c769c5a86c56c2ab2c9e88515a64da98575182.zip |
Add widgets to android port.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29170 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/hosted/notification.c | 15 |
1 files changed, 14 insertions, 1 deletions
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; | |||
30 | extern jclass RockboxService_class; | 30 | extern jclass RockboxService_class; |
31 | extern jobject RockboxService_instance; | 31 | extern jobject RockboxService_instance; |
32 | 32 | ||
33 | static jmethodID updateNotification; | 33 | static jmethodID updateNotification, finishNotification; |
34 | static jobject NotificationManager_instance; | 34 | static jobject NotificationManager_instance; |
35 | static jstring title, artist, album; | 35 | static jstring title, artist, album; |
36 | 36 | ||
@@ -66,6 +66,16 @@ static void track_changed_callback(void *param) | |||
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | /* | ||
70 | * notify about track finishing */ | ||
71 | static void track_finished_callback(void *param) | ||
72 | { | ||
73 | (void)param; | ||
74 | JNIEnv e = *env_ptr; | ||
75 | e->CallVoidMethod(env_ptr, NotificationManager_instance, | ||
76 | finishNotification); | ||
77 | } | ||
78 | |||
69 | void notification_init(void) | 79 | void notification_init(void) |
70 | { | 80 | { |
71 | JNIEnv e = *env_ptr; | 81 | JNIEnv e = *env_ptr; |
@@ -79,6 +89,9 @@ void notification_init(void) | |||
79 | "(Ljava/lang/String;" | 89 | "(Ljava/lang/String;" |
80 | "Ljava/lang/String;" | 90 | "Ljava/lang/String;" |
81 | "Ljava/lang/String;)V"); | 91 | "Ljava/lang/String;)V"); |
92 | finishNotification = e->GetMethodID(env_ptr, class, "finishNotification", | ||
93 | "()V"); | ||
82 | 94 | ||
83 | add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback); | 95 | add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback); |
96 | add_event(PLAYBACK_EVENT_TRACK_FINISH, false, track_finished_callback); | ||
84 | } | 97 | } |