mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-23 11:45:11 +00:00
service tests
This commit is contained in:
parent
985999899b
commit
7bdbf6e9b5
1 changed files with 2 additions and 3 deletions
|
@ -25,10 +25,9 @@ object AppUtils {
|
|||
private fun isServiceRunning(cls: Class<out Service>, context: Context): Boolean {
|
||||
val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
val runningServices = activityManager.getRunningServices(Int.MAX_VALUE)
|
||||
runningServices.forEach { info ->
|
||||
return info.service.className == cls.name
|
||||
return runningServices.any { info ->
|
||||
info.service.className == cls.name
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun sendFailure(status: Int, context: Context) {
|
||||
|
|
Loading…
Reference in a new issue