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