From e4785763fb077bf338308737ec5225f259bf8e9e Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 9 Jan 2022 17:25:35 +0100 Subject: [PATCH] Profile name permission check --- app/src/main/java/eu/faircode/email/FragmentGmail.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentGmail.java b/app/src/main/java/eu/faircode/email/FragmentGmail.java index 350ce35065..fa9e1f7198 100644 --- a/app/src/main/java/eu/faircode/email/FragmentGmail.java +++ b/app/src/main/java/eu/faircode/email/FragmentGmail.java @@ -252,7 +252,7 @@ public class FragmentGmail extends FragmentBase { tvGranted.setVisibility(granted ? View.VISIBLE : View.GONE); boolean hasName = (etName.getText() != null && etName.getText().length() > 0); - if (granted && !hasName) { + if (granted && !hasName && hasPermission(Manifest.permission.READ_CONTACTS)) { try (Cursor cursor = getContext().getContentResolver().query( ContactsContract.Profile.CONTENT_URI, new String[]{ContactsContract.Profile.DISPLAY_NAME}, null, null, null)) {