Android 11 introduces the following changes related to MAC addresses. These changes affect apps only if they target Android 11.
On apps that target Android 10 (API level 29) and lower, MAC randomization is per-SSID, because Passpoint can connect to different SSIDs for the same profile. On apps targeting Android 11 (API level 30) and higher, MAC randomization for Passpoint networks is changed to per fully-qualified domain name (FQDN).
Netlink MAC restrictions
On apps that target API level 30 and higher, non-privileged
apps will not be able to access the device’s MAC address; only network
interfaces with an IP address will be visible. This impacts the
methods, as well as sending
RTM_GETLINK netlink messages.
The following is a list of the ways that apps are affected by this change:
NetworkInterface.getHardwareAddress()returns null for every interface.
- Apps cannot use the
ipcommand does not return information about interfaces.
- Apps cannot send
These changes enforce the guidance provided in Don’t work with MAC addresses.
Note that most developers should use the higher-level APIs of
ConnectivityManager rather than
lower-level APIs like