[Wi-Fi] Add WifiSavedConfigUtils#getAllConfigsCount
For BaseSearchIndexProvider#getNonIndexableKeys to get saved
networks count in WifiSettings2.
Bug: 146823365
Test: manual
In Settings APP, search 'Saved networks' when there is
a saved Wi-Fi network and when there is no saved Wi-Fi network.
Change-Id: I8f16d2b85ab19facc5c43d3fa85e885e53b7c53d
This commit is contained in:
@@ -65,5 +65,17 @@ public class WifiSavedConfigUtils {
|
||||
}
|
||||
return savedConfigs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the count of the saved configurations on the device, including both Wi-Fi networks
|
||||
* and Passpoint profiles.
|
||||
*
|
||||
* @param context The application context
|
||||
* @param wifiManager An instance of {@link WifiManager}
|
||||
* @return count of saved Wi-Fi networks
|
||||
*/
|
||||
public static int getAllConfigsCount(Context context, WifiManager wifiManager) {
|
||||
return getAllConfigs(context, wifiManager).size();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user