Use requestNetwork for mobile data, not a callback
On devices that do not have always active mobile data, it needs to be requested for onAvailable to be called. Change-Id: Ic814684bcd06389c013a6e6636487d9b47627901 Test: TH
This commit is contained in:
parent
d0d7f2aa3c
commit
837837e0fe
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ class ConnectivityCheckTest {
|
|||
val cb = TestableNetworkCallback()
|
||||
val cm = context.getSystemService(ConnectivityManager::class.java)
|
||||
?: fail("Could not get ConnectivityManager")
|
||||
cm.registerNetworkCallback(
|
||||
cm.requestNetwork(
|
||||
NetworkRequest.Builder()
|
||||
.addTransportType(TRANSPORT_CELLULAR)
|
||||
.addCapability(NET_CAPABILITY_INTERNET).build(), cb)
|
||||
|
|
|
|||
Loading…
Reference in a new issue