Check location permission/appop in getScanResults

Return an empty list if the calling process has no location permission/appop

Bug: 21852542
Change-Id: Ifb9c5eb06c3fc7136a7f8251ac152234585f5b67
This commit is contained in:
Fyodor Kupolov
2015-06-19 15:54:12 -07:00
parent a72eac60c7
commit cb13aebfec

View File

@@ -1276,7 +1276,10 @@ public class WifiManager {
/**
* Return the results of the latest access point scan.
* @return the list of access points found in the most recent scan.
* @return the list of access points found in the most recent scan. An app must hold
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION} permission
* in order to get valid results.
*/
public List<ScanResult> getScanResults() {
try {