summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/net/Proxy.java10
-rw-r--r--core/java/android/server/BluetoothPanProfileHandler.java7
2 files changed, 6 insertions, 11 deletions
diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java
index f750122..a408ea0 100644
--- a/core/java/android/net/Proxy.java
+++ b/core/java/android/net/Proxy.java
@@ -233,17 +233,11 @@ public final class Proxy {
if (host.equalsIgnoreCase("localhost")) {
return true;
}
- // Check we have a numeric address so we don't cause a DNS lookup in getByName.
- if (InetAddress.isNumeric(host)) {
- if (InetAddress.getByName(host).isLoopbackAddress()) {
- return true;
- }
+ if (NetworkUtils.numericToInetAddress(host).isLoopbackAddress()) {
+ return true;
}
}
- } catch (UnknownHostException ignored) {
- // Can't happen for a numeric address (InetAddress.getByName).
} catch (IllegalArgumentException iex) {
- // Ignore (URI.create)
}
return false;
}
diff --git a/core/java/android/server/BluetoothPanProfileHandler.java b/core/java/android/server/BluetoothPanProfileHandler.java
index 3f24811..8925856 100644
--- a/core/java/android/server/BluetoothPanProfileHandler.java
+++ b/core/java/android/server/BluetoothPanProfileHandler.java
@@ -28,6 +28,7 @@ import android.content.res.Resources.NotFoundException;
import android.net.ConnectivityManager;
import android.net.InterfaceConfiguration;
import android.net.LinkAddress;
+import android.net.NetworkUtils;
import android.os.IBinder;
import android.os.INetworkManagementService;
import android.os.ServiceManager;
@@ -379,9 +380,9 @@ final class BluetoothPanProfileHandler {
if (ifcg != null) {
InetAddress addr = null;
if (ifcg.addr == null || (addr = ifcg.addr.getAddress()) == null ||
- addr.equals(InetAddress.getByName("0.0.0.0")) ||
- addr.equals(InetAddress.getByName("::0"))) {
- addr = InetAddress.getByName(address);
+ addr.equals(NetworkUtils.numericToInetAddress("0.0.0.0")) ||
+ addr.equals(NetworkUtils.numericToInetAddress("::0"))) {
+ addr = NetworkUtils.numericToInetAddress(address);
}
ifcg.interfaceFlags = ifcg.interfaceFlags.replace("down", "up");
ifcg.addr = new LinkAddress(addr, BLUETOOTH_PREFIX_LENGTH);