Revert "Unhide IpPrefix(InetAddress, int)" am: 758ead6dd3

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1927303

Change-Id: If3840f48333e48895701b12f201e34166e3a3136
This commit is contained in:
Ayush Sharma
2021-12-16 15:16:53 +00:00
committed by Automerger Merge Worker
4 changed files with 3 additions and 4 deletions

View File

@@ -206,7 +206,6 @@ package android.net {
}
public final class IpPrefix implements android.os.Parcelable {
ctor public IpPrefix(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
method public boolean contains(@NonNull java.net.InetAddress);
method public int describeContents();
method @NonNull public java.net.InetAddress getAddress();

View File

@@ -131,6 +131,7 @@ package android.net {
}
public final class IpPrefix implements android.os.Parcelable {
ctor public IpPrefix(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
ctor public IpPrefix(@NonNull String);
}

View File

@@ -87,7 +87,9 @@ public final class IpPrefix implements Parcelable {
*
* @param address the IP address. Must be non-null.
* @param prefixLength the prefix length. Must be >= 0 and <= (32 or 128) (IPv4 or IPv6).
* @hide
*/
@SystemApi
public IpPrefix(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) {
// We don't reuse the (byte[], int) constructor because it calls clone() on the byte array,
// which is unnecessary because getAddress() already returns a clone.

View File

@@ -122,9 +122,6 @@ public class IpPrefixTest {
p = new IpPrefix("[2001:db8::123]/64");
assertEquals("2001:db8::/64", p.toString());
p = new IpPrefix(InetAddresses.parseNumericAddress("::128"), 64);
assertEquals("::/64", p.toString());
}
@Test