Fix many compilation warnings

This commit is contained in:
inorichi
2017-10-28 19:12:17 +02:00
parent 827792c4f0
commit 4ae00c80ca
21 changed files with 43 additions and 41 deletions

View File

@@ -143,6 +143,7 @@ fun Context.unregisterLocalReceiver(receiver: BroadcastReceiver) {
fun Context.isServiceRunning(serviceClass: Class<*>): Boolean {
val className = serviceClass.name
val manager = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
@Suppress("DEPRECATION")
return manager.getRunningServices(Integer.MAX_VALUE)
.any { className == it.service.className }
}