Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 883954c

Browse files
Add _sync_id property (#187)
* Added sync_id column in JtxContract * Raise minimum jtx Board version * AndroidCalendar, JtxCollection: add syncId column --------- Co-authored-by: Ricki Hirner <[email protected]>
1 parent 12df9bf commit 883954c

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCalendarTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ class AndroidCalendarTest {
125125
}
126126
}
127127

128-
}
128+
}

lib/src/main/kotlin/at/bitfire/ical4android/AndroidCalendar.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ abstract class AndroidCalendar<out T: AndroidEvent>(
165165

166166
var ownerAccount: String? = null
167167

168+
var syncId: String? = null
169+
168170

169171
/**
170172
* Sets the calendar properties ([name], [displayName] etc.) from the passed argument,
@@ -186,6 +188,8 @@ abstract class AndroidCalendar<out T: AndroidEvent>(
186188
isVisible = info.getAsInteger(Calendars.VISIBLE) != 0
187189

188190
ownerAccount = info.getAsString(Calendars.OWNER_ACCOUNT)
191+
192+
syncId = info.getAsString(Calendars._SYNC_ID)
189193
}
190194

191195

lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
6060
var supportsVTODO = true
6161
var supportsVJOURNAL = true
6262

63+
var syncId: Long? = null
64+
6365
var context: Context? = null
6466

6567

@@ -85,6 +87,8 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
8587
supportsVJOURNAL = values.getAsString(JtxContract.JtxCollection.SUPPORTSVJOURNAL) == "1"
8688
|| values.getAsString(JtxContract.JtxCollection.SUPPORTSVJOURNAL) == "true"
8789

90+
syncId = values.getAsLong(JtxContract.JtxCollection.SYNC_ID)
91+
8892
this.context = context
8993
}
9094

lib/src/main/kotlin/at/bitfire/ical4android/TaskProvider.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class TaskProvider private constructor(
2222
): Closeable {
2323

2424
enum class ProviderName(
25-
val authority: String,
26-
val packageName: String,
27-
val minVersionCode: Long,
28-
val minVersionName: String,
29-
private val readPermission: String,
30-
private val writePermission: String
25+
val authority: String,
26+
val packageName: String,
27+
val minVersionCode: Long,
28+
val minVersionName: String,
29+
private val readPermission: String,
30+
private val writePermission: String
3131
) {
32-
JtxBoard("at.techbee.jtx.provider", "at.techbee.jtx", 207000001, "2.07.00", PERMISSION_JTX_READ, PERMISSION_JTX_WRITE),
32+
JtxBoard("at.techbee.jtx.provider", "at.techbee.jtx", 210000000, "2.10.00", PERMISSION_JTX_READ, PERMISSION_JTX_WRITE),
3333
TasksOrg("org.tasks.opentasks", "org.tasks", 100000, "10.0", PERMISSION_TASKS_ORG_READ, PERMISSION_TASKS_ORG_WRITE),
3434
OpenTasks("org.dmfs.tasks", "org.dmfs.tasks", 103, "1.1.8.2", PERMISSION_OPENTASKS_READ, PERMISSION_OPENTASKS_WRITE);
3535

lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ object JtxContract {
4646
const val AUTHORITY = "at.techbee.jtx.provider"
4747

4848
/** The version of this SyncContentProviderContract */
49-
const val VERSION = 7
49+
const val VERSION = 8
5050

5151
/** Constructs an Uri for the Jtx Sync Adapter with the given Account
5252
* @param [account] The account that should be appended to the Base Uri
@@ -1215,6 +1215,12 @@ object JtxContract {
12151215
*/
12161216
const val LAST_SYNC = "lastsync"
12171217

1218+
/**
1219+
* Purpose: This column/property stores a sync_id for the given collection
1220+
* See https://github.com/TechbeeAT/jtxBoard/issues/1635
1221+
* Type: [Long]
1222+
*/
1223+
const val SYNC_ID = "sync_id"
12181224
}
12191225

12201226

0 commit comments

Comments
 (0)