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

Unverified Commit 03f21a26 authored by Marten Gajda's avatar Marten Gajda Committed by GitHub
Browse files

Introduce operations on Instances, implements #464 (#602)

This commit adds initial support for operations on the instances table. At present sync adapters are not allowed to write to the instances table, non-sync adapters can only insert or modify task values. Instances table columns are still read-only. Also, columns related to recurrence can not be set via the instances table.
This is meant to simplify working with recurrence in the UI. The UI won't have to take special care about creating exceptions. It can simply update or delete individual instances and the provider will take care of creating overrides or ex-dates.

This also fixes Travis not running the `check` task and improves/fixes the provide tests in general.
parent 2efe2ce0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,4 +25,4 @@ before_script:

script:
  - android list target
  - ./gradlew connectedAndroidTest
  - ./gradlew check connectedAndroidTest
+189 −135

File changed.

Preview size limit exceeded, changes collapsed.

+75 −4

File changed.

Preview size limit exceeded, changes collapsed.

+37 −0
Original line number Diff line number Diff line
/*
 * Copyright 2017 dmfs GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.dmfs.provider.tasks.model;

import android.content.ContentUris;
import android.net.Uri;

import org.dmfs.tasks.contract.TaskContract;


/**
 * An abstract implementation of a {@link InstanceAdapter} to server as the base for more concrete adapters.
 *
 * @author Marten Gajda <marten@dmfs.org>
 */
public abstract class AbstractInstanceAdapter implements InstanceAdapter
{
    @Override
    public final Uri uri(String authority)
    {
        return ContentUris.withAppendedId(TaskContract.Instances.getContentUri(authority), id());
    }
}
+165 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading