[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:
Arc Wang
2020-03-30 15:41:00 +08:00
parent 01be396381
commit 6ed3e93f8a

View File

@@ -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();
}
}