mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-26 09:33:14 +01:00
Avoid default value for param
This commit is contained in:
parent
b69d8ad71a
commit
561b89830a
@ -89,11 +89,11 @@ class VectorSyncService : SyncService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onRescheduleAsked(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) {
|
override fun onRescheduleAsked(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) {
|
||||||
rescheduleSyncService(sessionId, timeout, delay)
|
rescheduleSyncService(sessionId, timeout, delay, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onNetworkError(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) {
|
override fun onNetworkError(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) {
|
||||||
Timber.d("## Sync: A network error occured during sync")
|
Timber.d("## Sync: A network error occurred during sync")
|
||||||
val rescheduleSyncWorkRequest: WorkRequest =
|
val rescheduleSyncWorkRequest: WorkRequest =
|
||||||
OneTimeWorkRequestBuilder<RestartWhenNetworkOn>()
|
OneTimeWorkRequestBuilder<RestartWhenNetworkOn>()
|
||||||
.setInputData(Data.Builder()
|
.setInputData(Data.Builder()
|
||||||
@ -137,8 +137,11 @@ class VectorSyncService : SyncService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Context.rescheduleSyncService(sessionId: String, timeout: Int, delay: Int, networkBack: Boolean = false) {
|
private fun Context.rescheduleSyncService(sessionId: String,
|
||||||
val periodicIntent = VectorSyncService.newPeriodicIntent(this, sessionId, timeout, delay, networkBack)
|
timeout: Int,
|
||||||
|
delay: Int,
|
||||||
|
isNetworkBack: Boolean) {
|
||||||
|
val periodicIntent = VectorSyncService.newPeriodicIntent(this, sessionId, timeout, delay, isNetworkBack)
|
||||||
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
val pendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
PendingIntent.getForegroundService(this, 0, periodicIntent, 0)
|
PendingIntent.getForegroundService(this, 0, periodicIntent, 0)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user