Require calendar read permission when testing write permission

pull/209/head
M66B 2 years ago
parent ed0680089e
commit 86af30a1d6

@ -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) {

Loading…
Cancel
Save