1
1
package net.mullvad.mullvadvpn.di
2
2
3
+ import android.content.ComponentName
3
4
import android.content.Context
4
5
import android.content.SharedPreferences
5
6
import android.content.pm.PackageManager
@@ -15,8 +16,10 @@ import net.mullvad.mullvadvpn.lib.model.ApiAccessMethodName
15
16
import net.mullvad.mullvadvpn.lib.model.GeoLocationId
16
17
import net.mullvad.mullvadvpn.lib.payment.PaymentProvider
17
18
import net.mullvad.mullvadvpn.lib.shared.VoucherRepository
19
+ import net.mullvad.mullvadvpn.receiver.BootCompletedReceiver
18
20
import net.mullvad.mullvadvpn.repository.ApiAccessRepository
19
21
import net.mullvad.mullvadvpn.repository.ChangelogRepository
22
+ import net.mullvad.mullvadvpn.repository.ConnectOnStartRepository
20
23
import net.mullvad.mullvadvpn.repository.CustomListsRepository
21
24
import net.mullvad.mullvadvpn.repository.InAppNotificationController
22
25
import net.mullvad.mullvadvpn.repository.PrivacyDisclaimerRepository
@@ -98,6 +101,10 @@ val uiModule = module {
98
101
single<PackageManager > { androidContext().packageManager }
99
102
single<String >(named(SELF_PACKAGE_NAME )) { androidContext().packageName }
100
103
104
+ single<ComponentName >(named(BOOT_COMPLETED_RECEIVER_COMPONENT_NAME )) {
105
+ ComponentName (androidContext(), BootCompletedReceiver ::class .java)
106
+ }
107
+
101
108
viewModel { SplitTunnelingViewModel (get(), get(), Dispatchers .Default ) }
102
109
single { ApplicationsProvider (get(), get(named(SELF_PACKAGE_NAME ))) }
103
110
@@ -122,6 +129,7 @@ val uiModule = module {
122
129
single { VoucherRepository (get(), get()) }
123
130
single { SplitTunnelingRepository (get()) }
124
131
single { ApiAccessRepository (get()) }
132
+ single { ConnectOnStartRepository (get(), get(named(BOOT_COMPLETED_RECEIVER_COMPONENT_NAME ))) }
125
133
126
134
single { AccountExpiryNotificationUseCase (get()) }
127
135
single { TunnelStateNotificationUseCase (get()) }
@@ -188,7 +196,7 @@ val uiModule = module {
188
196
viewModel { SettingsViewModel (get(), get(), IS_PLAY_BUILD ) }
189
197
viewModel { SplashViewModel (get(), get(), get()) }
190
198
viewModel { VoucherDialogViewModel (get()) }
191
- viewModel { VpnSettingsViewModel (get(), get(), get()) }
199
+ viewModel { VpnSettingsViewModel (get(), get(), get(), get() ) }
192
200
viewModel { WelcomeViewModel (get(), get(), get(), get(), isPlayBuild = IS_PLAY_BUILD ) }
193
201
viewModel { ReportProblemViewModel (get(), get()) }
194
202
viewModel { ViewLogsViewModel (get()) }
@@ -232,3 +240,4 @@ val uiModule = module {
232
240
233
241
const val SELF_PACKAGE_NAME = " SELF_PACKAGE_NAME"
234
242
const val APP_PREFERENCES_NAME = " ${BuildConfig .APPLICATION_ID } .app_preferences"
243
+ const val BOOT_COMPLETED_RECEIVER_COMPONENT_NAME = " BOOT_COMPLETED_RECEIVER_COMPONENT_NAME"
0 commit comments