MCPcopy Create free account
hub / github.com/M66B/FairEmail / doWork

Method doWork

app/src/main/java/eu/faircode/email/WorkerSync.java:50–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 @NonNull
51 @Override
52 public Result doWork() {
53 Thread.currentThread().setPriority(THREAD_PRIORITY_BACKGROUND);
54 final Context context = getApplicationContext();
55
56 try {
57 semaphore.acquire();
58
59 EntityLog.log(context, EntityLog.Type.Rules, "Cloud sync execute");
60 CloudSync.execute(context, "sync", false);
61 EntityLog.log(context, EntityLog.Type.Rules, "Cloud sync completed");
62
63 return Result.success();
64 } catch (Throwable ex) {
65 Log.e(ex);
66 return Result.failure();
67 } finally {
68 semaphore.release();
69 }
70 }
71
72 static void init(Context context) {
73 SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

Callers

nothing calls this directly

Calls 6

logMethod · 0.95
executeMethod · 0.95
eMethod · 0.95
setPriorityMethod · 0.45
acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected