From ba60be2857e89a2290384dda7303a39c583d0116 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 20 May 2020 17:34:57 +0200 Subject: [PATCH] Added Gmail breadcrumb --- .../main/java/eu/faircode/email/FragmentGmail.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentGmail.java b/app/src/main/java/eu/faircode/email/FragmentGmail.java index e99877c509..ab096223d2 100644 --- a/app/src/main/java/eu/faircode/email/FragmentGmail.java +++ b/app/src/main/java/eu/faircode/email/FragmentGmail.java @@ -50,7 +50,9 @@ import androidx.annotation.Nullable; import androidx.constraintlayout.widget.Group; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; import static android.accounts.AccountManager.newChooseAccountIntent; import static android.app.Activity.RESULT_OK; @@ -291,10 +293,15 @@ public class FragmentGmail extends FragmentBase { } if (!found) { + boolean permission = Helper.hasPermission(getContext(), Manifest.permission.GET_ACCOUNTS); + + Map crumb = new HashMap<>(); + crumb.put("type", type); + crumb.put("count", Integer.toString(accounts.length)); + crumb.put("permission", Boolean.toString(permission)); + Log.breadcrumb("Gmail", crumb); + Log.e("Account missing"); - for (Account account : accounts) - Log.i("Account " + account.name + ":" + account.type); - Log.i("GET_ACCOUNTS=" + Helper.hasPermission(getContext(), Manifest.permission.GET_ACCOUNTS)); tvError.setText(getString(R.string.title_no_account)); grpError.setVisibility(View.VISIBLE);