Add @UnsupportedAppUsage annotations

For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd
Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
This commit is contained in:
Mathew Inwood 2018-08-08 14:52:47 +01:00
commit 0b8f861d07

View file

@ -25,6 +25,7 @@ import static android.system.OsConstants.RT_SCOPE_LINK;
import static android.system.OsConstants.RT_SCOPE_SITE;
import static android.system.OsConstants.RT_SCOPE_UNIVERSE;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Pair;
@ -54,11 +55,13 @@ public class LinkAddress implements Parcelable {
/**
* IPv4 or IPv6 address.
*/
@UnsupportedAppUsage
private InetAddress address;
/**
* Prefix length.
*/
@UnsupportedAppUsage
private int prefixLength;
/**
@ -112,6 +115,7 @@ public class LinkAddress implements Parcelable {
* @return true if the address is IPv6.
* @hide
*/
@UnsupportedAppUsage
public boolean isIPv6() {
return address instanceof Inet6Address;
}
@ -163,6 +167,7 @@ public class LinkAddress implements Parcelable {
* @param prefixLength The prefix length.
* @hide
*/
@UnsupportedAppUsage
public LinkAddress(InetAddress address, int prefixLength) {
this(address, prefixLength, 0, 0);
this.scope = scopeForUnicastAddress(address);
@ -185,6 +190,7 @@ public class LinkAddress implements Parcelable {
* @param string The string to parse.
* @hide
*/
@UnsupportedAppUsage
public LinkAddress(String address) {
this(address, 0, 0);
this.scope = scopeForUnicastAddress(this.address);
@ -255,6 +261,7 @@ public class LinkAddress implements Parcelable {
* otherwise.
* @hide
*/
@UnsupportedAppUsage
public boolean isSameAddressAs(LinkAddress other) {
return address.equals(other.address) && prefixLength == other.prefixLength;
}
@ -278,6 +285,7 @@ public class LinkAddress implements Parcelable {
* TODO: Delete all callers and remove in favour of getPrefixLength().
* @hide
*/
@UnsupportedAppUsage
public int getNetworkPrefixLength() {
return getPrefixLength();
}