From bb4c3ac73ffe97cf19c6db94ffd52615ff40ce96 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Wed, 3 Feb 2021 07:24:28 +0000 Subject: [PATCH] Revert "Refactor setCurrentProxyScriptUrl to a void method" This reverts commit a42805cd7e30098d0254bbd5372849399b688916. Reason for revert: Broke HostsideVpnTests Fix: 177943140 Change-Id: I23924181e46fd1f16a60ec420426d1ed39705050 --- .../com/android/server/connectivity/ProxyTracker.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/ProxyTracker.java b/services/core/java/com/android/server/connectivity/ProxyTracker.java index b618d2b99a..d83ff837d9 100644 --- a/services/core/java/com/android/server/connectivity/ProxyTracker.java +++ b/services/core/java/com/android/server/connectivity/ProxyTracker.java @@ -226,9 +226,9 @@ public class ProxyTracker { final ProxyInfo defaultProxy = getDefaultProxy(); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : ProxyInfo.buildDirectProxy("", 0, Collections.emptyList()); - mPacProxyInstaller.setCurrentProxyScriptUrl(proxyInfo); - if (!shouldSendBroadcast(proxyInfo)) { + if (mPacProxyInstaller.setCurrentProxyScriptUrl(proxyInfo) + == PacProxyInstaller.DONT_SEND_BROADCAST) { return; } if (DBG) Log.d(TAG, "sending Proxy Broadcast for " + proxyInfo); @@ -244,13 +244,6 @@ public class ProxyTracker { } } - private boolean shouldSendBroadcast(ProxyInfo proxy) { - if (Uri.EMPTY.equals(proxy.getPacFileUrl())) return false; - if (proxy.getPacFileUrl().equals(proxy.getPacFileUrl()) - && (proxy.getPort() > 0)) return true; - return true; - } - /** * Sets the global proxy in memory. Also writes the values to the global settings of the device. *