Merge "Unhide WifiConfiguration proxy accessors" am: c82d1ddaf4 am: d2f5fd3c42
am: 878fcfaa22
Change-Id: Ib4a59d41088ba00b21ccaeea6a9e7578c24ab8da
This commit is contained in:
@@ -24528,7 +24528,9 @@ package android.net.wifi {
|
|||||||
public class WifiConfiguration implements android.os.Parcelable {
|
public class WifiConfiguration implements android.os.Parcelable {
|
||||||
ctor public WifiConfiguration();
|
ctor public WifiConfiguration();
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
|
method public android.net.ProxyInfo getHttpProxy();
|
||||||
method public boolean isPasspoint();
|
method public boolean isPasspoint();
|
||||||
|
method public void setHttpProxy(android.net.ProxyInfo);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field public java.lang.String BSSID;
|
field public java.lang.String BSSID;
|
||||||
field public java.lang.String FQDN;
|
field public java.lang.String FQDN;
|
||||||
|
|||||||
@@ -26865,9 +26865,11 @@ package android.net.wifi {
|
|||||||
public class WifiConfiguration implements android.os.Parcelable {
|
public class WifiConfiguration implements android.os.Parcelable {
|
||||||
ctor public WifiConfiguration();
|
ctor public WifiConfiguration();
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
|
method public android.net.ProxyInfo getHttpProxy();
|
||||||
method public boolean hasNoInternetAccess();
|
method public boolean hasNoInternetAccess();
|
||||||
method public boolean isNoInternetAccessExpected();
|
method public boolean isNoInternetAccessExpected();
|
||||||
method public boolean isPasspoint();
|
method public boolean isPasspoint();
|
||||||
|
method public void setHttpProxy(android.net.ProxyInfo);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field public java.lang.String BSSID;
|
field public java.lang.String BSSID;
|
||||||
field public java.lang.String FQDN;
|
field public java.lang.String FQDN;
|
||||||
|
|||||||
@@ -24601,7 +24601,9 @@ package android.net.wifi {
|
|||||||
public class WifiConfiguration implements android.os.Parcelable {
|
public class WifiConfiguration implements android.os.Parcelable {
|
||||||
ctor public WifiConfiguration();
|
ctor public WifiConfiguration();
|
||||||
method public int describeContents();
|
method public int describeContents();
|
||||||
|
method public android.net.ProxyInfo getHttpProxy();
|
||||||
method public boolean isPasspoint();
|
method public boolean isPasspoint();
|
||||||
|
method public void setHttpProxy(android.net.ProxyInfo);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field public java.lang.String BSSID;
|
field public java.lang.String BSSID;
|
||||||
field public java.lang.String FQDN;
|
field public java.lang.String FQDN;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.net.IpConfiguration;
|
|||||||
import android.net.IpConfiguration.ProxySettings;
|
import android.net.IpConfiguration.ProxySettings;
|
||||||
import android.net.ProxyInfo;
|
import android.net.ProxyInfo;
|
||||||
import android.net.StaticIpConfiguration;
|
import android.net.StaticIpConfiguration;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
@@ -1812,14 +1813,48 @@ public class WifiConfiguration implements Parcelable {
|
|||||||
mIpConfiguration.proxySettings = proxySettings;
|
mIpConfiguration.proxySettings = proxySettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/**
|
||||||
|
* Returns the HTTP proxy used by this object.
|
||||||
|
* @return a {@link ProxyInfo httpProxy} representing the proxy specified by this
|
||||||
|
* WifiConfiguration, or {@code null} if no proxy is specified.
|
||||||
|
*/
|
||||||
public ProxyInfo getHttpProxy() {
|
public ProxyInfo getHttpProxy() {
|
||||||
return mIpConfiguration.httpProxy;
|
if (mIpConfiguration.proxySettings == IpConfiguration.ProxySettings.NONE) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return new ProxyInfo(mIpConfiguration.httpProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/**
|
||||||
|
* Set the {@link ProxyInfo} for this WifiConfiguration.
|
||||||
|
* @param httpProxy {@link ProxyInfo} representing the httpProxy to be used by this
|
||||||
|
* WifiConfiguration. Setting this {@code null} will explicitly set no proxy,
|
||||||
|
* removing any proxy that was previously set.
|
||||||
|
* @exception throw IllegalArgumentException for invalid httpProxy
|
||||||
|
*/
|
||||||
public void setHttpProxy(ProxyInfo httpProxy) {
|
public void setHttpProxy(ProxyInfo httpProxy) {
|
||||||
mIpConfiguration.httpProxy = httpProxy;
|
if (httpProxy == null) {
|
||||||
|
mIpConfiguration.setProxySettings(IpConfiguration.ProxySettings.NONE);
|
||||||
|
mIpConfiguration.setHttpProxy(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ProxyInfo httpProxyCopy;
|
||||||
|
ProxySettings proxySettingCopy;
|
||||||
|
if (!Uri.EMPTY.equals(httpProxy.getPacFileUrl())) {
|
||||||
|
proxySettingCopy = IpConfiguration.ProxySettings.PAC;
|
||||||
|
// Construct a new PAC URL Proxy
|
||||||
|
httpProxyCopy = new ProxyInfo(httpProxy.getPacFileUrl(), httpProxy.getPort());
|
||||||
|
} else {
|
||||||
|
proxySettingCopy = IpConfiguration.ProxySettings.STATIC;
|
||||||
|
// Construct a new HTTP Proxy
|
||||||
|
httpProxyCopy = new ProxyInfo(httpProxy.getHost(), httpProxy.getPort(),
|
||||||
|
httpProxy.getExclusionListAsString());
|
||||||
|
}
|
||||||
|
if (!httpProxyCopy.isValid()) {
|
||||||
|
throw new IllegalArgumentException("Invalid ProxyInfo: " + httpProxyCopy.toString());
|
||||||
|
}
|
||||||
|
mIpConfiguration.setProxySettings(proxySettingCopy);
|
||||||
|
mIpConfiguration.setHttpProxy(httpProxyCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
|
|||||||
@@ -791,6 +791,8 @@ public class WifiManager {
|
|||||||
*
|
*
|
||||||
* @param config the set of variables that describe the configuration,
|
* @param config the set of variables that describe the configuration,
|
||||||
* contained in a {@link WifiConfiguration} object.
|
* contained in a {@link WifiConfiguration} object.
|
||||||
|
* If the {@link WifiConfiguration} has an Http Proxy set
|
||||||
|
* the calling app must be System, or be provisioned as the Profile or Device Owner.
|
||||||
* @return the ID of the newly created network description. This is used in
|
* @return the ID of the newly created network description. This is used in
|
||||||
* other operations to specified the network to be acted upon.
|
* other operations to specified the network to be acted upon.
|
||||||
* Returns {@code -1} on failure.
|
* Returns {@code -1} on failure.
|
||||||
@@ -811,6 +813,8 @@ public class WifiManager {
|
|||||||
* be sparse, so that only the items that are being changed
|
* be sparse, so that only the items that are being changed
|
||||||
* are non-<code>null</code>. The {@code networkId} field
|
* are non-<code>null</code>. The {@code networkId} field
|
||||||
* must be set to the ID of the existing network being updated.
|
* must be set to the ID of the existing network being updated.
|
||||||
|
* If the {@link WifiConfiguration} has an Http Proxy set
|
||||||
|
* the calling app must be System, or be provisioned as the Profile or Device Owner.
|
||||||
* @return Returns the {@code networkId} of the supplied
|
* @return Returns the {@code networkId} of the supplied
|
||||||
* {@code WifiConfiguration} on success.
|
* {@code WifiConfiguration} on success.
|
||||||
* <br/>
|
* <br/>
|
||||||
|
|||||||
Reference in New Issue
Block a user