Fix error when PAC set rapidly

Stop the broadcast from being accidentally sent when PAC is in the process
of downloading / binding local proxy.  Only send broadcast when valid port
is contained (i.e. sent by PacManager).

Bug: 11168706
Change-Id: I998711fcf0a6bd82bdef413726ec41317752a57b
This commit is contained in:
Jason Monk
2013-10-14 18:24:13 -04:00
parent 00f597bc3c
commit 90760c8fa3

View File

@@ -162,7 +162,7 @@ public class PacManager {
*/
public synchronized boolean setCurrentProxyScriptUrl(ProxyProperties proxy) {
if (!TextUtils.isEmpty(proxy.getPacFileUrl())) {
if (proxy.getPacFileUrl().equals(mPacUrl)) {
if (proxy.getPacFileUrl().equals(mPacUrl) && (proxy.getPort() > 0)) {
// Allow to send broadcast, nothing to do.
return false;
}