mirror of https://github.com/M66B/FairEmail.git
Profile name permission check
This commit is contained in:
parent
bb88910d88
commit
e4785763fb
|
@ -252,7 +252,7 @@ public class FragmentGmail extends FragmentBase {
|
||||||
tvGranted.setVisibility(granted ? View.VISIBLE : View.GONE);
|
tvGranted.setVisibility(granted ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
boolean hasName = (etName.getText() != null && etName.getText().length() > 0);
|
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(
|
try (Cursor cursor = getContext().getContentResolver().query(
|
||||||
ContactsContract.Profile.CONTENT_URI,
|
ContactsContract.Profile.CONTENT_URI,
|
||||||
new String[]{ContactsContract.Profile.DISPLAY_NAME}, null, null, null)) {
|
new String[]{ContactsContract.Profile.DISPLAY_NAME}, null, null, null)) {
|
||||||
|
|
Loading…
Reference in New Issue