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:
parent
5547882084
commit
6bc5edab73
1 changed files with 24 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue