[NAN] Add COARSE_LOCATION permission check to NAN discovery [DO NOT MERGE]

NAN discovery can expose location based on service signatures.

Bug: 31907534
Test: unit test + integrated (sl4a) testing
Change-Id: I0af7e0394c3f837d6317cd4bfacd2b22e2e24054
This commit is contained in:
Etan Cohen
2016-10-03 15:42:11 -07:00
parent cf18a2c85a
commit e1d8a5a6fc

View File

@@ -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.
* <p>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.
* <p>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.