1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Leave breadcrumb on reload

This commit is contained in:
M66B 2019-05-10 11:11:28 +02:00
parent a39771129c
commit 4544887666

View file

@ -42,6 +42,8 @@ import androidx.lifecycle.LifecycleService;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.bugsnag.android.BreadcrumbType;
import com.bugsnag.android.Bugsnag;
import com.sun.mail.imap.IMAPFolder; import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPMessage; import com.sun.mail.imap.IMAPMessage;
import com.sun.mail.imap.IMAPStore; import com.sun.mail.imap.IMAPStore;
@ -341,6 +343,20 @@ public class ServiceSynchronize extends LifecycleService {
EntityLog.log(ServiceSynchronize.this, "Reload" + EntityLog.log(ServiceSynchronize.this, "Reload" +
" stop=" + doStop + " start=" + doStart + " queued=" + queued + " " + reason); " stop=" + doStop + " start=" + doStart + " queued=" + queued + " " + reason);
Map<String, String> crumb = new HashMap<>();
crumb.put("oneshot", Boolean.toString(oneshot));
crumb.put("started", Boolean.toString(started));
crumb.put("doStop", Boolean.toString(doStop));
crumb.put("doStart", Boolean.toString(doStart));
crumb.put("queued", Integer.toString(queued));
crumb.put("reason", reason == null ? "" : reason);
crumb.put("connected", Boolean.toString(networkState.isConnected()));
crumb.put("suitable", Boolean.toString(networkState.isSuitable()));
crumb.put("unmetered", Boolean.toString(networkState.isUnmetered()));
crumb.put("roaming", Boolean.toString(networkState.isRoaming()));
crumb.put("lastLost", new Date(lastLost).toString());
Bugsnag.leaveBreadcrumb("reload", BreadcrumbType.STATE, crumb);
if (doStop) if (doStop)
stop(); stop();