From f8574706258dc3f3ed5d7e54a36e1ff127aa7905 Mon Sep 17 00:00:00 2001 From: Aaron Huang Date: Thu, 3 Oct 2019 13:41:30 +0800 Subject: [PATCH] Expose MacAddress methods to public API To support mainline modules, adding the methods which are used by wifi. Bug: 139268426 Bug: 135998869 Bug: 138306002 Test: atest android.net.cts atest android.net.wifi.cts atest FrameworksNetTests atest NetworkStackTests ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I49856863c15b6b3b59aa867a77b0f137003149ef --- api/current.txt | 2 ++ core/java/android/net/MacAddress.java | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index 35e2acaf278b4..5930e91df7b04 100644 --- a/api/current.txt +++ b/api/current.txt @@ -28766,7 +28766,9 @@ package android.net { method @NonNull public static android.net.MacAddress fromBytes(@NonNull byte[]); method @NonNull public static android.net.MacAddress fromString(@NonNull String); method public int getAddressType(); + method @Nullable public java.net.Inet6Address getLinkLocalIpv6FromEui48Mac(); method public boolean isLocallyAssigned(); + method public boolean matches(@NonNull android.net.MacAddress, @NonNull android.net.MacAddress); method @NonNull public byte[] toByteArray(); method @NonNull public String toOuiString(); method public void writeToParcel(android.os.Parcel, int); diff --git a/core/java/android/net/MacAddress.java b/core/java/android/net/MacAddress.java index 2cf2a6514e775..87295142bec46 100644 --- a/core/java/android/net/MacAddress.java +++ b/core/java/android/net/MacAddress.java @@ -416,7 +416,6 @@ public final class MacAddress implements Parcelable { * @param mask MacAddress representing the mask to use during comparison. * @return true if this MAC Address matches the given range. * - * @hide */ public boolean matches(@NonNull MacAddress baseAddress, @NonNull MacAddress mask) { Preconditions.checkNotNull(baseAddress); @@ -430,7 +429,6 @@ public final class MacAddress implements Parcelable { * IPv6 address per RFC 4862. * * @return A link-local Inet6Address constructed from the MAC address. - * @hide */ public @Nullable Inet6Address getLinkLocalIpv6FromEui48Mac() { byte[] macEui48Bytes = toByteArray();