Merge "Change the location of WiFi Initialize() API within the same function" am: 26d8f5808b
Change-Id: I077641561f2c970e980d37a69fc248cd2d67f8ad
This commit is contained in:
@@ -272,6 +272,14 @@ public class ConcurrencyTest extends AndroidTestCase {
|
|||||||
+ " needs Location enabled.");
|
+ " needs Location enabled.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mWifiP2pManager =
|
||||||
|
(WifiP2pManager) getContext().getSystemService(Context.WIFI_P2P_SERVICE);
|
||||||
|
mWifiP2pChannel = mWifiP2pManager.initialize(
|
||||||
|
getContext(), getContext().getMainLooper(), null);
|
||||||
|
|
||||||
|
assertNotNull(mWifiP2pManager);
|
||||||
|
assertNotNull(mWifiP2pChannel);
|
||||||
|
|
||||||
long timeout = System.currentTimeMillis() + TIMEOUT_MSEC;
|
long timeout = System.currentTimeMillis() + TIMEOUT_MSEC;
|
||||||
while (!mWifiManager.isWifiEnabled() && System.currentTimeMillis() < timeout) {
|
while (!mWifiManager.isWifiEnabled() && System.currentTimeMillis() < timeout) {
|
||||||
try {
|
try {
|
||||||
@@ -288,14 +296,6 @@ public class ConcurrencyTest extends AndroidTestCase {
|
|||||||
assertEquals(WifiManager.WIFI_STATE_ENABLED, mMySync.expectedWifiState);
|
assertEquals(WifiManager.WIFI_STATE_ENABLED, mMySync.expectedWifiState);
|
||||||
assertEquals(WifiP2pManager.WIFI_P2P_STATE_ENABLED, mMySync.expectedP2pState);
|
assertEquals(WifiP2pManager.WIFI_P2P_STATE_ENABLED, mMySync.expectedP2pState);
|
||||||
|
|
||||||
mWifiP2pManager =
|
|
||||||
(WifiP2pManager) getContext().getSystemService(Context.WIFI_P2P_SERVICE);
|
|
||||||
mWifiP2pChannel = mWifiP2pManager.initialize(
|
|
||||||
getContext(), getContext().getMainLooper(), null);
|
|
||||||
|
|
||||||
assertNotNull(mWifiP2pManager);
|
|
||||||
assertNotNull(mWifiP2pChannel);
|
|
||||||
|
|
||||||
assertTrue(waitForBroadcasts(MySync.NETWORK_INFO));
|
assertTrue(waitForBroadcasts(MySync.NETWORK_INFO));
|
||||||
// wait for changing to EnabledState
|
// wait for changing to EnabledState
|
||||||
assertNotNull(mMySync.expectedNetworkInfo);
|
assertNotNull(mMySync.expectedNetworkInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user