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

Commit 334fe546 authored by Rebecca Silberstein's avatar Rebecca Silberstein Committed by android-build-merger
Browse files

Merge "WifiManager: add new methods to start softap"

am: be2653d4

Change-Id: Ic73c0b8f52c86f00a6d03687b37b4c02f41d4fcc
parents b993a442 be2653d4
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -125,6 +125,10 @@ interface IWifiManager

    void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable);

    boolean startSoftAp(in WifiConfiguration wifiConfig);

    boolean stopSoftAp();

    int getWifiApEnabledState();

    WifiConfiguration getWifiApConfiguration();
+34 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.net.wifi;

import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
@@ -1716,6 +1717,39 @@ public class WifiManager {
        }
    }

    /**
     * Start SoftAp mode with the specified configuration.
     * Note that starting in access point mode disables station
     * mode operation
     * @param wifiConfig SSID, security and channel details as
     *        part of WifiConfiguration
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     *
     * @hide
     */
    public boolean startSoftAp(@Nullable WifiConfiguration wifiConfig) {
        try {
            return mService.startSoftAp(wifiConfig);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Stop SoftAp mode.
     * Note that stopping softap mode will restore the previous wifi mode.
     * @return {@code true} if the operation succeeds, {@code false} otherwise
     *
     * @hide
     */
    public boolean stopSoftAp() {
        try {
            return mService.stopSoftAp();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Gets the Wi-Fi enabled state.
     * @return One of {@link #WIFI_AP_STATE_DISABLED},