Simplified boot/init

This commit is contained in:
M66B
2019-08-01 09:08:28 +02:00
parent 2fda4ebd35
commit 6f47a2e22c
3 changed files with 52 additions and 56 deletions

View File

@@ -433,25 +433,21 @@ public class ServiceSend extends ServiceBase {
}
static void boot(final Context context) {
if (!booted) {
booted = true;
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
DB db = DB.getInstance(context);
EntityFolder outbox = db.folder().getOutbox();
if (outbox != null && db.operation().getOperations(outbox.id).size() > 0)
start(context);
} catch (Throwable ex) {
Log.e(ex);
}
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
DB db = DB.getInstance(context);
EntityFolder outbox = db.folder().getOutbox();
if (outbox != null && db.operation().getOperations(outbox.id).size() > 0)
start(context);
} catch (Throwable ex) {
Log.e(ex);
}
}, "send:boot");
thread.setPriority(THREAD_PRIORITY_BACKGROUND);
thread.start();
}
}
}, "send:boot");
thread.setPriority(THREAD_PRIORITY_BACKGROUND);
thread.start();
}
static void start(Context context) {