mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 15:17:03 +02:00
Simplified boot/init
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user