Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ed3e93f authored by Arc Wang's avatar Arc Wang
Browse files

[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
parent 01be3963
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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();
    }
}