Remove unused params

This commit is contained in:
Benoit Marty 2021-01-12 16:11:22 +01:00
parent 2b60affd9a
commit b2df107f17
2 changed files with 6 additions and 6 deletions

View File

@ -120,7 +120,7 @@ abstract class SyncService : Service() {
serviceScope.coroutineContext.cancelChildren() serviceScope.coroutineContext.cancelChildren()
if (!preventReschedule && periodic && sessionId != null && backgroundDetectionObserver.isInBackground) { if (!preventReschedule && periodic && sessionId != null && backgroundDetectionObserver.isInBackground) {
Timber.d("## Sync: Reschedule service in $syncDelaySeconds sec") Timber.d("## Sync: Reschedule service in $syncDelaySeconds sec")
onRescheduleAsked(sessionId ?: "", false, syncTimeoutSeconds, syncDelaySeconds) onRescheduleAsked(sessionId ?: "", syncTimeoutSeconds, syncDelaySeconds)
} }
super.onDestroy() super.onDestroy()
} }
@ -177,7 +177,7 @@ abstract class SyncService : Service() {
// Network might be off, no need to reschedule endless alarms :/ // Network might be off, no need to reschedule endless alarms :/
preventReschedule = true preventReschedule = true
// Instead start a work to restart background sync when network is on // Instead start a work to restart background sync when network is on
onNetworkError(sessionId ?: "", isInitialSync, syncTimeoutSeconds, syncDelaySeconds) onNetworkError(sessionId ?: "", syncTimeoutSeconds, syncDelaySeconds)
} }
// JobCancellation could be caught here when onDestroy cancels the coroutine context // JobCancellation could be caught here when onDestroy cancels the coroutine context
if (isRunning.get()) stopMe() if (isRunning.get()) stopMe()
@ -217,9 +217,9 @@ abstract class SyncService : Service() {
abstract fun onStart(isInitialSync: Boolean) abstract fun onStart(isInitialSync: Boolean)
abstract fun onRescheduleAsked(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) abstract fun onRescheduleAsked(sessionId: String, timeout: Int, delay: Int)
abstract fun onNetworkError(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) abstract fun onNetworkError(sessionId: String, timeout: Int, delay: Int)
override fun onBind(intent: Intent?): IBinder? { override fun onBind(intent: Intent?): IBinder? {
return null return null

View File

@ -92,11 +92,11 @@ class VectorSyncService : SyncService() {
startForeground(NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, notification) startForeground(NotificationUtils.NOTIFICATION_ID_FOREGROUND_SERVICE, notification)
} }
override fun onRescheduleAsked(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) { override fun onRescheduleAsked(sessionId: String, timeout: Int, delay: Int) {
rescheduleSyncService(sessionId, timeout, delay, false) rescheduleSyncService(sessionId, timeout, delay, false)
} }
override fun onNetworkError(sessionId: String, isInitialSync: Boolean, timeout: Int, delay: Int) { override fun onNetworkError(sessionId: String, timeout: Int, delay: Int) {
Timber.d("## Sync: A network error occurred during sync") Timber.d("## Sync: A network error occurred during sync")
val rescheduleSyncWorkRequest: WorkRequest = val rescheduleSyncWorkRequest: WorkRequest =
OneTimeWorkRequestBuilder<RestartWhenNetworkOn>() OneTimeWorkRequestBuilder<RestartWhenNetworkOn>()