diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt index 2dbe6b6b..4c419e52 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/UpdateReceiver.kt @@ -21,17 +21,21 @@ import android.content.Context import android.content.Intent import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs +import org.koin.core.KoinComponent +import org.koin.core.inject /** * Created by Allan Wang on 2017-05-31. * * Receiver that is triggered whenever the app updates so it can bind the notifications again */ -class UpdateReceiver : BroadcastReceiver() { +class UpdateReceiver : BroadcastReceiver(), KoinComponent { + + private val prefs: Prefs by inject() override fun onReceive(context: Context, intent: Intent) { if (intent.action != Intent.ACTION_MY_PACKAGE_REPLACED) return L.d { "Frost has updated" } - context.scheduleNotifications(Prefs.notificationFreq) // Update notifications + context.scheduleNotifications(prefs.notificationFreq) // Update notifications } } |