diff options
| author | 2019-05-06 14:31:09 +0200 | |
|---|---|---|
| committer | 2019-05-07 10:16:20 +0000 | |
| commit | 5853bd038f5a2e155ee98857b94ab12313480d5c (patch) | |
| tree | 346cd374169560c5a8696a5e3638e593e9b2546d | |
| parent | 56c006f5a6238bc73731cc8d77009c72e9602c27 (diff) | |
Documentation update for MAC access restrictions.
With change ag/7340724, the device's P2P MAC adress will only be
available to callers holding the LOCAL_MAC_ADDRESS permission, and will
be anonymized otherwise. This CL updates the documentation in
WifiP2pManager to reflect that.
Bug: 132055766
Test: atest tests/src/android/net/wifi/
Change-Id: I9c2b5ce2cb2c2d2d6766fd34f3451ad4f22a5698
| -rw-r--r-- | wifi/java/android/net/wifi/p2p/WifiP2pManager.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java index a7793785fb9b..cd659e2a934a 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pManager.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pManager.java @@ -93,7 +93,9 @@ import java.util.Map; * {@link WifiP2pInfo} contains the address of the group owner * {@link WifiP2pInfo#groupOwnerAddress} and a flag {@link WifiP2pInfo#isGroupOwner} to indicate * if the current device is a p2p group owner. A p2p client can thus communicate with - * the p2p group owner through a socket connection. + * the p2p group owner through a socket connection. If the current device is the p2p group owner, + * {@link WifiP2pInfo#groupOwnerAddress} is anonymized unless the caller holds the + * {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} permission. * * <p> With peer discovery using {@link #discoverPeers}, an application discovers the neighboring * peers, but has no good way to figure out which peer to establish a connection with. For example, @@ -300,6 +302,11 @@ public class WifiP2pManager { * To get information notifications on P2P getting enabled refers * {@link #WIFI_P2P_STATE_ENABLED}. * + * <p> The {@link #EXTRA_WIFI_P2P_DEVICE} extra contains an anonymized version of the device's + * MAC address. Callers holding the {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} + * permission can use {@link #requestDeviceInfo} to obtain the actual MAC address of this + * device. + * * All of these permissions are required to receive this broadcast: * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} and * {@link android.Manifest.permission#ACCESS_WIFI_STATE} @@ -1881,6 +1888,10 @@ public class WifiP2pManager { * <p> This {@link android.net.wifi.p2p.WifiP2pDevice} is returned using the * {@link DeviceInfoListener} listener. * + * <p> {@link android.net.wifi.p2p.WifiP2pDevice#deviceAddress} is only available if the caller + * holds the {@code android.Manifest.permission#LOCAL_MAC_ADDRESS} permission, and holds the + * anonymized MAC address (02:00:00:00:00:00) otherwise. + * * <p> This information is also included in the {@link #WIFI_P2P_THIS_DEVICE_CHANGED_ACTION} * broadcast event with extra {@link #EXTRA_WIFI_P2P_DEVICE}. * |