Commit 6bce1366 authored by Mygod's avatar Mygod

Fix direct boot

parent 1191cf55
......@@ -22,7 +22,7 @@ package com.github.shadowsocks.acl
import android.content.Context
import androidx.work.*
import com.github.shadowsocks.Core.app
import com.github.shadowsocks.Core
import kotlinx.coroutines.Dispatchers
import java.io.IOException
import java.net.URL
......@@ -32,8 +32,8 @@ class AclSyncer(context: Context, workerParams: WorkerParameters) : CoroutineWor
companion object {
private const val KEY_ROUTE = "route"
fun schedule(route: String) = WorkManager.getInstance(app).enqueueUniqueWork(route, ExistingWorkPolicy.REPLACE,
OneTimeWorkRequestBuilder<AclSyncer>().run {
fun schedule(route: String) = WorkManager.getInstance(Core.deviceStorage).enqueueUniqueWork(
route, ExistingWorkPolicy.REPLACE, OneTimeWorkRequestBuilder<AclSyncer>().run {
setInputData(Data.Builder().putString(KEY_ROUTE, route).build())
setConstraints(Constraints.Builder()
.setRequiredNetworkType(NetworkType.UNMETERED)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment