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

Commit ceec60bb authored by Michael Plass's avatar Michael Plass
Browse files

Clarify doc of setWifiEnabled return value

Bug: 67747067
Test: make ds-docs
Test: codespell
Change-Id: Iaa7a9299992922900af05e26d74ff84a180b8739
parent 92ad2eed
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -1803,18 +1803,14 @@ public class WifiManager {

    /**
     * Enable or disable Wi-Fi.
     *
     * Note: This method will return false if wifi cannot be enabled (e.g., an incompatible mode
     * where the user has enabled tethering or Airplane Mode).
     *
     * Applications need to have the {@link android.Manifest.permission#CHANGE_WIFI_STATE}
     * permission to toggle wifi. Callers without the permissions will trigger a
     * {@link java.lang.SecurityException}.
     * <p>
     * Applications must have the {@link android.Manifest.permission#CHANGE_WIFI_STATE}
     * permission to toggle wifi.
     *
     * @param enabled {@code true} to enable, {@code false} to disable.
     * @return {@code true} if the operation succeeds (or if the existing state
     *         is the same as the requested state). False if wifi cannot be toggled on/off when the
     *         request is made.
     * @return {@code false} if the request cannot be satisfied; {@code true} indicates that wifi is
     *         either already in the requested state, or in progress toward the requested state.
     * @throws  {@link java.lang.SecurityException} if the caller is missing required permissions.
     */
    public boolean setWifiEnabled(boolean enabled) {
        try {