mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 18:05:59 +03:00
Avoid default value for param
This commit is contained in:
parent
b69d8ad71a
commit
561b89830a
1 changed files with 7 additions and 4 deletions
|
@ -89,11 +89,11 @@ class VectorSyncService : SyncService() {
|
|||
}
|
||||
|
||||
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) {
|
||||
Timber.d("## Sync: A network error occured during sync")
|
||||
Timber.d("## Sync: A network error occurred during sync")
|
||||
val rescheduleSyncWorkRequest: WorkRequest =
|
||||
OneTimeWorkRequestBuilder<RestartWhenNetworkOn>()
|
||||
.setInputData(Data.Builder()
|
||||
|
@ -137,8 +137,11 @@ class VectorSyncService : SyncService() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun Context.rescheduleSyncService(sessionId: String, timeout: Int, delay: Int, networkBack: Boolean = false) {
|
||||
val periodicIntent = VectorSyncService.newPeriodicIntent(this, sessionId, timeout, delay, networkBack)
|
||||
private fun Context.rescheduleSyncService(sessionId: String,
|
||||
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) {
|
||||
PendingIntent.getForegroundService(this, 0, periodicIntent, 0)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue