OSDN Git Service

Fix build.
authorJean-Baptiste Queru <jbq@google.com>
Fri, 16 Jul 2010 22:18:56 +0000 (15:18 -0700)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 5 Aug 2011 08:05:42 +0000 (16:05 +0800)
Switch to using public APIs instead of private ones.

Change-Id: Ia3468d94b3dadeb6a000ce419ee08f7e7ba5dc67

core/java/android/net/Proxy.java

index 39d4ac1..22c30a5 100644 (file)
@@ -16,8 +16,6 @@
 
 package android.net;
 
-import org.apache.harmony.luni.platform.INetworkSystem;
-import org.apache.harmony.luni.platform.Platform;
 import org.apache.http.HttpHost;
 
 import android.content.ContentResolver;
@@ -44,8 +42,6 @@ final public class Proxy {
     static final public String PROXY_CHANGE_ACTION =
         "android.intent.action.PROXY_CHANGE";
 
-    static final private INetworkSystem NETIMPL = Platform.getNetworkSystem();
-
     /**
      * Return the proxy host set by the user.
      * @param ctx A Context used to get the settings for the proxy host.
@@ -169,8 +165,7 @@ final public class Proxy {
                 if (host.equalsIgnoreCase("localhost")) {
                     return true;
                 }
-                if (InetAddress.getByAddress(NETIMPL.ipStringToByteArray(host))
-                        .isLoopbackAddress()) {
+                if (InetAddress.getByName(host).isLoopbackAddress()) {
                     return true;
                 }
             }