public final class Proxy extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXTRA_PROXY_INFO
Deprecated.
Because
PROXY_CHANGE_ACTION is sent whenever the proxy
for any network on the system changes, applications should always use
ConnectivityManager.getDefaultProxy() or
ConnectivityManager.getLinkProperties(Network) .LinkProperties.getHttpProxy()
to get the proxy for the Network(s) they are using. |
static String |
PROXY_CHANGE_ACTION
Used to notify an app that's caching the proxy that either the default
connection has changed or any connection's proxy has changed.
|
static int |
PROXY_EXCLLIST_INVALID |
static int |
PROXY_HOSTNAME_EMPTY |
static int |
PROXY_HOSTNAME_INVALID |
static int |
PROXY_PORT_EMPTY |
static int |
PROXY_PORT_INVALID |
static int |
PROXY_VALID |
Constructor and Description |
---|
Proxy() |
Modifier and Type | Method and Description |
---|---|
static String |
getDefaultHost()
Deprecated.
Use standard java vm proxy values to find the host, port and
exclusion list. This call ignores the exclusion list and no
longer reports only mobile-data apn-based proxy values.
|
static int |
getDefaultPort()
Deprecated.
Use standard java vm proxy values to find the host, port and
exclusion list. This call ignores the exclusion list and no
longer reports only mobile-data apn-based proxy values.
|
static String |
getHost(Context ctx)
Deprecated.
Use standard java vm proxy values to find the host, port
and exclusion list. This call ignores the exclusion list.
|
static int |
getPort(Context ctx)
Deprecated.
Use standard java vm proxy values to find the host, port
and exclusion list. This call ignores the exclusion list.
|
static Proxy |
getProxy(Context ctx,
String url)
Return the proxy object to be used for the URL given as parameter.
|
static void |
setHttpProxySystemProperty(ProxyInfo p) |
static void |
setHttpProxySystemProperty(String host,
String port,
String exclList,
Uri pacFileUrl) |
static int |
validate(String hostname,
String port,
String exclList)
Validate syntax of hostname, port and exclusion list entries
|
public static final String PROXY_CHANGE_ACTION
ConnectivityManager.getDefaultProxy()
.
This is a protected intent that can only be sent by the system
public static final String EXTRA_PROXY_INFO
PROXY_CHANGE_ACTION
is sent whenever the proxy
for any network on the system changes, applications should always use
ConnectivityManager.getDefaultProxy()
or
ConnectivityManager.getLinkProperties(Network)
.LinkProperties.getHttpProxy()
to get the proxy for the Network(s) they are using.PROXY_CHANGE_ACTION
intents.
It describes the new proxy being used (as a ProxyInfo
object).public static final int PROXY_VALID
public static final int PROXY_HOSTNAME_EMPTY
public static final int PROXY_HOSTNAME_INVALID
public static final int PROXY_PORT_EMPTY
public static final int PROXY_PORT_INVALID
public static final int PROXY_EXCLLIST_INVALID
public static final Proxy getProxy(Context ctx, String url)
ctx
- A Context used to get the settings for the proxy host.url
- A URL to be accessed. Used to evaluate exclusion list.public static final String getHost(Context ctx)
ctx
- A Context used to get the settings for the proxy host.public static final int getPort(Context ctx)
ctx
- A Context used to get the settings for the proxy port.public static final String getDefaultHost()
public static final int getDefaultPort()
public static int validate(String hostname, String port, String exclList)
public static final void setHttpProxySystemProperty(ProxyInfo p)