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

Commit 2ed27dc7 authored by Rebecca Silberstein's avatar Rebecca Silberstein Committed by android-build-merger
Browse files

Merge "WifiManager: add updateInterfaceIpState" am: 2dbd1377 am: 6f69ea87 am: c58e6e4a

am: b664a014

Change-Id: Ie49dbd2542bde07b8f71d9ea1f0ba088d523f6fe
parents 7ac2d2d3 b664a014
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -125,6 +125,8 @@ interface IWifiManager

    void setWifiApEnabled(in WifiConfiguration wifiConfig, boolean enable);

    void updateInterfaceIpState(String ifaceName, int mode);

    boolean startSoftAp(in WifiConfiguration wifiConfig);

    boolean stopSoftAp();
+50 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.pm.ParceledListSlice;
import android.net.ConnectivityManager;
@@ -46,9 +45,9 @@ import com.android.internal.util.Protocol;
import com.android.server.net.NetworkPinner;

import java.net.InetAddress;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.Collections;

/**
 * This class provides the primary API for managing all aspects of Wi-Fi
@@ -446,6 +445,35 @@ public class WifiManager {
     *  @hide
     */
    public static final int SAP_START_FAILURE_NO_CHANNEL = 1;

    /**
     * Interface IP mode for configuration error.
     *
     * @see updateInterfaceIpState(String, int)
     *
     * @hide
     */
    public static final int IFACE_IP_MODE_CONFIGURATION_ERROR = 0;

    /**
     * Interface IP mode for tethering.
     *
     * @see updateInterfaceIpState(String, int)
     *
     * @hide
     */
    public static final int IFACE_IP_MODE_TETHERED = 1;

    /**
     * Interface IP mode for Local Only Hotspot.
     *
     * @see updateInterfaceIpState(String, int)
     *
     * @hide
     */
    public static final int IFACE_IP_MODE_LOCAL_ONLY = 2;


    /**
     * Broadcast intent action indicating that a connection to the supplicant has
     * been established (and it is now possible
@@ -1731,6 +1759,26 @@ public class WifiManager {
        }
    }

    /**
     * Call allowing ConnectivityService to update WifiService with interface mode changes.
     *
     * The possible modes include: {@link IFACE_IP_MODE_TETHERED},
     *                             {@link IFACE_IP_MODE_LOCAL_ONLY},
     *                             {@link IFACE_IP_MODE_CONFIGURATION_ERROR}
     *
     * @param ifaceName String name of the updated interface
     * @param mode int representing the new mode
     *
     * @hide
     */
    public void updateInterfaceIpState(String ifaceName, int mode) {
        try {
            mService.updateInterfaceIpState(ifaceName, mode);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Start SoftAp mode with the specified configuration.
     * Note that starting in access point mode disables station