Loading core/java/android/net/Proxy.java +3 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.os.Build; import android.text.TextUtils; import android.util.Log; import com.android.net.module.util.ProxyUtils; import java.net.InetSocketAddress; import java.net.ProxySelector; import java.net.URI; Loading Loading @@ -251,7 +253,7 @@ public final class Proxy { if (p != null) { host = p.getHost(); port = Integer.toString(p.getPort()); exclList = p.getExclusionListAsString(); exclList = ProxyUtils.exclusionListAsString(p.getExclusionList()); pacFileUrl = p.getPacFileUrl(); } setHttpProxySystemProperty(host, port, exclList, pacFileUrl); Loading core/java/com/android/internal/net/VpnProfile.java +8 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.Parcelable; import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import com.android.net.module.util.ProxyUtils; import java.net.InetAddress; import java.nio.charset.StandardCharsets; Loading Loading @@ -285,10 +286,12 @@ public final class VpnProfile implements Cloneable, Parcelable { String exclList = (values.length > 17) ? values[17] : ""; String pacFileUrl = (values.length > 18) ? values[18] : ""; if (!host.isEmpty() || !port.isEmpty() || !exclList.isEmpty()) { profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), exclList); profile.proxy = ProxyInfo.buildDirectProxy(host, port.isEmpty() ? 0 : Integer.parseInt(port), ProxyUtils.exclusionStringAsList(exclList)); } else if (!pacFileUrl.isEmpty()) { profile.proxy = new ProxyInfo(Uri.parse(pacFileUrl)); profile.proxy = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); } } // else profile.proxy = null Loading Loading @@ -337,8 +340,8 @@ public final class VpnProfile implements Cloneable, Parcelable { builder.append(VALUE_DELIMITER).append(proxy.getPort()); builder.append(VALUE_DELIMITER) .append( proxy.getExclusionListAsString() != null ? proxy.getExclusionListAsString() ProxyUtils.exclusionListAsString(proxy.getExclusionList()) != null ? ProxyUtils.exclusionListAsString(proxy.getExclusionList()) : ""); builder.append(VALUE_DELIMITER).append(proxy.getPacFileUrl().toString()); } else { Loading services/core/java/com/android/server/connectivity/PacManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ public class PacManager { return; } if (!mHasSentBroadcast) { sendPacBroadcast(new ProxyInfo(mPacUrl, mLastPort)); sendPacBroadcast(ProxyInfo.buildPacProxy(mPacUrl, mLastPort)); mHasSentBroadcast = true; } } Loading services/core/java/com/android/server/connectivity/ProxyTracker.java +10 −5 Original line number Diff line number Diff line Loading @@ -38,7 +38,9 @@ import android.text.TextUtils; import android.util.Log; import com.android.internal.annotations.GuardedBy; import com.android.net.module.util.ProxyUtils; import java.util.Collections; import java.util.Objects; /** Loading Loading @@ -163,9 +165,10 @@ public class ProxyTracker { if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) { ProxyInfo proxyProperties; if (!TextUtils.isEmpty(pacFileUrl)) { proxyProperties = new ProxyInfo(Uri.parse(pacFileUrl)); proxyProperties = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); } else { proxyProperties = new ProxyInfo(host, port, exclList); proxyProperties = ProxyInfo.buildDirectProxy(host, port, ProxyUtils.exclusionStringAsList(exclList)); } if (!proxyProperties.isValid()) { if (DBG) Log.d(TAG, "Invalid proxy properties, ignoring: " + proxyProperties); Loading Loading @@ -204,7 +207,8 @@ public class ProxyTracker { return false; } } final ProxyInfo p = new ProxyInfo(proxyHost, proxyPort, ""); final ProxyInfo p = ProxyInfo.buildDirectProxy(proxyHost, proxyPort, Collections.emptyList()); setGlobalProxy(p); return true; } Loading @@ -219,7 +223,8 @@ public class ProxyTracker { */ public void sendProxyBroadcast() { final ProxyInfo defaultProxy = getDefaultProxy(); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : new ProxyInfo("", 0, ""); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : ProxyInfo.buildDirectProxy("", 0, Collections.emptyList()); if (mPacManager.setCurrentProxyScriptUrl(proxyInfo) == PacManager.DONT_SEND_BROADCAST) { return; } Loading Loading @@ -261,7 +266,7 @@ public class ProxyTracker { mGlobalProxy = new ProxyInfo(proxyInfo); host = mGlobalProxy.getHost(); port = mGlobalProxy.getPort(); exclList = mGlobalProxy.getExclusionListAsString(); exclList = ProxyUtils.exclusionListAsString(mGlobalProxy.getExclusionList()); pacFileUrl = Uri.EMPTY.equals(proxyInfo.getPacFileUrl()) ? "" : proxyInfo.getPacFileUrl().toString(); } else { Loading services/core/java/com/android/server/net/IpConfigStore.java +7 −4 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.util.Log; import android.util.SparseArray; import com.android.internal.annotations.VisibleForTesting; import com.android.net.module.util.ProxyUtils; import java.io.BufferedInputStream; import java.io.DataInputStream; Loading Loading @@ -123,7 +124,8 @@ public class IpConfigStore { switch (config.proxySettings) { case STATIC: ProxyInfo proxyProperties = config.httpProxy; String exclusionList = proxyProperties.getExclusionListAsString(); String exclusionList = ProxyUtils.exclusionListAsString( proxyProperties.getExclusionList()); out.writeUTF(PROXY_SETTINGS_KEY); out.writeUTF(config.proxySettings.toString()); out.writeUTF(PROXY_HOST_KEY); Loading Loading @@ -370,13 +372,14 @@ public class IpConfigStore { switch (proxySettings) { case STATIC: ProxyInfo proxyInfo = new ProxyInfo(proxyHost, proxyPort, exclusionList); ProxyInfo proxyInfo = ProxyInfo.buildDirectProxy(proxyHost, proxyPort, ProxyUtils.exclusionStringAsList(exclusionList)); config.proxySettings = proxySettings; config.httpProxy = proxyInfo; break; case PAC: ProxyInfo proxyPacProperties = new ProxyInfo(Uri.parse(pacFileUrl)); ProxyInfo proxyPacProperties = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); config.proxySettings = proxySettings; config.httpProxy = proxyPacProperties; break; Loading Loading
core/java/android/net/Proxy.java +3 −1 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import android.os.Build; import android.text.TextUtils; import android.util.Log; import com.android.net.module.util.ProxyUtils; import java.net.InetSocketAddress; import java.net.ProxySelector; import java.net.URI; Loading Loading @@ -251,7 +253,7 @@ public final class Proxy { if (p != null) { host = p.getHost(); port = Integer.toString(p.getPort()); exclList = p.getExclusionListAsString(); exclList = ProxyUtils.exclusionListAsString(p.getExclusionList()); pacFileUrl = p.getPacFileUrl(); } setHttpProxySystemProperty(host, port, exclList, pacFileUrl); Loading
core/java/com/android/internal/net/VpnProfile.java +8 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.Parcelable; import android.text.TextUtils; import com.android.internal.annotations.VisibleForTesting; import com.android.net.module.util.ProxyUtils; import java.net.InetAddress; import java.nio.charset.StandardCharsets; Loading Loading @@ -285,10 +286,12 @@ public final class VpnProfile implements Cloneable, Parcelable { String exclList = (values.length > 17) ? values[17] : ""; String pacFileUrl = (values.length > 18) ? values[18] : ""; if (!host.isEmpty() || !port.isEmpty() || !exclList.isEmpty()) { profile.proxy = new ProxyInfo(host, port.isEmpty() ? 0 : Integer.parseInt(port), exclList); profile.proxy = ProxyInfo.buildDirectProxy(host, port.isEmpty() ? 0 : Integer.parseInt(port), ProxyUtils.exclusionStringAsList(exclList)); } else if (!pacFileUrl.isEmpty()) { profile.proxy = new ProxyInfo(Uri.parse(pacFileUrl)); profile.proxy = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); } } // else profile.proxy = null Loading Loading @@ -337,8 +340,8 @@ public final class VpnProfile implements Cloneable, Parcelable { builder.append(VALUE_DELIMITER).append(proxy.getPort()); builder.append(VALUE_DELIMITER) .append( proxy.getExclusionListAsString() != null ? proxy.getExclusionListAsString() ProxyUtils.exclusionListAsString(proxy.getExclusionList()) != null ? ProxyUtils.exclusionListAsString(proxy.getExclusionList()) : ""); builder.append(VALUE_DELIMITER).append(proxy.getPacFileUrl().toString()); } else { Loading
services/core/java/com/android/server/connectivity/PacManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -390,7 +390,7 @@ public class PacManager { return; } if (!mHasSentBroadcast) { sendPacBroadcast(new ProxyInfo(mPacUrl, mLastPort)); sendPacBroadcast(ProxyInfo.buildPacProxy(mPacUrl, mLastPort)); mHasSentBroadcast = true; } } Loading
services/core/java/com/android/server/connectivity/ProxyTracker.java +10 −5 Original line number Diff line number Diff line Loading @@ -38,7 +38,9 @@ import android.text.TextUtils; import android.util.Log; import com.android.internal.annotations.GuardedBy; import com.android.net.module.util.ProxyUtils; import java.util.Collections; import java.util.Objects; /** Loading Loading @@ -163,9 +165,10 @@ public class ProxyTracker { if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) { ProxyInfo proxyProperties; if (!TextUtils.isEmpty(pacFileUrl)) { proxyProperties = new ProxyInfo(Uri.parse(pacFileUrl)); proxyProperties = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); } else { proxyProperties = new ProxyInfo(host, port, exclList); proxyProperties = ProxyInfo.buildDirectProxy(host, port, ProxyUtils.exclusionStringAsList(exclList)); } if (!proxyProperties.isValid()) { if (DBG) Log.d(TAG, "Invalid proxy properties, ignoring: " + proxyProperties); Loading Loading @@ -204,7 +207,8 @@ public class ProxyTracker { return false; } } final ProxyInfo p = new ProxyInfo(proxyHost, proxyPort, ""); final ProxyInfo p = ProxyInfo.buildDirectProxy(proxyHost, proxyPort, Collections.emptyList()); setGlobalProxy(p); return true; } Loading @@ -219,7 +223,8 @@ public class ProxyTracker { */ public void sendProxyBroadcast() { final ProxyInfo defaultProxy = getDefaultProxy(); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : new ProxyInfo("", 0, ""); final ProxyInfo proxyInfo = null != defaultProxy ? defaultProxy : ProxyInfo.buildDirectProxy("", 0, Collections.emptyList()); if (mPacManager.setCurrentProxyScriptUrl(proxyInfo) == PacManager.DONT_SEND_BROADCAST) { return; } Loading Loading @@ -261,7 +266,7 @@ public class ProxyTracker { mGlobalProxy = new ProxyInfo(proxyInfo); host = mGlobalProxy.getHost(); port = mGlobalProxy.getPort(); exclList = mGlobalProxy.getExclusionListAsString(); exclList = ProxyUtils.exclusionListAsString(mGlobalProxy.getExclusionList()); pacFileUrl = Uri.EMPTY.equals(proxyInfo.getPacFileUrl()) ? "" : proxyInfo.getPacFileUrl().toString(); } else { Loading
services/core/java/com/android/server/net/IpConfigStore.java +7 −4 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.util.Log; import android.util.SparseArray; import com.android.internal.annotations.VisibleForTesting; import com.android.net.module.util.ProxyUtils; import java.io.BufferedInputStream; import java.io.DataInputStream; Loading Loading @@ -123,7 +124,8 @@ public class IpConfigStore { switch (config.proxySettings) { case STATIC: ProxyInfo proxyProperties = config.httpProxy; String exclusionList = proxyProperties.getExclusionListAsString(); String exclusionList = ProxyUtils.exclusionListAsString( proxyProperties.getExclusionList()); out.writeUTF(PROXY_SETTINGS_KEY); out.writeUTF(config.proxySettings.toString()); out.writeUTF(PROXY_HOST_KEY); Loading Loading @@ -370,13 +372,14 @@ public class IpConfigStore { switch (proxySettings) { case STATIC: ProxyInfo proxyInfo = new ProxyInfo(proxyHost, proxyPort, exclusionList); ProxyInfo proxyInfo = ProxyInfo.buildDirectProxy(proxyHost, proxyPort, ProxyUtils.exclusionStringAsList(exclusionList)); config.proxySettings = proxySettings; config.httpProxy = proxyInfo; break; case PAC: ProxyInfo proxyPacProperties = new ProxyInfo(Uri.parse(pacFileUrl)); ProxyInfo proxyPacProperties = ProxyInfo.buildPacProxy(Uri.parse(pacFileUrl)); config.proxySettings = proxySettings; config.httpProxy = proxyPacProperties; break; Loading