Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c3490c8 authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Use new RouteInfo class.

Change-Id: I144ebb87e6d1809f59ebd32e64e186d836a365f8
parent 2c3ec092
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.net.NetworkInfo.DetailedState;
import android.net.NetworkUtils;
import android.net.Proxy;
import android.net.ProxyProperties;
import android.net.RouteInfo;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiConfiguration.IpAssignment;
import android.net.wifi.WifiConfiguration.AuthAlgorithm;
@@ -434,7 +435,7 @@ public class WifiConfigController implements TextWatcher,
        } catch (IllegalArgumentException e) {
            return R.string.wifi_ip_settings_invalid_gateway;
        }
        linkProperties.addGateway(gatewayAddr);
        linkProperties.addRoute(new RouteInfo(gatewayAddr));

        String dns = mDns1View.getText().toString();
        InetAddress dnsAddr = null;
@@ -605,10 +606,13 @@ public class WifiConfigController implements TextWatcher,
                            .getNetworkPrefixLength()));
                }

                Iterator<InetAddress>gateways = linkProperties.getGateways().iterator();
                if (gateways.hasNext()) {
                    mGatewayView.setText(gateways.next().getHostAddress());
                for (RouteInfo route : linkProperties.getRoutes()) {
                    if (route.isDefaultRoute()) {
                        mGatewayView.setText(route.getGateway().getHostAddress());
                        break;
                    }
                }

                Iterator<InetAddress> dnsIterator = linkProperties.getDnses().iterator();
                if (dnsIterator.hasNext()) {
                    mDns1View.setText(dnsIterator.next().getHostAddress());