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:
parent
ed0680089e
commit
86af30a1d6
1 changed files with 6 additions and 1 deletions
|
@ -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…
Reference in a new issue