mirror of
https://github.com/home-assistant/android
synced 2024-09-06 17:23:32 +00:00
Dagger Injection Fixes (#764)
* Fix sensor receiver fatal error * Fix other missing applicationContext in other locations. Co-authored-by: Daniel Shokouhi <dshokouhi@gmail.com>
This commit is contained in:
parent
705702f087
commit
15735f24c9
|
@ -73,7 +73,7 @@ class MessagingService : FirebaseMessagingService() {
|
|||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
DaggerServiceComponent.builder()
|
||||
.appComponent((applicationContext as GraphComponentAccessor).appComponent)
|
||||
.appComponent((applicationContext.applicationContext as GraphComponentAccessor).appComponent)
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class SensorReceiver : BroadcastReceiver() {
|
|||
override fun onReceive(context: Context, intent: Intent) {
|
||||
|
||||
DaggerSensorComponent.builder()
|
||||
.appComponent((context as GraphComponentAccessor).appComponent)
|
||||
.appComponent((context.applicationContext as GraphComponentAccessor).appComponent)
|
||||
.build()
|
||||
.inject(this)
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class SensorWorker(
|
|||
|
||||
init {
|
||||
DaggerSensorComponent.builder()
|
||||
.appComponent((appContext as GraphComponentAccessor).appComponent)
|
||||
.appComponent((appContext.applicationContext as GraphComponentAccessor).appComponent)
|
||||
.build()
|
||||
.inject(this)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue