Loading services/core/java/com/android/server/ConnectivityService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -3495,7 +3495,7 @@ public class ConnectivityService extends IConnectivityManager.Stub ProxyInfo oldProxyInfo = oldLp == null ? null : oldLp.getHttpProxy(); ProxyInfo oldProxyInfo = oldLp == null ? null : oldLp.getHttpProxy(); if (!ProxyTracker.proxyInfoEqual(newProxyInfo, oldProxyInfo)) { if (!ProxyTracker.proxyInfoEqual(newProxyInfo, oldProxyInfo)) { mProxyTracker.sendProxyBroadcast(mProxyTracker.getDefaultProxy()); mProxyTracker.sendProxyBroadcast(); } } } } Loading services/core/java/com/android/server/connectivity/ProxyTracker.java +10 −11 Original line number Original line Diff line number Diff line Loading @@ -126,9 +126,9 @@ public class ProxyTracker { public ProxyInfo getDefaultProxy() { public ProxyInfo getDefaultProxy() { // This information is already available as a world read/writable jvm property. // This information is already available as a world read/writable jvm property. synchronized (mProxyLock) { synchronized (mProxyLock) { final ProxyInfo ret = mGlobalProxy; if (mGlobalProxy != null) return mGlobalProxy; if ((ret == null) && mDefaultProxyEnabled) return mDefaultProxy; if (mDefaultProxyEnabled) return mDefaultProxy; return ret; return null; } } } } Loading Loading @@ -204,11 +204,10 @@ public class ProxyTracker { * * * Confusingly this method also sets the PAC file URL. TODO : separate this, it has nothing * Confusingly this method also sets the PAC file URL. TODO : separate this, it has nothing * to do in a "sendProxyBroadcast" method. * to do in a "sendProxyBroadcast" method. * @param proxyInfo the proxy spec, or null for no proxy. */ */ // TODO : make the argument NonNull final and the method private public void sendProxyBroadcast() { public void sendProxyBroadcast(@Nullable ProxyInfo proxyInfo) { final ProxyInfo defaultProxy = getDefaultProxy(); if (proxyInfo == null) proxyInfo = new ProxyInfo("", 0, ""); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : new ProxyInfo("", 0, ""); if (mPacManager.setCurrentProxyScriptUrl(proxyInfo)) return; if (mPacManager.setCurrentProxyScriptUrl(proxyInfo)) return; if (DBG) Slog.d(TAG, "sending Proxy Broadcast for " + proxyInfo); if (DBG) Slog.d(TAG, "sending Proxy Broadcast for " + proxyInfo); Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); Loading Loading @@ -269,7 +268,7 @@ public class ProxyTracker { Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token); } } sendProxyBroadcast(mGlobalProxy == null ? mDefaultProxy : proxyInfo); sendProxyBroadcast(); } } } } Loading @@ -296,14 +295,14 @@ public class ProxyTracker { && (!Uri.EMPTY.equals(proxyInfo.getPacFileUrl())) && (!Uri.EMPTY.equals(proxyInfo.getPacFileUrl())) && proxyInfo.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) { && proxyInfo.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) { mGlobalProxy = proxyInfo; mGlobalProxy = proxyInfo; sendProxyBroadcast(mGlobalProxy); sendProxyBroadcast(); return; return; } } mDefaultProxy = proxyInfo; mDefaultProxy = proxyInfo; if (mGlobalProxy != null) return; if (mGlobalProxy != null) return; if (mDefaultProxyEnabled) { if (mDefaultProxyEnabled) { sendProxyBroadcast(proxyInfo); sendProxyBroadcast(); } } } } } } Loading @@ -320,7 +319,7 @@ public class ProxyTracker { if (mDefaultProxyEnabled != enabled) { if (mDefaultProxyEnabled != enabled) { mDefaultProxyEnabled = enabled; mDefaultProxyEnabled = enabled; if (mGlobalProxy == null && mDefaultProxy != null) { if (mGlobalProxy == null && mDefaultProxy != null) { sendProxyBroadcast(enabled ? mDefaultProxy : null); sendProxyBroadcast(); } } } } } } Loading Loading
services/core/java/com/android/server/ConnectivityService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -3495,7 +3495,7 @@ public class ConnectivityService extends IConnectivityManager.Stub ProxyInfo oldProxyInfo = oldLp == null ? null : oldLp.getHttpProxy(); ProxyInfo oldProxyInfo = oldLp == null ? null : oldLp.getHttpProxy(); if (!ProxyTracker.proxyInfoEqual(newProxyInfo, oldProxyInfo)) { if (!ProxyTracker.proxyInfoEqual(newProxyInfo, oldProxyInfo)) { mProxyTracker.sendProxyBroadcast(mProxyTracker.getDefaultProxy()); mProxyTracker.sendProxyBroadcast(); } } } } Loading
services/core/java/com/android/server/connectivity/ProxyTracker.java +10 −11 Original line number Original line Diff line number Diff line Loading @@ -126,9 +126,9 @@ public class ProxyTracker { public ProxyInfo getDefaultProxy() { public ProxyInfo getDefaultProxy() { // This information is already available as a world read/writable jvm property. // This information is already available as a world read/writable jvm property. synchronized (mProxyLock) { synchronized (mProxyLock) { final ProxyInfo ret = mGlobalProxy; if (mGlobalProxy != null) return mGlobalProxy; if ((ret == null) && mDefaultProxyEnabled) return mDefaultProxy; if (mDefaultProxyEnabled) return mDefaultProxy; return ret; return null; } } } } Loading Loading @@ -204,11 +204,10 @@ public class ProxyTracker { * * * Confusingly this method also sets the PAC file URL. TODO : separate this, it has nothing * Confusingly this method also sets the PAC file URL. TODO : separate this, it has nothing * to do in a "sendProxyBroadcast" method. * to do in a "sendProxyBroadcast" method. * @param proxyInfo the proxy spec, or null for no proxy. */ */ // TODO : make the argument NonNull final and the method private public void sendProxyBroadcast() { public void sendProxyBroadcast(@Nullable ProxyInfo proxyInfo) { final ProxyInfo defaultProxy = getDefaultProxy(); if (proxyInfo == null) proxyInfo = new ProxyInfo("", 0, ""); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : new ProxyInfo("", 0, ""); if (mPacManager.setCurrentProxyScriptUrl(proxyInfo)) return; if (mPacManager.setCurrentProxyScriptUrl(proxyInfo)) return; if (DBG) Slog.d(TAG, "sending Proxy Broadcast for " + proxyInfo); if (DBG) Slog.d(TAG, "sending Proxy Broadcast for " + proxyInfo); Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION); Loading Loading @@ -269,7 +268,7 @@ public class ProxyTracker { Binder.restoreCallingIdentity(token); Binder.restoreCallingIdentity(token); } } sendProxyBroadcast(mGlobalProxy == null ? mDefaultProxy : proxyInfo); sendProxyBroadcast(); } } } } Loading @@ -296,14 +295,14 @@ public class ProxyTracker { && (!Uri.EMPTY.equals(proxyInfo.getPacFileUrl())) && (!Uri.EMPTY.equals(proxyInfo.getPacFileUrl())) && proxyInfo.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) { && proxyInfo.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) { mGlobalProxy = proxyInfo; mGlobalProxy = proxyInfo; sendProxyBroadcast(mGlobalProxy); sendProxyBroadcast(); return; return; } } mDefaultProxy = proxyInfo; mDefaultProxy = proxyInfo; if (mGlobalProxy != null) return; if (mGlobalProxy != null) return; if (mDefaultProxyEnabled) { if (mDefaultProxyEnabled) { sendProxyBroadcast(proxyInfo); sendProxyBroadcast(); } } } } } } Loading @@ -320,7 +319,7 @@ public class ProxyTracker { if (mDefaultProxyEnabled != enabled) { if (mDefaultProxyEnabled != enabled) { mDefaultProxyEnabled = enabled; mDefaultProxyEnabled = enabled; if (mGlobalProxy == null && mDefaultProxy != null) { if (mGlobalProxy == null && mDefaultProxy != null) { sendProxyBroadcast(enabled ? mDefaultProxy : null); sendProxyBroadcast(); } } } } } } Loading