Merge "Remove ProxyInfo(String) and update callers to use ProxyInfo(Uri)" am: d8b9f9fc07

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1146757

Change-Id: Ib3e7b1ff5c2fbe3fd9a049b58faf26a6c355ad8f
This commit is contained in:
Aaron Huang
2020-07-17 05:53:43 +00:00
committed by Automerger Merge Worker
4 changed files with 5 additions and 15 deletions

View File

@@ -126,18 +126,6 @@ public class ProxyInfo implements Parcelable {
mPacFileUrl = pacFileUrl; mPacFileUrl = pacFileUrl;
} }
/**
* Create a ProxyProperties that points at a PAC URL.
* @hide
*/
public ProxyInfo(String pacFileUrl) {
mHost = LOCAL_HOST;
mPort = LOCAL_PORT;
mExclusionList = LOCAL_EXCL_LIST;
mParsedExclusionList = parseExclusionList(mExclusionList);
mPacFileUrl = Uri.parse(pacFileUrl);
}
/** /**
* Only used in PacManager after Local Proxy is bound. * Only used in PacManager after Local Proxy is bound.
* @hide * @hide

View File

@@ -21,6 +21,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.net.Ikev2VpnProfile; import android.net.Ikev2VpnProfile;
import android.net.PlatformVpnProfile; import android.net.PlatformVpnProfile;
import android.net.ProxyInfo; import android.net.ProxyInfo;
import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@@ -287,7 +288,7 @@ public final class VpnProfile implements Cloneable, Parcelable {
profile.proxy = new ProxyInfo(host, port.isEmpty() ? profile.proxy = new ProxyInfo(host, port.isEmpty() ?
0 : Integer.parseInt(port), exclList); 0 : Integer.parseInt(port), exclList);
} else if (!pacFileUrl.isEmpty()) { } else if (!pacFileUrl.isEmpty()) {
profile.proxy = new ProxyInfo(pacFileUrl); profile.proxy = new ProxyInfo(Uri.parse(pacFileUrl));
} }
} // else profile.proxy = null } // else profile.proxy = null

View File

@@ -163,7 +163,7 @@ public class ProxyTracker {
if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) { if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) {
ProxyInfo proxyProperties; ProxyInfo proxyProperties;
if (!TextUtils.isEmpty(pacFileUrl)) { if (!TextUtils.isEmpty(pacFileUrl)) {
proxyProperties = new ProxyInfo(pacFileUrl); proxyProperties = new ProxyInfo(Uri.parse(pacFileUrl));
} else { } else {
proxyProperties = new ProxyInfo(host, port, exclList); proxyProperties = new ProxyInfo(host, port, exclList);
} }

View File

@@ -24,6 +24,7 @@ import android.net.NetworkUtils;
import android.net.ProxyInfo; import android.net.ProxyInfo;
import android.net.RouteInfo; import android.net.RouteInfo;
import android.net.StaticIpConfiguration; import android.net.StaticIpConfiguration;
import android.net.Uri;
import android.util.ArrayMap; import android.util.ArrayMap;
import android.util.Log; import android.util.Log;
import android.util.SparseArray; import android.util.SparseArray;
@@ -372,7 +373,7 @@ public class IpConfigStore {
config.httpProxy = proxyInfo; config.httpProxy = proxyInfo;
break; break;
case PAC: case PAC:
ProxyInfo proxyPacProperties = new ProxyInfo(pacFileUrl); ProxyInfo proxyPacProperties = new ProxyInfo(Uri.parse(pacFileUrl));
config.proxySettings = proxySettings; config.proxySettings = proxySettings;
config.httpProxy = proxyPacProperties; config.httpProxy = proxyPacProperties;
break; break;