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:
parent
5e8863073e
commit
4f747c1aaa
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue