diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt index 7ac3482e7..9870286e9 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/framework/ViewModel.kt @@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicLong } open fun onDestroy() { - handler.postDelayed(cleanup, cleanupDelayMs) + handler.postDelayed(cleanup, CLEANUP_DELAY_MS) } open fun onCleanup() { @@ -45,7 +45,7 @@ import java.util.concurrent.atomic.AtomicLong .subscribeOn(AndroidSchedulers.mainThread()) } - val context: Context = Application.instance!! + val context: Context = Application.instance internal val cleanup = Runnable { idToInstance.remove(id) @@ -67,7 +67,7 @@ import java.util.concurrent.atomic.AtomicLong } companion object { - private val cleanupDelayMs = 3000L + private const val CLEANUP_DELAY_MS = 3000L private val nextId = AtomicLong(System.currentTimeMillis() + 0) private val handler by lazy { Handler(Looper.getMainLooper()) } private val idToInstance = mutableMapOf>()