mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-26 09:33:14 +01:00
More renaming
This commit is contained in:
parent
2ea45185d4
commit
d4c8f56c6e
@ -140,13 +140,13 @@ class VectorSyncService : SyncService() {
|
|||||||
override fun doWork(): Result {
|
override fun doWork(): Result {
|
||||||
Timber.d("## Sync: RestartWhenNetworkOn.doWork()")
|
Timber.d("## Sync: RestartWhenNetworkOn.doWork()")
|
||||||
val sessionId = inputData.getString(KEY_SESSION_ID) ?: return Result.failure()
|
val sessionId = inputData.getString(KEY_SESSION_ID) ?: return Result.failure()
|
||||||
val timeout = inputData.getInt(KEY_TIMEOUT, BackgroundSyncMode.DEFAULT_SYNC_TIMEOUT_SECONDS)
|
val syncTimeoutSeconds = inputData.getInt(KEY_SYNC_TIMEOUT_SECONDS, BackgroundSyncMode.DEFAULT_SYNC_TIMEOUT_SECONDS)
|
||||||
val delay = inputData.getInt(KEY_DELAY, BackgroundSyncMode.DEFAULT_SYNC_DELAY_SECONDS)
|
val syncDelaySeconds = inputData.getInt(KEY_SYNC_DELAY_SECONDS, BackgroundSyncMode.DEFAULT_SYNC_DELAY_SECONDS)
|
||||||
val isPeriodic = inputData.getBoolean(KEY_IS_PERIODIC, false)
|
val isPeriodic = inputData.getBoolean(KEY_IS_PERIODIC, false)
|
||||||
applicationContext.rescheduleSyncService(
|
applicationContext.rescheduleSyncService(
|
||||||
sessionId = sessionId,
|
sessionId = sessionId,
|
||||||
syncTimeoutSeconds = timeout,
|
syncTimeoutSeconds = syncTimeoutSeconds,
|
||||||
syncDelaySeconds = delay,
|
syncDelaySeconds = syncDelaySeconds,
|
||||||
isPeriodic = isPeriodic,
|
isPeriodic = isPeriodic,
|
||||||
isNetworkBack = true
|
isNetworkBack = true
|
||||||
)
|
)
|
||||||
@ -156,21 +156,21 @@ class VectorSyncService : SyncService() {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun createInputData(sessionId: String,
|
fun createInputData(sessionId: String,
|
||||||
timeout: Int,
|
syncTimeoutSeconds: Int,
|
||||||
delay: Int,
|
syncDelaySeconds: Int,
|
||||||
isPeriodic: Boolean
|
isPeriodic: Boolean
|
||||||
): Data {
|
): Data {
|
||||||
return Data.Builder()
|
return Data.Builder()
|
||||||
.putString(KEY_SESSION_ID, sessionId)
|
.putString(KEY_SESSION_ID, sessionId)
|
||||||
.putInt(KEY_TIMEOUT, timeout)
|
.putInt(KEY_SYNC_TIMEOUT_SECONDS, syncTimeoutSeconds)
|
||||||
.putInt(KEY_DELAY, delay)
|
.putInt(KEY_SYNC_DELAY_SECONDS, syncDelaySeconds)
|
||||||
.putBoolean(KEY_IS_PERIODIC, isPeriodic)
|
.putBoolean(KEY_IS_PERIODIC, isPeriodic)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val KEY_SESSION_ID = "sessionId"
|
private const val KEY_SESSION_ID = "sessionId"
|
||||||
private const val KEY_TIMEOUT = "timeout"
|
private const val KEY_SYNC_TIMEOUT_SECONDS = "timeout"
|
||||||
private const val KEY_DELAY = "delay"
|
private const val KEY_SYNC_DELAY_SECONDS = "delay"
|
||||||
private const val KEY_IS_PERIODIC = "isPeriodic"
|
private const val KEY_IS_PERIODIC = "isPeriodic"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user