am e260657a: am 45643db7: am 03786bc4: am 545427fc: Merge "Support WiFi only device at runtime." into kitkat-cts-dev
* commit 'e260657a086ed507a80e8809315d22495faa15e4': Support WiFi only device at runtime.
This commit is contained in:
@@ -29,6 +29,7 @@ import android.net.NetworkInfo.State;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.test.AndroidTestCase;
|
||||
import android.util.Log;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
import com.android.internal.telephony.PhoneConstants;
|
||||
|
||||
@@ -70,10 +71,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) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user