Merge "update the document of API - WifiManager#getMatchingScanResults" into rvc-dev am: 929401b590

Change-Id: Ifdef1ae77c17a9b9c85d7dfe155a675e5a0e4bba
This commit is contained in:
Automerger Merge Worker
2020-03-11 14:41:53 +00:00

View File

@@ -2735,27 +2735,30 @@ public class WifiManager {
} }
/** /**
* Return the filtered ScanResults which may be authenticated by the suggested network * Get the filtered ScanResults which match the network configurations specified by the
* configurations. * {@code networkSuggestionsToMatch}. Suggestions which use {@link WifiConfiguration} use
* @param networkSuggestions The list of {@link WifiNetworkSuggestion} * SSID and the security type to match. Suggestions which use {@link PasspointConfigration}
* @param scanResults The scan results to be filtered, this is optional, if it is null or * use the matching rules of Hotspot 2.0.
* empty, wifi system would use the recent scan results in the system. * @param networkSuggestionsToMatch The list of {@link WifiNetworkSuggestion} to match against.
* @return The map of {@link WifiNetworkSuggestion} and the list of {@link ScanResult} which * These may or may not be suggestions which are installed on the device.
* may be authenticated by the corresponding network configuration. * @param scanResults The scan results to be filtered. Optional - if not provided(empty list),
* the Wi-Fi service will use the most recent scan results which the system has.
* @return The map of {@link WifiNetworkSuggestion} to the list of {@link ScanResult}
* corresponding to networks which match them.
* @hide * @hide
*/ */
@SystemApi @SystemApi
@RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE}) @RequiresPermission(allOf = {ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE})
@NonNull @NonNull
public Map<WifiNetworkSuggestion, List<ScanResult>> getMatchingScanResults( public Map<WifiNetworkSuggestion, List<ScanResult>> getMatchingScanResults(
@NonNull List<WifiNetworkSuggestion> networkSuggestions, @NonNull List<WifiNetworkSuggestion> networkSuggestionsToMatch,
@Nullable List<ScanResult> scanResults) { @Nullable List<ScanResult> scanResults) {
if (networkSuggestions == null) { if (networkSuggestionsToMatch == null) {
throw new IllegalArgumentException("networkSuggestions must not be null."); throw new IllegalArgumentException("networkSuggestions must not be null.");
} }
try { try {
return mService.getMatchingScanResults( return mService.getMatchingScanResults(
networkSuggestions, scanResults, networkSuggestionsToMatch, scanResults,
mContext.getOpPackageName(), mContext.getFeatureId()); mContext.getOpPackageName(), mContext.getFeatureId());
} catch (RemoteException e) { } catch (RemoteException e) {
throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer();