From 561b89830a842bda22cd0078d64e7355283cdce2 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Tue, 12 Jan 2021 11:21:22 +0100 Subject: [PATCH] Avoid default value for param --- .../im/vector/app/core/services/VectorSyncService.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/core/services/VectorSyncService.kt b/vector/src/main/java/im/vector/app/core/services/VectorSyncService.kt index 0950bdf121..36f7497b7d 100644 --- a/vector/src/main/java/im/vector/app/core/services/VectorSyncService.kt +++ b/vector/src/main/java/im/vector/app/core/services/VectorSyncService.kt @@ -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() .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 {