mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-25 17:12:38 +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) {
|
||||
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 New Issue
Block a user