From 2a4c81b7a75e8b64f6fba82c33be5dc2779dc6dd Mon Sep 17 00:00:00 2001 From: Etan Cohen Date: Mon, 3 Oct 2016 15:42:11 -0700 Subject: [PATCH] [NAN] Add COARSE_LOCATION permission check to NAN discovery NAN discovery can expose location based on service signatures. (cherry-pick of commit e1d8a5a6fc3661f226afff3fde59a3eb2c06d718) Bug: 31907534 Test: unit test + integrated (sl4a) testing Change-Id: Iec0fae507dfdae65fe08ab6e2ddb89334c15def5 --- wifi/java/android/net/wifi/nan/WifiNanSession.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wifi/java/android/net/wifi/nan/WifiNanSession.java b/wifi/java/android/net/wifi/nan/WifiNanSession.java index 5fb2c066d9b95..df5e3c11b0641 100644 --- a/wifi/java/android/net/wifi/nan/WifiNanSession.java +++ b/wifi/java/android/net/wifi/nan/WifiNanSession.java @@ -113,6 +113,8 @@ public class WifiNanSession { * An application must use the {@link WifiNanDiscoveryBaseSession#destroy()} to * terminate the publish discovery session once it isn't needed. This will free * resources as well terminate any on-air transmissions. + *

The application must have the {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} + * permission to start a publish discovery session. * * @param handler The Handler on whose thread to execute the callbacks of the {@code * callback} object. If a null is provided then the application's main thread will be used. @@ -156,6 +158,8 @@ public class WifiNanSession { * An application must use the {@link WifiNanDiscoveryBaseSession#destroy()} to * terminate the subscribe discovery session once it isn't needed. This will free * resources as well terminate any on-air transmissions. + *

The application must have the {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} + * permission to start a subscribe discovery session. * * @param handler The Handler on whose thread to execute the callbacks of the {@code * callback} object. If a null is provided then the application's main thread will be used.