Merge "Fix for bug 4144936: [Proxy setting]: traffic to a bypass domain doesn't bypass proxy DO NOT MERGE" into honeycomb-mr2
This commit is contained in:
committed by
Android (Google) Code Review
commit
36ac304c6e
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.webkit;
|
||||
|
||||
import android.net.ProxyProperties;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -294,6 +295,20 @@ final class JWebCoreJavaBridge extends Handler {
|
||||
mContentUriToFilePathMap.put(contentUri, path);
|
||||
}
|
||||
|
||||
public void updateProxy(ProxyProperties proxyProperties) {
|
||||
if (proxyProperties == null) {
|
||||
nativeUpdateProxy("", "");
|
||||
return;
|
||||
}
|
||||
|
||||
String host = proxyProperties.getHost();
|
||||
int port = proxyProperties.getPort();
|
||||
if (port != 0)
|
||||
host += ":" + port;
|
||||
|
||||
nativeUpdateProxy(host, proxyProperties.getExclusionList());
|
||||
}
|
||||
|
||||
private native void nativeConstructor();
|
||||
private native void nativeFinalize();
|
||||
private native void sharedTimerFired();
|
||||
@@ -304,5 +319,5 @@ final class JWebCoreJavaBridge extends Handler {
|
||||
public native void addPackageNames(Set<String> packageNames);
|
||||
public native void addPackageName(String packageName);
|
||||
public native void removePackageName(String packageName);
|
||||
public native void updateProxy(String newProxy);
|
||||
public native void nativeUpdateProxy(String newProxy, String exclusionList);
|
||||
}
|
||||
|
||||
@@ -1045,20 +1045,10 @@ public class WebView extends AbsoluteLayout
|
||||
private static void handleProxyBroadcast(Intent intent) {
|
||||
ProxyProperties proxyProperties = (ProxyProperties)intent.getExtra(Proxy.EXTRA_PROXY_INFO);
|
||||
if (proxyProperties == null || proxyProperties.getHost() == null) {
|
||||
WebViewCore.sendStaticMessage(EventHub.PROXY_CHANGED, "");
|
||||
WebViewCore.sendStaticMessage(EventHub.PROXY_CHANGED, null);
|
||||
return;
|
||||
}
|
||||
|
||||
String host = proxyProperties.getHost();
|
||||
int port = proxyProperties.getPort();
|
||||
if (port != 0)
|
||||
host += ":" + port;
|
||||
|
||||
// TODO: Handle exclusion list
|
||||
// The plan is to make an AndroidProxyResolver, and handle the blacklist
|
||||
// there
|
||||
String exclusionList = proxyProperties.getExclusionList();
|
||||
WebViewCore.sendStaticMessage(EventHub.PROXY_CHANGED, host);
|
||||
WebViewCore.sendStaticMessage(EventHub.PROXY_CHANGED, proxyProperties);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.graphics.Point;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.media.MediaFile;
|
||||
import android.net.ProxyProperties;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -705,7 +706,7 @@ final class WebViewCore {
|
||||
throw new IllegalStateException(
|
||||
"No WebView has been created in this process!");
|
||||
}
|
||||
BrowserFrame.sJavaBridge.updateProxy((String) msg.obj);
|
||||
BrowserFrame.sJavaBridge.updateProxy((ProxyProperties)msg.obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user