Return detailed reason of invalid proxy settings
Make Proxy.validate() return valid/invalid int code, instead of throwing exceptions. If invalid, detailed reason code is returned (currently for Settings UI use). bug: 13248097 Change-Id: Ic68d03f666f1cd63667afc311de7dc370d233901
This commit is contained in:
@@ -140,13 +140,9 @@ public class ProxyProperties implements Parcelable {
|
|||||||
|
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!TextUtils.isEmpty(mPacFileUrl)) return true;
|
if (!TextUtils.isEmpty(mPacFileUrl)) return true;
|
||||||
try {
|
return Proxy.PROXY_VALID == Proxy.validate(mHost == null ? "" : mHost,
|
||||||
Proxy.validate(mHost == null ? "" : mHost, mPort == 0 ? "" : Integer.toString(mPort),
|
mPort == 0 ? "" : Integer.toString(mPort),
|
||||||
mExclusionList == null ? "" : mExclusionList);
|
mExclusionList == null ? "" : mExclusionList);
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public java.net.Proxy makeProxy() {
|
public java.net.Proxy makeProxy() {
|
||||||
|
|||||||
Reference in New Issue
Block a user