Merge "Replace the hidden ProxyInfo methods usage" am: 2f66e59e05
am: 3ad73342c7
am: 168298f426
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1641827 Change-Id: Ie8f4aad4c3d89e5b06800d61719478d6b4b7afdd
This commit is contained in:
@@ -44,6 +44,8 @@ import com.android.net.module.util.ProxyUtils;
|
|||||||
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
|
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
|
||||||
import com.android.settings.core.InstrumentedFragment;
|
import com.android.settings.core.InstrumentedFragment;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class ProxySelector extends InstrumentedFragment implements DialogCreatable {
|
public class ProxySelector extends InstrumentedFragment implements DialogCreatable {
|
||||||
private static final String TAG = "ProxySelector";
|
private static final String TAG = "ProxySelector";
|
||||||
|
|
||||||
@@ -229,7 +231,9 @@ public class ProxySelector extends InstrumentedFragment implements DialogCreatab
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProxyInfo p = new ProxyInfo(hostname, port, exclList);
|
|
||||||
|
ProxyInfo p = ProxyInfo.buildDirectProxy(
|
||||||
|
hostname, port, Arrays.asList(exclList.split(",")));
|
||||||
// FIXME: The best solution would be to make a better UI that would
|
// FIXME: The best solution would be to make a better UI that would
|
||||||
// disable editing of the text boxes if the user chooses to use the
|
// disable editing of the text boxes if the user chooses to use the
|
||||||
// default settings. i.e. checking a box to always use the default
|
// default settings. i.e. checking a box to always use the default
|
||||||
|
@@ -592,7 +592,7 @@ class ConfigDialog extends AlertDialog implements TextWatcher,
|
|||||||
// 0 is a last resort default, but the interface validates that the proxy port is
|
// 0 is a last resort default, but the interface validates that the proxy port is
|
||||||
// present and non-zero.
|
// present and non-zero.
|
||||||
int port = proxyPort.isEmpty() ? 0 : Integer.parseInt(proxyPort);
|
int port = proxyPort.isEmpty() ? 0 : Integer.parseInt(proxyPort);
|
||||||
profile.proxy = new ProxyInfo(proxyHost, port, null);
|
profile.proxy = ProxyInfo.buildDirectProxy(proxyHost, port);
|
||||||
} else {
|
} else {
|
||||||
profile.proxy = null;
|
profile.proxy = null;
|
||||||
}
|
}
|
||||||
|
@@ -79,6 +79,7 @@ import com.android.settingslib.wifi.AccessPoint;
|
|||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -860,7 +861,8 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
result = R.string.proxy_error_invalid_port;
|
result = R.string.proxy_error_invalid_port;
|
||||||
}
|
}
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
mHttpProxy = new ProxyInfo(host, port, exclusionList);
|
mHttpProxy = ProxyInfo.buildDirectProxy(
|
||||||
|
host, port, Arrays.asList(exclusionList.split(",")));
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -874,7 +876,7 @@ public class WifiConfigController implements TextWatcher,
|
|||||||
if (uri == null) {
|
if (uri == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mHttpProxy = new ProxyInfo(uri);
|
mHttpProxy = ProxyInfo.buildPacProxy(uri);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -79,6 +79,7 @@ import com.android.wifitrackerlib.WifiEntry.ConnectedInfo;
|
|||||||
import java.net.Inet4Address;
|
import java.net.Inet4Address;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
@@ -822,7 +823,8 @@ public class WifiConfigController2 implements TextWatcher,
|
|||||||
result = R.string.proxy_error_invalid_port;
|
result = R.string.proxy_error_invalid_port;
|
||||||
}
|
}
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
mHttpProxy = new ProxyInfo(host, port, exclusionList);
|
mHttpProxy = ProxyInfo.buildDirectProxy(
|
||||||
|
host, port, Arrays.asList(exclusionList.split(",")));
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -836,7 +838,7 @@ public class WifiConfigController2 implements TextWatcher,
|
|||||||
if (uri == null) {
|
if (uri == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
mHttpProxy = new ProxyInfo(uri);
|
mHttpProxy = ProxyInfo.buildPacProxy(uri);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user