Skip to content

Commit

Permalink
[gateway] do not require internet access for registration
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Dec 27, 2024
1 parent e2966b7 commit 70c4e1a
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package me.capcom.smsgateway.modules.gateway.workers

import android.content.Context
import androidx.work.BackoffPolicy
import androidx.work.Constraints
import androidx.work.CoroutineWorker
import androidx.work.ExistingWorkPolicy
import androidx.work.NetworkType
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.WorkRequest
Expand Down Expand Up @@ -51,11 +49,11 @@ class RegistrationWorker(

fun start(context: Context, token: String) {
val work = OneTimeWorkRequestBuilder<RegistrationWorker>()
.setConstraints(
Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
)
// .setConstraints(
// Constraints.Builder()
// .setRequiredNetworkType(NetworkType.CONNECTED)
// .build()
// )
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, WorkRequest.MIN_BACKOFF_MILLIS, TimeUnit.MILLISECONDS)
.setInputData(workDataOf(
DATA_TOKEN to token
Expand Down

0 comments on commit 70c4e1a

Please sign in to comment.