Merge "Change the location of WiFi Initialize() API within the same function" am: 26d8f5808b am: 6e599930dd am: 883afff147
Change-Id: I105289e5db38cf9475dbaf377733f069940825b2
This commit is contained in:
@@ -272,6 +272,14 @@ public class ConcurrencyTest extends AndroidTestCase {
|
||||
+ " 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;
|
||||
while (!mWifiManager.isWifiEnabled() && System.currentTimeMillis() < timeout) {
|
||||
try {
|
||||
@@ -288,14 +296,6 @@ public class ConcurrencyTest extends AndroidTestCase {
|
||||
assertEquals(WifiManager.WIFI_STATE_ENABLED, mMySync.expectedWifiState);
|
||||
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));
|
||||
// wait for changing to EnabledState
|
||||
assertNotNull(mMySync.expectedNetworkInfo);
|
||||
|
||||
Reference in New Issue
Block a user