Merge "Change the location of WiFi Initialize() API within the same function" am: 26d8f5808b

Change-Id: I077641561f2c970e980d37a69fc248cd2d67f8ad
This commit is contained in:
Automerger Merge Worker
2020-01-31 16:31:36 +00:00

View File

@@ -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);