/*
- * Copyright © 2020 Damyan Ivanov.
+ * Copyright © 2021 Damyan Ivanov.
* This file is part of MoLe.
* MoLe is free software: you can distribute it and/or modify it
* under the term of the GNU General Public License as published by
import androidx.annotation.Nullable;
import net.ktnx.mobileledger.R;
-import net.ktnx.mobileledger.model.Data;
-import net.ktnx.mobileledger.model.MobileLedgerProfile;
+import net.ktnx.mobileledger.db.DB;
import net.ktnx.mobileledger.utils.Logger;
-import net.ktnx.mobileledger.utils.MLDB;
import net.ktnx.mobileledger.utils.MobileLedgerDatabase;
public class SplashActivity extends CrashReportingActivity {
- private static final long keepActiveForMS = 500;
+ private static final long keepActiveForMS = 400;
private long startupTime;
private boolean running = true;
@Override
startupTime = System.currentTimeMillis();
AsyncTask<Void, Void, Void> dbInitTask = new DatabaseInitTask();
+ Logger.debug("splash", "starting dbInit task");
dbInitTask.execute();
}
@Override
private static class DatabaseInitTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... voids) {
- MobileLedgerProfile.loadAllFromDB(null);
+ long ignored = DB.get().getProfileDAO().getProfileCountSync();
- String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null);
- MobileLedgerProfile startupProfile = Data.getProfile(profileUUID);
- if (startupProfile != null)
- Data.setCurrentProfile(startupProfile);
return null;
}
@Override