am 46fffb06: Fix CTS testStartUsingNetworkFeature_enableHipri fail

* commit '46fffb061940ff7e11560925ff95089919886480':
  Fix CTS testStartUsingNetworkFeature_enableHipri fail
diff --git a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
index 6f67ed9..e769be1 100644
--- a/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -269,9 +269,13 @@
             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) {
@@ -305,7 +309,7 @@
             // TODO wait for HIPRI to go
             // TODO check dns selection
             // TODO check routes
-            if (!isWifiConnected) {
+            if (!isWifiEnabled) {
                 mWifiManager.setWifiEnabled(false);
             }
         }