Revert "Run start service on foreground"

This reverts commit f7a85deeec.
This commit is contained in:
M66B
2021-03-27 15:50:39 +01:00
parent a5e0d8f086
commit e35cbd0f37
18 changed files with 114 additions and 263 deletions

View File

@@ -4195,6 +4195,8 @@ public class FragmentCompose extends FragmentBase {
db.endTransaction();
}
ServiceSynchronize.eval(context, "compose/draft");
return data;
}
@@ -4203,10 +4205,6 @@ public class FragmentCompose extends FragmentBase {
final String action = getArguments().getString("action");
Log.i("Loaded draft id=" + data.draft.id + " action=" + action);
Context context = getContext();
if (context != null)
ServiceSynchronize.eval(context, "compose/draft");
working = data.draft.id;
encrypt = data.draft.ui_encrypt;
getActivity().invalidateOptionsMenu();
@@ -5010,12 +5008,16 @@ public class FragmentCompose extends FragmentBase {
db.endTransaction();
}
args.putBoolean("dirty", dirty);
if (dirty)
ServiceSynchronize.eval(context, "compose/action");
if (action == R.id.action_send && draft.ui_snoozed != null) {
Log.i("Delayed send id=" + draft.id + " at " + new Date(draft.ui_snoozed));
EntityMessage.snooze(context, draft.id, draft.ui_snoozed);
}
if (action == R.id.action_send)
if (draft.ui_snoozed == null)
ServiceSend.start(context);
else {
Log.i("Delayed send id=" + draft.id + " at " + new Date(draft.ui_snoozed));
EntityMessage.snooze(context, draft.id, draft.ui_snoozed);
}
return draft;
}
@@ -5025,21 +5027,10 @@ public class FragmentCompose extends FragmentBase {
if (draft == null)
return;
int action = args.getInt("action");
boolean dirty = args.getBoolean("dirty");
boolean needsEncryption = args.getBoolean("needsEncryption");
int action = args.getInt("action");
Log.i("Loaded action id=" + draft.id +
" action=" + getActionName(action) +
" dirty=" + dirty +
" encryption=" + needsEncryption);
Context context = getContext();
if (context != null) {
if (dirty)
ServiceSynchronize.eval(context, "compose/action");
if (action == R.id.action_send && draft.ui_snoozed == null)
ServiceSend.start(context);
}
" action=" + getActionName(action) + " encryption=" + needsEncryption);
etTo.setText(MessageHelper.formatAddressesCompose(draft.to));
etCc.setText(MessageHelper.formatAddressesCompose(draft.cc));