am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev

* commit 'c3f5d7183a21cb081bab1a6bca3fc115523e4e78':
  Fix null handling in proxies.
This commit is contained in:
Geoffrey Borggaard
2014-11-20 20:59:00 +00:00
committed by Android Git Automerger

View File

@@ -2532,7 +2532,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
String exclList = "";
String pacFileUrl = "";
if (proxyProperties != null && (!TextUtils.isEmpty(proxyProperties.getHost()) ||
(proxyProperties.getPacFileUrl() != null))) {
!Uri.EMPTY.equals(proxyProperties.getPacFileUrl()))) {
if (!proxyProperties.isValid()) {
if (DBG)
log("Invalid proxy properties, ignoring: " + proxyProperties.toString());
@@ -2542,7 +2542,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
host = mGlobalProxy.getHost();
port = mGlobalProxy.getPort();
exclList = mGlobalProxy.getExclusionListAsString();
if (proxyProperties.getPacFileUrl() != null) {
if (!Uri.EMPTY.equals(proxyProperties.getPacFileUrl())) {
pacFileUrl = proxyProperties.getPacFileUrl().toString();
}
} else {
@@ -2604,7 +2604,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
private void handleApplyDefaultProxy(ProxyInfo proxy) {
if (proxy != null && TextUtils.isEmpty(proxy.getHost())
&& (proxy.getPacFileUrl() == null)) {
&& Uri.EMPTY.equals(proxy.getPacFileUrl())) {
proxy = null;
}
synchronized (mProxyLock) {
@@ -2620,7 +2620,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
// global (to get the correct local port), and send a broadcast.
// TODO: Switch PacManager to have its own message to send back rather than
// reusing EVENT_HAS_CHANGED_PROXY and this call to handleApplyDefaultProxy.
if ((mGlobalProxy != null) && (proxy != null) && (proxy.getPacFileUrl() != null)
if ((mGlobalProxy != null) && (proxy != null)
&& (!Uri.EMPTY.equals(proxy.getPacFileUrl()))
&& proxy.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) {
mGlobalProxy = proxy;
sendProxyBroadcast(mGlobalProxy);