Merge "Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIs" am: 6f8696cf67 am: 77dfb10a6f
am: dec63b8473
Change-Id: I65cd4c326a1fe64c09b131f1b1924f12e522a664
This commit is contained in:
@@ -18,6 +18,7 @@ package android.net;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.Nullable;
|
import android.annotation.Nullable;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -161,7 +162,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public LinkProperties() {
|
public LinkProperties() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param iface The name of the network interface used for this link.
|
* @param iface The name of the network interface used for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setInterfaceName(String iface) {
|
public void setInterfaceName(String iface) {
|
||||||
mIfaceName = iface;
|
mIfaceName = iface;
|
||||||
ArrayList<RouteInfo> newRoutes = new ArrayList<>(mRoutes.size());
|
ArrayList<RouteInfo> newRoutes = new ArrayList<>(mRoutes.size());
|
||||||
@@ -346,7 +347,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* object.
|
* object.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setLinkAddresses(Collection<LinkAddress> addresses) {
|
public void setLinkAddresses(Collection<LinkAddress> addresses) {
|
||||||
mLinkAddresses.clear();
|
mLinkAddresses.clear();
|
||||||
for (LinkAddress address: addresses) {
|
for (LinkAddress address: addresses) {
|
||||||
@@ -392,7 +393,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param dnsServers The {@link Collection} of DNS servers to set in this object.
|
* @param dnsServers The {@link Collection} of DNS servers to set in this object.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setDnsServers(Collection<InetAddress> dnsServers) {
|
public void setDnsServers(Collection<InetAddress> dnsServers) {
|
||||||
mDnses.clear();
|
mDnses.clear();
|
||||||
for (InetAddress dnsServer: dnsServers) {
|
for (InetAddress dnsServer: dnsServers) {
|
||||||
@@ -529,7 +530,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* domains to search when resolving host names on this link.
|
* domains to search when resolving host names on this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setDomains(String domains) {
|
public void setDomains(String domains) {
|
||||||
mDomains = domains;
|
mDomains = domains;
|
||||||
}
|
}
|
||||||
@@ -552,7 +553,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param mtu The MTU to use for this link.
|
* @param mtu The MTU to use for this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setMtu(int mtu) {
|
public void setMtu(int mtu) {
|
||||||
mMtu = mtu;
|
mMtu = mtu;
|
||||||
}
|
}
|
||||||
@@ -562,9 +563,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* this will return 0.
|
* this will return 0.
|
||||||
*
|
*
|
||||||
* @return The mtu value set for this link.
|
* @return The mtu value set for this link.
|
||||||
* @hide
|
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
|
||||||
public int getMtu() {
|
public int getMtu() {
|
||||||
return mMtu;
|
return mMtu;
|
||||||
}
|
}
|
||||||
@@ -613,7 +612,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public boolean addRoute(RouteInfo route) {
|
public boolean addRoute(RouteInfo route) {
|
||||||
if (route != null) {
|
if (route != null) {
|
||||||
String routeIface = route.getInterface();
|
String routeIface = route.getInterface();
|
||||||
@@ -688,7 +687,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* @param proxy A {@link ProxyInfo} defining the HTTP Proxy to use on this link.
|
* @param proxy A {@link ProxyInfo} defining the HTTP Proxy to use on this link.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void setHttpProxy(ProxyInfo proxy) {
|
public void setHttpProxy(ProxyInfo proxy) {
|
||||||
mHttpProxy = proxy;
|
mHttpProxy = proxy;
|
||||||
}
|
}
|
||||||
@@ -760,7 +759,7 @@ public final class LinkProperties implements Parcelable {
|
|||||||
* Clears this object to its initial state.
|
* Clears this object to its initial state.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public void clear() {
|
public void clear() {
|
||||||
mIfaceName = null;
|
mIfaceName = null;
|
||||||
mLinkAddresses.clear();
|
mLinkAddresses.clear();
|
||||||
|
|||||||
@@ -1017,7 +1017,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
* @return The bearer-specific signal strength.
|
* @return The bearer-specific signal strength.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public int getSignalStrength() {
|
public int getSignalStrength() {
|
||||||
return mSignalStrength;
|
return mSignalStrength;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.net;
|
package android.net;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.net.NetworkCapabilities.NetCapability;
|
import android.net.NetworkCapabilities.NetCapability;
|
||||||
import android.net.NetworkCapabilities.Transport;
|
import android.net.NetworkCapabilities.Transport;
|
||||||
@@ -344,7 +345,7 @@ public class NetworkRequest implements Parcelable {
|
|||||||
* @param signalStrength the bearer-specific signal strength.
|
* @param signalStrength the bearer-specific signal strength.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
@SystemApi
|
||||||
public Builder setSignalStrength(int signalStrength) {
|
public Builder setSignalStrength(int signalStrength) {
|
||||||
mNetworkCapabilities.setSignalStrength(signalStrength);
|
mNetworkCapabilities.setSignalStrength(signalStrength);
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user