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

Unverified Commit 19f12dc1 authored by Sunik Kupfer's avatar Sunik Kupfer Committed by GitHub
Browse files

Define access levels in task contract (#67)

parent 2964f7e4
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -384,13 +384,22 @@ public final class TaskContract
        String LIST_COLOR = "list_color";

        /**
         * The access level a user has on this list. <strong>This value is not used yet, sync adapters should set it to <code>0</code></strong>.
         * The access level a user has on this list (taken from android.provider.CalendarContract).
         * <p>
         * Value: Integer
         * Value: Integer (one of the values below)
         * </p>
         */
        String ACCESS_LEVEL = "list_access_level";

        /** Not specified by client, should be treated as read-write */
        Integer ACCESS_LEVEL_UNDEFINED = 0;

        /** Can read all tasks and details, no write access */
        Integer ACCESS_LEVEL_READ = 200;

        /** Full access to the tasks list */
        Integer ACCESS_LEVEL_OWNER = 700;

        /**
         * Indicates that a task list is set to be visible.
         * <p>
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ abstract class AndroidTaskList<out T : AndroidTask>(
        fun create(account: Account, provider: TaskProvider, info: ContentValues): Uri {
            info.put(TaskContract.ACCOUNT_NAME, account.name)
            info.put(TaskContract.ACCOUNT_TYPE, account.type)
            info.put(TaskLists.ACCESS_LEVEL, 0)

            Ical4Android.log.info("Creating local task list: $info")
            return provider.client.insert(provider.taskListsUri().asSyncAdapter(account), info)