Merge changes from topic "network_request_match_callback"

* changes:
  WifiManager: Network request match callback registration
  wifi(API): NetworkSpecifier for Wifi NetworkAgent
  wifi(API): Mark old API's deprecated
  wifi(API): New API surface for network suggestion
  wifi(API): New API surface for connection via NetworkRequest
This commit is contained in:
Roshan Pius
2018-11-06 17:42:58 +00:00
committed by Android (Google) Code Review
19 changed files with 2974 additions and 37 deletions

View File

@@ -393,4 +393,19 @@ public final class MacAddress implements Parcelable {
}
return out;
}
/**
* Checks if this MAC Address matches the provided range.
*
* @param baseAddress MacAddress representing the base address to compare with.
* @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);
Preconditions.checkNotNull(mask);
return (mAddr & mask.mAddr) == (baseAddress.mAddr & mask.mAddr);
}
}