Loading core/java/android/net/DhcpInfoInternal.java +23 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.net; import android.text.TextUtils; import android.util.Log; import java.net.InetAddress; import java.net.Inet4Address; import java.net.UnknownHostException; Loading @@ -26,6 +29,7 @@ import java.net.UnknownHostException; * @hide */ public class DhcpInfoInternal { private final static String TAG = "DhcpInfoInternal"; public String ipAddress; public String gateway; public int prefixLength; Loading Loading @@ -65,15 +69,31 @@ public class DhcpInfoInternal { } public LinkAddress makeLinkAddress() { if (TextUtils.isEmpty(ipAddress)) { Log.e(TAG, "makeLinkAddress with empty ipAddress"); return null; } return new LinkAddress(NetworkUtils.numericToInetAddress(ipAddress), prefixLength); } public LinkProperties makeLinkProperties() { LinkProperties p = new LinkProperties(); p.addLinkAddress(makeLinkAddress()); if (TextUtils.isEmpty(gateway) == false) { p.setGateway(NetworkUtils.numericToInetAddress(gateway)); } else { Log.e(TAG, "makeLinkProperties with empty gateway!"); } if (TextUtils.isEmpty(dns1) == false) { p.addDns(NetworkUtils.numericToInetAddress(dns1)); } else { Log.e(TAG, "makeLinkProperties with empty dns1!"); } if (TextUtils.isEmpty(dns2) == false) { p.addDns(NetworkUtils.numericToInetAddress(dns2)); } else { Log.e(TAG, "makeLinkProperties with empty dns2!"); } return p; } Loading core/java/android/net/NetworkUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -162,8 +162,8 @@ public class NetworkUtils { // TODO - do this for real, using a hidden method on InetAddress that aborts // instead of doing dns step if (!InetAddress.isNumeric(addrString)) { throw new IllegalArgumentException("numericToInetAddress with non numeric: " + addrString); throw new IllegalArgumentException("numericToInetAddress with non numeric: '" + addrString + "'"); } try { return InetAddress.getByName(addrString); Loading Loading
core/java/android/net/DhcpInfoInternal.java +23 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ package android.net; import android.text.TextUtils; import android.util.Log; import java.net.InetAddress; import java.net.Inet4Address; import java.net.UnknownHostException; Loading @@ -26,6 +29,7 @@ import java.net.UnknownHostException; * @hide */ public class DhcpInfoInternal { private final static String TAG = "DhcpInfoInternal"; public String ipAddress; public String gateway; public int prefixLength; Loading Loading @@ -65,15 +69,31 @@ public class DhcpInfoInternal { } public LinkAddress makeLinkAddress() { if (TextUtils.isEmpty(ipAddress)) { Log.e(TAG, "makeLinkAddress with empty ipAddress"); return null; } return new LinkAddress(NetworkUtils.numericToInetAddress(ipAddress), prefixLength); } public LinkProperties makeLinkProperties() { LinkProperties p = new LinkProperties(); p.addLinkAddress(makeLinkAddress()); if (TextUtils.isEmpty(gateway) == false) { p.setGateway(NetworkUtils.numericToInetAddress(gateway)); } else { Log.e(TAG, "makeLinkProperties with empty gateway!"); } if (TextUtils.isEmpty(dns1) == false) { p.addDns(NetworkUtils.numericToInetAddress(dns1)); } else { Log.e(TAG, "makeLinkProperties with empty dns1!"); } if (TextUtils.isEmpty(dns2) == false) { p.addDns(NetworkUtils.numericToInetAddress(dns2)); } else { Log.e(TAG, "makeLinkProperties with empty dns2!"); } return p; } Loading
core/java/android/net/NetworkUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -162,8 +162,8 @@ public class NetworkUtils { // TODO - do this for real, using a hidden method on InetAddress that aborts // instead of doing dns step if (!InetAddress.isNumeric(addrString)) { throw new IllegalArgumentException("numericToInetAddress with non numeric: " + addrString); throw new IllegalArgumentException("numericToInetAddress with non numeric: '" + addrString + "'"); } try { return InetAddress.getByName(addrString); Loading