Limit access to the device's fixed 802.11 MAC address.
MAC addresses are device identifiers that persist across factory data reset, and which third party apps should not be allowed to access for the user's privacy.
This change prevents access to the (non-randomized, physical) 802.11 MAC of the device through WifiP2pManager, by replacing it with the anonymized MAC (02:00:00:00:00:00) whenever it is sent to an app in userspace. If the requesting app holds the LOCAL_MAC_ADDRESS permission, the address is not erased.
Bug: 132055766
Test: atest tests/wifitests/src/com/android/server/wifi/p2p
Test: Call WifiP2pManager#requestDeviceInfo() / register a listener for
the WIFI_P2P_THIS_DEVICE_CHANGED_ACTION from an app, observe that
MAC address for own device is 02:00:00:00:00:00.
Test: Run the Wi-Fi Direct demo at
https://android.googlesource.com/platform/development/+/master/samples/WiFiDirectDemo,
observe that discovery and connection still works.
Change-Id: I5580764eb96874051045fec8b2cef0709291f50d
3 files changed