WifiManager: add updateInterfaceIpState
Add a call to WifiManager that allows ConnectivityService to provide interface mode change updates. Mode variables are also added in this CL. A corresponding CL will be added to WifiServiceImpl. Fixed two checkstyle errors on imports. Bug: 31466854 Test: make Change-Id: Iccccd2643515a09fadb29f7b7e82697aaf994189
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
@@ -1717,6 +1745,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
|
||||
|
||||
Reference in New Issue
Block a user