Fix for the invalid Global Proxy Setting

b/11598568

Adding validation for Global Proxy setting before it is
being set.

Proxy is validated at the boot time also to make sure
the value set is valid.

Change-Id: Ib93d24a80af1a329694f07c47bd81dfcc1e1b874
Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com>
This commit is contained in:
Raj Mamadgi 2013-11-11 13:52:58 -08:00 • committed by Ankit Somani
commit 6bc5edab73

View file

@ -115,6 +115,16 @@ public class ProxyProperties implements Parcelable {
return false;
}
public boolean isValid() {
try {
Proxy.validate(mHost == null ? "" : mHost, mPort == 0 ? "" : Integer.toString(mPort),
mExclusionList == null ? "" : mExclusionList);
} catch (IllegalArgumentException e) {
return false;
}
return true;
}
public java.net.Proxy makeProxy() {
java.net.Proxy proxy = java.net.Proxy.NO_PROXY;
if (mHost != null) {