mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 19:25:34 +00:00
Refactoring
This commit is contained in:
parent
fd9a27f4cd
commit
fe6fa7a2d5
3 changed files with 7 additions and 4 deletions
|
@ -20,7 +20,6 @@ package eu.faircode.email;
|
|||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
|
@ -115,7 +114,7 @@ public class EntityOperation {
|
|||
db.folder().setFolderSyncState(fid, "requested");
|
||||
|
||||
if (folder.account == null) // Outbox
|
||||
context.startService(new Intent(context, ServiceSend.class));
|
||||
ServiceSend.start(context);
|
||||
|
||||
Log.i("Queued sync folder=" + folder);
|
||||
}
|
||||
|
@ -227,7 +226,7 @@ public class EntityOperation {
|
|||
db.message().setMessageUiHide(message.id, true);
|
||||
|
||||
else if (SEND.equals(name))
|
||||
context.startService(new Intent(context, ServiceSend.class));
|
||||
ServiceSend.start(context);
|
||||
} catch (JSONException ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class ReceiverAutostart extends BroadcastReceiver {
|
|||
return;
|
||||
|
||||
if (db.operation().getOperations(outbox.id).size() > 0)
|
||||
context.startService(new Intent(context, ServiceSend.class));
|
||||
ServiceSend.start(context);
|
||||
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
|
|
|
@ -412,4 +412,8 @@ public class ServiceSend extends LifecycleService {
|
|||
db.identity().setIdentityState(ident.id, null);
|
||||
}
|
||||
}
|
||||
|
||||
static void start(Context context) {
|
||||
context.startService(new Intent(context, ServiceSend.class));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue