1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 02:07:12 +00:00

Require calendar read permission when testing write permission

This commit is contained in:
M66B 2022-11-04 11:07:20 +01:00
parent ed0680089e
commit 86af30a1d6

View file

@ -414,7 +414,12 @@ public class Helper {
// Features
static boolean hasPermission(Context context, String name) {
return (ContextCompat.checkSelfPermission(context, name) == PackageManager.PERMISSION_GRANTED);
if (Manifest.permission.WRITE_CALENDAR.equals(name))
if (ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CALENDAR) !=
PackageManager.PERMISSION_GRANTED)
return false;
return (ContextCompat.checkSelfPermission(context, name) ==
PackageManager.PERMISSION_GRANTED);
}
static boolean hasPermissions(Context context, String[] permissions) {