Start daemon service immediately app starts (even for first run)

This commit is contained in:
Akinwale Ariwodola 2018-06-18 14:20:37 +01:00
parent 541f582ac1
commit 0da47c409f

View file

@ -142,14 +142,10 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
super.onResume(); super.onResume();
SharedPreferences sp = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE); SharedPreferences sp = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
if (!sp.getBoolean("firstRun", true)) {
// We're not showing the welcome page, so it's okay to start the daemon service
// because this is not the first run experience
serviceRunning = isServiceRunning(LbrynetService.class); serviceRunning = isServiceRunning(LbrynetService.class);
if (!serviceRunning) { if (!serviceRunning) {
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice"); ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
} }
}
if (mReactInstanceManager != null) { if (mReactInstanceManager != null) {
mReactInstanceManager.onHostResume(this, this); mReactInstanceManager.onHostResume(this, this);