am d292caf4: Merge "Support WiFi only device at runtime." into jb-mr2-dev

* commit 'd292caf445208d79e135963bbbfce3fef18830aa':
  Support WiFi only device at runtime.
This commit is contained in:
Wink Saville
2013-04-24 08:47:45 -07:00
committed by Android Git Automerger

View File

@@ -432,6 +432,9 @@ public class ConnectivityService extends IConnectivityManager.Stub {
mRadioAttributes[r.mType] = r;
}
// TODO: What is the "correct" way to do determine if this is a wifi only device?
boolean wifiOnly = SystemProperties.getBoolean("ro.radio.noril", false);
log("wifiOnly=" + wifiOnly);
String[] naStrings = context.getResources().getStringArray(
com.android.internal.R.array.networkAttributes);
for (String naString : naStrings) {
@@ -442,6 +445,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
n.type);
continue;
}
if (wifiOnly && ConnectivityManager.isNetworkTypeMobile(n.type)) {
log("networkAttributes - ignoring mobile as this dev is wifiOnly " +
n.type);
continue;
}
if (mNetConfigs[n.type] != null) {
loge("Error in networkAttributes - ignoring attempt to redefine type " +
n.type);