mirror of
https://github.com/melihaksoy/Android-Kotlin-Modulerized-CleanArchitecture.git
synced 2026-03-21 08:59:29 +01:00
* replace NetworkInto with the ConnectivityManager. Since this network validation is being done at repository level, I've had to add the network dependency on it's own AndroidManifest. * moved network_state_permission from repository manifest to app's manifest. removed wildcard imports. now, network_info it's been provided and not the connectivity_manager
This commit is contained in:
committed by
Melih Aksoy
parent
9aa7a5b25f
commit
8344e7f94b
@@ -14,6 +14,10 @@ class CoreModule {
|
||||
fun proivdeAppContext(app: Application): Context = app.applicationContext
|
||||
|
||||
@Provides
|
||||
fun provideNetworkInfo(app: Application): NetworkInfo? =
|
||||
(app.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager).activeNetworkInfo
|
||||
fun provideNetworkInfo(app: Application): NetworkInfo? {
|
||||
val connectivityManager =
|
||||
app.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
return connectivityManager.activeNetworkInfo
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user