|
@@ -6,6 +6,7 @@ import android.content.BroadcastReceiver
|
|
|
import android.content.Context
|
|
import android.content.Context
|
|
|
import android.content.Intent
|
|
import android.content.Intent
|
|
|
import androidx.core.content.getSystemService
|
|
import androidx.core.content.getSystemService
|
|
|
|
|
+import com.github.kr328.clash.common.Global
|
|
|
import com.github.kr328.clash.common.compat.pendingIntentFlags
|
|
import com.github.kr328.clash.common.compat.pendingIntentFlags
|
|
|
import com.github.kr328.clash.common.compat.startForegroundServiceCompat
|
|
import com.github.kr328.clash.common.compat.startForegroundServiceCompat
|
|
|
import com.github.kr328.clash.common.constants.Intents
|
|
import com.github.kr328.clash.common.constants.Intents
|
|
@@ -16,7 +17,6 @@ import com.github.kr328.clash.service.data.Imported
|
|
|
import com.github.kr328.clash.service.data.ImportedDao
|
|
import com.github.kr328.clash.service.data.ImportedDao
|
|
|
import com.github.kr328.clash.service.model.Profile
|
|
import com.github.kr328.clash.service.model.Profile
|
|
|
import com.github.kr328.clash.service.util.importedDir
|
|
import com.github.kr328.clash.service.util.importedDir
|
|
|
-import kotlinx.coroutines.GlobalScope
|
|
|
|
|
import kotlinx.coroutines.launch
|
|
import kotlinx.coroutines.launch
|
|
|
import kotlinx.coroutines.sync.Mutex
|
|
import kotlinx.coroutines.sync.Mutex
|
|
|
import kotlinx.coroutines.sync.withLock
|
|
import kotlinx.coroutines.sync.withLock
|
|
@@ -27,7 +27,7 @@ class ProfileReceiver : BroadcastReceiver() {
|
|
|
when (intent.action) {
|
|
when (intent.action) {
|
|
|
Intent.ACTION_BOOT_COMPLETED, Intent.ACTION_MY_PACKAGE_REPLACED,
|
|
Intent.ACTION_BOOT_COMPLETED, Intent.ACTION_MY_PACKAGE_REPLACED,
|
|
|
Intent.ACTION_TIMEZONE_CHANGED, Intent.ACTION_TIME_CHANGED -> {
|
|
Intent.ACTION_TIMEZONE_CHANGED, Intent.ACTION_TIME_CHANGED -> {
|
|
|
- GlobalScope.launch {
|
|
|
|
|
|
|
+ Global.launch {
|
|
|
reset()
|
|
reset()
|
|
|
|
|
|
|
|
val service = Intent(Intents.ACTION_PROFILE_SCHEDULE_UPDATES)
|
|
val service = Intent(Intents.ACTION_PROFILE_SCHEDULE_UPDATES)
|