Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8ce5a6d authored by Alexandre Roux's avatar Alexandre Roux
Browse files

give permissions to email (needed since api update)

parent 99162fe7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -211,6 +211,13 @@ public final class DefaultPermissionGrantPolicy {
        TASKS_PERMISSIONS.add("org.dmfs.permission.WRITE_TASKS");
    }

    private static final Set<String> EMAIL_PERMISSIONS = new ArraySet<>();
    static {
        EMAIL_PERMISSIONS.add("foundation.e.mail.permission.READ_MESSAGES");
        EMAIL_PERMISSIONS.add("foundation.e.mail.permission.DELETE_MESSAGES");
        EMAIL_PERMISSIONS.add("foundation.e.mail.permission.REMOTE_CONTROL");
    }

    private static final int MSG_READ_DEFAULT_PERMISSION_EXCEPTIONS = 1;

    private static final String ACTION_TRACK = "com.android.fitness.TRACK";
@@ -613,6 +620,12 @@ public final class DefaultPermissionGrantPolicy {
                        Intent.CATEGORY_APP_EMAIL, userId),
                userId, CONTACTS_PERMISSIONS, CALENDAR_PERMISSIONS);

	// /e/ Mail

	grantPermissionsToSystemPackage(
                "foundation.e.mail",
                userId, CONTACTS_PERMISSIONS, CALENDAR_PERMISSIONS, STORAGE_PERMISSIONS, EMAIL_PERMISSIONS);

        // Browser
        String browserPackage = getKnownPackage(PackageManagerInternal.PACKAGE_BROWSER, userId);
        if (browserPackage == null) {