am 9417d728: am ea9003d9: am 2b44bd54: am 42445696: Merge "Support WiFi only device at runtime." into kitkat-cts-dev automerge: 545427f automerge: f6915b6

* commit '9417d7288ddd37b5d2e347a724afb76cf987f70f':
  Support WiFi only device at runtime.
This commit is contained in:
Daniel Xie
2015-08-06 05:11:27 +00:00
committed by Android Git Automerger

View File

@@ -33,6 +33,7 @@ import android.net.NetworkRequest;
import android.net.wifi.WifiManager;
import android.test.AndroidTestCase;
import android.util.Log;
import android.os.SystemProperties;
import com.android.internal.telephony.PhoneConstants;
@@ -78,10 +79,14 @@ public class ConnectivityManagerTest extends AndroidTestCase {
// Get com.android.internal.R.array.networkAttributes
int resId = getContext().getResources().getIdentifier("networkAttributes", "array", "android");
String[] naStrings = getContext().getResources().getStringArray(resId);
//TODO: What is the "correct" way to determine if this is a wifi only device?
boolean wifiOnly = SystemProperties.getBoolean("ro.radio.noril", false);
for (String naString : naStrings) {
try {
NetworkConfig n = new NetworkConfig(naString);
if (wifiOnly && ConnectivityManager.isNetworkTypeMobile(n.type)) {
continue;
}
mNetworks.put(n.type, n);
} catch (Exception e) {}
}