diff options
| author | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-03 13:02:05 -0700 |
|---|---|---|
| committer | Robert Greenwalt <rgreenwalt@google.com> | 2010-09-03 16:18:41 -0700 |
| commit | 70af574b3d61605e311a7b3b5cb1531d5201dc5b (patch) | |
| tree | dedd4ab7d4aab1e93d06b21c4b562458f60e534a /core/java/android/net/Proxy.java | |
| parent | 21e784496719c6ac8bd8d960aeaed73fd6a796fc (diff) | |
Some cleanup of Proxy class.
Switch to using InetSocketAddress.
Change-Id: Ibdb97fcd2d06eecaa1e847b78267180156089f27
Diffstat (limited to 'core/java/android/net/Proxy.java')
| -rw-r--r-- | core/java/android/net/Proxy.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/core/java/android/net/Proxy.java b/core/java/android/net/Proxy.java index e2e4d2c78454..9c63cd9c33e5 100644 --- a/core/java/android/net/Proxy.java +++ b/core/java/android/net/Proxy.java @@ -46,6 +46,8 @@ public final class Proxy { // Set to true to enable extra debugging. private static final boolean DEBUG = false; + // Used to notify an app that's caching the default connection proxy + // that either the default connection or its proxy has changed public static final String PROXY_CHANGE_ACTION = "android.intent.action.PROXY_CHANGE"; @@ -74,9 +76,10 @@ public final class Proxy { EXCLLIST_PATTERN = Pattern.compile(EXCLLIST_REGEXP); } + // useful because it holds the processed exclusion list - don't want to reparse it each time private static class ProxySpec { String[] exclusionList = null; - InetSocketAddress proxyAddress = null; + InetSocketAddress address = null; public ProxySpec() { }; } @@ -151,7 +154,7 @@ public final class Proxy { retval = java.net.Proxy.NO_PROXY; } else { retval = - new java.net.Proxy(java.net.Proxy.Type.HTTP, sGlobalProxySpec.proxyAddress); + new java.net.Proxy(java.net.Proxy.Type.HTTP, sGlobalProxySpec.address); } } else { // If network is WiFi, return no proxy. @@ -187,7 +190,7 @@ public final class Proxy { parseGlobalProxyInfoReadLocked(ctx); } if (sGlobalProxySpec != null) { - InetSocketAddress sa = sGlobalProxySpec.proxyAddress; + InetSocketAddress sa = sGlobalProxySpec.address; return sa.getHostName(); } return getDefaultHost(); @@ -210,7 +213,7 @@ public final class Proxy { parseGlobalProxyInfoReadLocked(ctx); } if (sGlobalProxySpec != null) { - InetSocketAddress sa = sGlobalProxySpec.proxyAddress; + InetSocketAddress sa = sGlobalProxySpec.address; return sa.getPort(); } return getDefaultPort(); @@ -389,7 +392,7 @@ public final class Proxy { int port = parsePort(proxyHost); if (proxyHost != null) { sGlobalProxySpec = new ProxySpec(); - sGlobalProxySpec.proxyAddress = new InetSocketAddress(host, port); + sGlobalProxySpec.address= new InetSocketAddress(host, port); if ((exclusionListSpec != null) && (exclusionListSpec.length() != 0)) { String[] exclusionListEntries = exclusionListSpec.toLowerCase().split(","); String[] processedEntries = new String[exclusionListEntries.length]; |
