diff options
| author | 2019-01-16 15:09:31 -0800 | |
|---|---|---|
| committer | 2019-01-17 13:21:07 -0800 | |
| commit | a914a2ef0b610b6eca6bb33c8b48c1e9bc4a5f87 (patch) | |
| tree | 1836e02853d67c7932288dab958963ef248ca376 | |
| parent | 999aa2af59f7b5bdf4517cbaef4dfb566e773fb9 (diff) | |
[WIFI] Open up the getRandomizedMacAddress API
The randomized MAC address needs to be available to DO, PO, and
Carrier apps (which is restricted to getting the randomized MAC
address only from configurations it created).
Unhide the API and document the restrictions.
Bug: 112205095
Test: atest com.android.server.wifi
Test: atest android.net.wifi
Change-Id: I7376a00cf6ada51236d8a00538159e1ca25743b3
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/WifiConfiguration.java | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 3d6645b096d6..7074d4854620 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29640,6 +29640,7 @@ package android.net.wifi { ctor public WifiConfiguration(); method public int describeContents(); method public android.net.ProxyInfo getHttpProxy(); + method public android.net.MacAddress getRandomizedMacAddress(); method public boolean isPasspoint(); method public void setHttpProxy(android.net.ProxyInfo); method public void writeToParcel(android.os.Parcel, int); diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index e019f282cd33..d2d711f10944 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -955,9 +955,12 @@ public class WifiConfiguration implements Parcelable { } /** - * @hide * Returns MAC address set to be the local randomized MAC address. * Does not guarantee that the returned address is valid for use. + * <p> + * Information is restricted to Device Owner, Profile Owner, and Carrier apps + * (which will only obtain addresses for configurations which they create). Other callers + * will receive a default "02:00:00:00:00:00" MAC address. */ public @NonNull MacAddress getRandomizedMacAddress() { return mRandomizedMacAddress; |