0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-23 11:45:11 +00:00

service tests

This commit is contained in:
X1nto 2020-08-08 22:58:22 +04:00
parent 985999899b
commit 7bdbf6e9b5

View file

@ -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) {