Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _sync_id property #187

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ class AndroidCalendarTest {
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ abstract class AndroidCalendar<out T: AndroidEvent>(

var ownerAccount: String? = null

var syncId: String? = null


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

ownerAccount = info.getAsString(Calendars.OWNER_ACCOUNT)

syncId = info.getAsString(Calendars._SYNC_ID)
}


Expand Down
4 changes: 4 additions & 0 deletions lib/src/main/kotlin/at/bitfire/ical4android/JtxCollection.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ open class JtxCollection<out T: JtxICalObject>(val account: Account,
var supportsVTODO = true
var supportsVJOURNAL = true

var syncId: Long? = null

var context: Context? = null


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

syncId = values.getAsLong(JtxContract.JtxCollection.SYNC_ID)

this.context = context
}

Expand Down
14 changes: 7 additions & 7 deletions lib/src/main/kotlin/at/bitfire/ical4android/TaskProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class TaskProvider private constructor(
): Closeable {

enum class ProviderName(
val authority: String,
val packageName: String,
val minVersionCode: Long,
val minVersionName: String,
private val readPermission: String,
private val writePermission: String
val authority: String,
val packageName: String,
val minVersionCode: Long,
val minVersionName: String,
private val readPermission: String,
private val writePermission: String
) {
JtxBoard("at.techbee.jtx.provider", "at.techbee.jtx", 207000001, "2.07.00", PERMISSION_JTX_READ, PERMISSION_JTX_WRITE),
JtxBoard("at.techbee.jtx.provider", "at.techbee.jtx", 210000000, "2.10.00", PERMISSION_JTX_READ, PERMISSION_JTX_WRITE),
TasksOrg("org.tasks.opentasks", "org.tasks", 100000, "10.0", PERMISSION_TASKS_ORG_READ, PERMISSION_TASKS_ORG_WRITE),
OpenTasks("org.dmfs.tasks", "org.dmfs.tasks", 103, "1.1.8.2", PERMISSION_OPENTASKS_READ, PERMISSION_OPENTASKS_WRITE);

Expand Down
8 changes: 7 additions & 1 deletion lib/src/main/kotlin/at/techbee/jtx/JtxContract.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object JtxContract {
const val AUTHORITY = "at.techbee.jtx.provider"

/** The version of this SyncContentProviderContract */
const val VERSION = 7
const val VERSION = 8

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

/**
* Purpose: This column/property stores a sync_id for the given collection
* See https://github.com/TechbeeAT/jtxBoard/issues/1635
* Type: [Long]
*/
const val SYNC_ID = "sync_id"
}


Expand Down
Loading