Let other apps write to the own store through the provider (#64)
Builds on the read-only provider (#62) and makes it writable for other apps, as long as Agendula uses its own store. - `tasks`: insert, update and delete. Writes follow the same rules as the app's own edits. Status, progress and completion time stay consistent, a subtree moves and deletes as one, and a write that changes nothing doesn't mark the task for sync. - `instances`: completion columns complete, cancel or reopen that one occurrence. Other content columns edit the whole series. Changing a time column is rejected, so a series is moved through `tasks`. - `properties`: alarms and categories can be inserted, updated and deleted. - `tasklists` stays read-only. Batches run in one transaction. - A client can write back a row it read. Columns it carries unchanged are ignored, and so are rdate/exdate values in the shape they were synced in. - A task inserted with a time but no `tz` is floating, as in OpenTasks. - Deleting a task now takes its whole subtree in the app as well, including "this and following" from the first occurrence and in External mode. Deviation: tag property ids stay stable, with one rare exception. If two tags on one task have hash-colliding spellings, removing one can shift the other's id. Avoiding that would mean storing the ids, which didn't seem worth it at about a 1 in 2³¹ chance. Closes #63 Co-authored-by: Jean-Luc Makiola <business@jeanlucmakiola.de> Reviewed-on: https://codeberg.org/jlmakiola/agendula/pulls/64
This commit is contained in:
1 parent
e7bf23e276
commit
cff6308018
23 files changed
+2649
-75
No files matched your search
@@ -15,14 +15,19 @@
|
||||
<uses-permission android:name="org.tasks.permission.READ_TASKS" />
|
||||
<uses-permission android:name="org.tasks.permission.WRITE_TASKS" />
|
||||
|
||||
<!-- What another app requests to read the own store through
|
||||
AgendulaTaskProvider. Dangerous, like OpenTasks' own: the user grants it
|
||||
per app. Suffixed per build, so debug and release can coexist. -->
|
||||
<!-- What another app requests to read or write the own store through
|
||||
AgendulaTaskProvider. Dangerous, like OpenTasks' own: the user grants
|
||||
them per app. Suffixed per build, so debug and release can coexist. -->
|
||||
<permission
|
||||
android:name="${applicationId}.permission.READ_TASKS"
|
||||
android:description="@string/permission_read_tasks_description"
|
||||
android:label="@string/permission_read_tasks_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
<permission
|
||||
android:name="${applicationId}.permission.WRITE_TASKS"
|
||||
android:description="@string/permission_write_tasks_description"
|
||||
android:label="@string/permission_write_tasks_label"
|
||||
android:protectionLevel="dangerous" />
|
||||
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
@@ -241,13 +246,14 @@
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<!-- The own store, read-only, under the OpenTasks contract. Empty while
|
||||
External mode is active. -->
|
||||
<!-- The own store under the OpenTasks contract. Empty, and refusing
|
||||
writes, while External mode is active. -->
|
||||
<provider
|
||||
android:name=".data.tasks.provider.AgendulaTaskProvider"
|
||||
android:authorities="${applicationId}.tasks"
|
||||
android:exported="true"
|
||||
android:permission="${applicationId}.permission.READ_TASKS"
|
||||
android:readPermission="${applicationId}.permission.READ_TASKS"
|
||||
android:writePermission="${applicationId}.permission.WRITE_TASKS"
|
||||
tools:ignore="SystemPermissionTypo" />
|
||||
|
||||
<!-- WorkManager's on-demand initialisation. Removing the default
|
||||
|
||||
Reference in new issue
Block a user