1
0
Fork 0
forked from len0rd/rockbox

Android: prevent loading the library twice

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28508 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2010-11-05 23:40:05 +00:00
parent 5e8863073e
commit 4f747c1aaa

View file

@ -61,6 +61,7 @@ public class RockboxService extends Service
/* locals needed for the c code and rockbox state */
private RockboxFramebuffer fb = null;
private boolean mRockboxRunning = false;
private volatile boolean rbLibLoaded;
private Activity current_activity = null;
private IntentFilter itf;
private BroadcastReceiver batt_monitor;
@ -112,6 +113,7 @@ public class RockboxService extends Service
if (intent.hasExtra("callback"))
resultReceiver = (ResultReceiver) intent.getParcelableExtra("callback");
if (!rbLibLoaded)
startservice();
/* Display a notification about us starting.
@ -218,6 +220,7 @@ public class RockboxService extends Service
}
System.loadLibrary("rockbox");
rbLibLoaded = true;
if (resultReceiver != null)
resultReceiver.send(RESULT_LIB_LOADED, null);
main();