Support core status check and force restart Optimize proxies page and access page Update flutter and pub dependencies Update go version Optimize more details
27 lines
873 B
Kotlin
27 lines
873 B
Kotlin
package com.follow.clash
|
|
|
|
import android.content.BroadcastReceiver
|
|
import android.content.Context
|
|
import android.content.Intent
|
|
import com.follow.clash.common.BroadcastAction
|
|
import com.follow.clash.common.GlobalState
|
|
import com.follow.clash.common.action
|
|
import kotlinx.coroutines.launch
|
|
|
|
class BroadcastReceiver : BroadcastReceiver() {
|
|
override fun onReceive(context: Context?, intent: Intent?) {
|
|
when (intent?.action) {
|
|
BroadcastAction.SERVICE_CREATED.action -> {
|
|
GlobalState.log("Receiver service created")
|
|
GlobalState.launch {
|
|
State.handleStartServiceAction()
|
|
}
|
|
}
|
|
|
|
BroadcastAction.SERVICE_DESTROYED.action -> {
|
|
GlobalState.log("Receiver service destroyed")
|
|
State.handleStopServiceAction()
|
|
}
|
|
}
|
|
}
|
|
} |