am fddacc60: Merge "Guarantee that PAC Local Proxy owns Port" into klp-dev

* commit 'fddacc604524ac5371c675d8e3963b5a5c475c80':
  Guarantee that PAC Local Proxy owns Port
This commit is contained in:
Jason Monk
2013-09-13 17:14:10 -07:00
committed by Android Git Automerger
2 changed files with 10 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ public class ProxyProperties implements Parcelable {
private String mPacFileUrl; private String mPacFileUrl;
public static final String LOCAL_EXCL_LIST = ""; public static final String LOCAL_EXCL_LIST = "";
public static final int LOCAL_PORT = 8182; public static final int LOCAL_PORT = -1;
public static final String LOCAL_HOST = "localhost"; public static final String LOCAL_HOST = "localhost";
public ProxyProperties(String host, int port, String exclList) { public ProxyProperties(String host, int port, String exclList) {
@@ -54,6 +54,14 @@ public class ProxyProperties implements Parcelable {
mPacFileUrl = pacFileUrl; mPacFileUrl = pacFileUrl;
} }
// Only used in PacManager after Local Proxy is bound.
public ProxyProperties(String pacFileUrl, int localProxyPort) {
mHost = LOCAL_HOST;
mPort = localProxyPort;
setExclusionList(LOCAL_EXCL_LIST);
mPacFileUrl = pacFileUrl;
}
private ProxyProperties(String host, int port, String exclList, String[] parsedExclList) { private ProxyProperties(String host, int port, String exclList, String[] parsedExclList) {
mHost = host; mHost = host;
mPort = port; mPort = port;

View File

@@ -3463,7 +3463,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private void sendProxyBroadcast(ProxyProperties proxy) { private void sendProxyBroadcast(ProxyProperties proxy) {
if (proxy == null) proxy = new ProxyProperties("", 0, ""); if (proxy == null) proxy = new ProxyProperties("", 0, "");
mPacManager.setCurrentProxyScriptUrl(proxy); if (mPacManager.setCurrentProxyScriptUrl(proxy)) return;
if (DBG) log("sending Proxy Broadcast for " + proxy); if (DBG) log("sending Proxy Broadcast for " + proxy);
Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION);
intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING |