Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a914a2ef authored by Etan Cohen's avatar Etan Cohen
Browse files

[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
parent 999aa2af
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -29640,6 +29640,7 @@ package android.net.wifi {
    ctor public WifiConfiguration();
    ctor public WifiConfiguration();
    method public int describeContents();
    method public int describeContents();
    method public android.net.ProxyInfo getHttpProxy();
    method public android.net.ProxyInfo getHttpProxy();
    method public android.net.MacAddress getRandomizedMacAddress();
    method public boolean isPasspoint();
    method public boolean isPasspoint();
    method public void setHttpProxy(android.net.ProxyInfo);
    method public void setHttpProxy(android.net.ProxyInfo);
    method public void writeToParcel(android.os.Parcel, int);
    method public void writeToParcel(android.os.Parcel, int);
+4 −1
Original line number Original line Diff line number Diff line
@@ -955,9 +955,12 @@ public class WifiConfiguration implements Parcelable {
    }
    }


    /**
    /**
     * @hide
     * Returns MAC address set to be the local randomized MAC address.
     * Returns MAC address set to be the local randomized MAC address.
     * Does not guarantee that the returned address is valid for use.
     * 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() {
    public @NonNull MacAddress getRandomizedMacAddress() {
        return mRandomizedMacAddress;
        return mRandomizedMacAddress;