1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-31 20:25:38 +00:00

Properly handle deny contact permissions

This commit is contained in:
M66B 2021-01-23 19:02:55 +01:00
parent 507c098a4c
commit 1b65c7a40e

View file

@ -446,10 +446,8 @@ public class FragmentSetup extends FragmentBase {
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
for (int i = 0; i < permissions.length; i++)
if (grantResults[i] == PackageManager.PERMISSION_GRANTED) {
if (Manifest.permission.READ_CONTACTS.equals(permissions[i]))
setContactsPermission(true);
}
if (Manifest.permission.READ_CONTACTS.equals(permissions[i]))
setContactsPermission(grantResults[i] == PackageManager.PERMISSION_GRANTED);
}
private void setContactsPermission(boolean granted) {