Fix CTS testStartUsingNetworkFeature_enableHipri fail
The return value of mWifiManager.isWifiEnabled() && mWifiManager.getConnectionInfo().getSSID() != null can not correctly identify if WiFi is connected or not. The fix is to modify the code logic used to judge if WiFi is connected. Bug 15578218 and 15578219 Change-Id: I8ae40980c9cd1ea91dafe0ca7c893c84b35709bf Signed-off-by: Benson Huang <benson.huang@mediatek.com>
This commit is contained in:
@@ -272,9 +272,13 @@ public class ConnectivityManagerTest extends AndroidTestCase {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean isWifiConnected = mWifiManager.isWifiEnabled()
|
||||
&& mWifiManager.getConnectionInfo().getSSID() != null;
|
||||
boolean isWifiEnabled = mWifiManager.isWifiEnabled();
|
||||
boolean isWifiConnected = false;
|
||||
|
||||
NetworkInfo nwInfo = mCm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
if (nwInfo != null) {
|
||||
isWifiConnected = nwInfo.isConnected();
|
||||
}
|
||||
try {
|
||||
// Make sure WiFi is connected to an access point.
|
||||
if (!isWifiConnected) {
|
||||
@@ -308,7 +312,7 @@ public class ConnectivityManagerTest extends AndroidTestCase {
|
||||
// TODO wait for HIPRI to go
|
||||
// TODO check dns selection
|
||||
// TODO check routes
|
||||
if (!isWifiConnected) {
|
||||
if (!isWifiEnabled) {
|
||||
mWifiManager.setWifiEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user