1
0
Fork 0
forked from len0rd/rockbox

Android: Fix some race conditions and crashes on startup.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29341 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2011-02-19 16:42:44 +00:00
parent 171b4ff807
commit d6ce7fe3d4
3 changed files with 45 additions and 18 deletions

View file

@ -83,6 +83,11 @@ void notification_init(void)
"fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;");
NotificationManager_instance = e->GetObjectField(env_ptr,
RockboxService_instance, nNM);
if (NotificationManager_instance == NULL)
{
DEBUGF("Failed to get RunForegroundManager instance. Performance will be bad");
return;
}
jclass class = e->GetObjectClass(env_ptr, NotificationManager_instance);
updateNotification = e->GetMethodID(env_ptr, class, "updateNotification",