mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -04:00
Asserted manager to be non-null
This commit is contained in:
parent
6935fa6141
commit
dc58e64ea3
@ -56,6 +56,12 @@ object KiwixModule {
|
||||
|
||||
@Provides
|
||||
@KiwixScope
|
||||
fun providesWiFiP2pManager(context: Context): WifiP2pManager =
|
||||
context.getSystemService(Context.WIFI_P2P_SERVICE) as WifiP2pManager
|
||||
fun providesWiFiP2pManager(context: Context): WifiP2pManager {
|
||||
val manager: WifiP2pManager? by lazy(LazyThreadSafetyMode.NONE) {
|
||||
context.getSystemService(
|
||||
Context.WIFI_P2P_SERVICE
|
||||
) as WifiP2pManager
|
||||
}
|
||||
return manager!!
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user