Fix a bug where the PAC proxy port is not set correctly.

Test: new test for this behavior in the preliminary change
Test: FrameworksNetTests NetworkStackTests
Fixes: 138810051
Fixes: 140610528
Change-Id: I95a979d232fb60ece2e33e972bf5d66d20357a1f
This commit is contained in:
Aaron Huang
2021-06-08 13:11:45 +08:00
committed by Chalard Jean
parent 1eb19caf40
commit 9fe47bee09
4 changed files with 268 additions and 97 deletions

View File

@@ -47,6 +47,8 @@ public class ProxyInfo implements Parcelable {
private final int mPort;
private final String mExclusionList;
private final String[] mParsedExclusionList;
// Uri.EMPTY if none.
@NonNull
private final Uri mPacFileUrl;
/**
@@ -256,6 +258,14 @@ public class ProxyInfo implements Parcelable {
return proxy;
}
/**
* @hide
* @return whether this proxy uses a Proxy Auto Configuration URL.
*/
public boolean isPacProxy() {
return !Uri.EMPTY.equals(mPacFileUrl);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();