Merge pull request #183 from lbryio/start-blockchain-dl

Start daemon service immediately app starts (even for first run)
This commit is contained in:
Akinwale Ariwodola 2018-06-18 15:01:09 +01:00 committed by GitHub
commit 35cf4255a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,13 +142,9 @@ 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)) { serviceRunning = isServiceRunning(LbrynetService.class);
// We're not showing the welcome page, so it's okay to start the daemon service if (!serviceRunning) {
// because this is not the first run experience ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
serviceRunning = isServiceRunning(LbrynetService.class);
if (!serviceRunning) {
ServiceHelper.start(this, "", LbrynetService.class, "lbrynetservice");
}
} }
if (mReactInstanceManager != null) { if (mReactInstanceManager != null) {