AsistentedeWi-Fi
public
class
WifiHelper
extends Object
Objeto java.lang. | |
↳ | com.android.tradefed.device.WifiHelper |
Clase de ayuda para manipular los servicios de Wi-Fi en el dispositivo.
Resumen
Campos | |
---|---|
public
static
final
String |
INSTRUMENTATION_PKG
|
Constructores públicos | |
---|---|
WifiHelper(ITestDevice device)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Es un constructor alternativo que puede omitir la configuración del APK de Wi-Fi. |
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Constructor para especificar si se usará la nueva versión 2 del asistente de Wi-Fi. |
Métodos públicos | |
---|---|
boolean
|
addOpenNetwork(String ssid)
|
boolean
|
addOpenNetwork(String ssid, boolean scanSsid)
|
boolean
|
addWpaPskNetwork(String ssid, String psk)
|
boolean
|
addWpaPskNetwork(String ssid, String psk, boolean scanSsid)
|
boolean
|
checkConnectivity(String urlToCheck)
|
void
|
cleanUp()
|
boolean
|
connectToNetwork(String ssid, String psk, String urlToCheck)
|
IWifiHelper.WifiConnectionResult
|
connectToNetwork(String ssid, String psk, String urlToCheck, boolean scanSsid, String defaultType)
|
IWifiHelper.WifiConnectionResult
|
connectToNetwork(String ssid, String psk, String urlToCheck, boolean scanSsid)
|
boolean
|
disableWifi()
|
boolean
|
disconnectFromNetwork()
|
boolean
|
enableWifi()
|
static
File
|
extractWifiUtilApk()
Método de ayuda para extraer el APK de la utilidad de Wi-Fi de la ruta de clase |
String
|
getBSSID()
|
String
|
getIpAddress()
|
String
|
getSSID()
|
|
getWifiInfo()
|
boolean
|
hasValidIp()
|
boolean
|
isWifiEnabled()
|
boolean
|
removeAllNetworks()
|
boolean
|
startMonitor(long interval, String urlToCheck)
|
|
stopMonitor()
|
boolean
|
waitForIp(long timeout)
|
boolean
|
waitForWifiDisabled(long timeout)
|
boolean
|
waitForWifiDisabled()
|
boolean
|
waitForWifiEnabled(long timeout)
|
boolean
|
waitForWifiEnabled()
|
boolean
|
waitForWifiState(WifiState... expectedStates)
|
Campos
EVALUACIÓN_PKG
public static final String INSTRUMENTATION_PKG
Constructores públicos
AsistentedeWi-Fi
public WifiHelper (ITestDevice device)
Parámetros | |
---|---|
device |
ITestDevice |
Arroja | |
---|---|
DeviceNotAvailableException |
AsistentedeWi-Fi
public WifiHelper (ITestDevice device, String wifiUtilApkPath)
Parámetros | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
Arroja | |
---|---|
DeviceNotAvailableException |
AsistentedeWi-Fi
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Es un constructor alternativo que puede omitir la configuración del APK de Wi-Fi.
Parámetros | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
AsistentedeWi-Fi
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Constructor para especificar si se usará la nueva versión 2 del asistente de Wi-Fi. Las operaciones de la v2 no necesitan instalar el APK de la utilidad de Wi-Fi
Parámetros | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
useV2 |
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
Métodos públicos
addOpenNetwork
public boolean addOpenNetwork (String ssid)
Parámetros | |
---|---|
ssid |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
addOpenNetwork
public boolean addOpenNetwork (String ssid, boolean scanSsid)
Parámetros | |
---|---|
ssid |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
addWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk)
Parámetros | |
---|---|
ssid |
String |
psk |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
addWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk, boolean scanSsid)
Parámetros | |
---|---|
ssid |
String |
psk |
String |
scanSsid |
boolean |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity (String urlToCheck)
Parámetros | |
---|---|
urlToCheck |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
conectar a la red
public boolean connectToNetwork (String ssid, String psk, String urlToCheck)
Parámetros | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
conectar a la red
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid, String defaultType)
Parámetros | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
defaultType |
String |
Muestra | |
---|---|
IWifiHelper.WifiConnectionResult |
Arroja | |
---|---|
DeviceNotAvailableException |
conectar a la red
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid)
Parámetros | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
Muestra | |
---|---|
IWifiHelper.WifiConnectionResult |
Arroja | |
---|---|
DeviceNotAvailableException |
desconectarDeRed
public boolean disconnectFromNetwork ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
ExtraerWi-FiUtilApk
public static File extractWifiUtilApk ()
Método de ayuda para extraer el APK de la utilidad de Wi-Fi de la ruta de clase
Muestra | |
---|---|
File |
removeAllNetworks
public boolean removeAllNetworks ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
startMonitor
public boolean startMonitor (long interval, String urlToCheck)
Parámetros | |
---|---|
interval |
long |
urlToCheck |
String |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForIP
public boolean waitForIp (long timeout)
Parámetros | |
---|---|
timeout |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
EsperarPorWi-FiInhabilitado
public boolean waitForWifiDisabled (long timeout)
Parámetros | |
---|---|
timeout |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
EsperarPorWi-FiInhabilitado
public boolean waitForWifiDisabled ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForWifiEnabled
public boolean waitForWifiEnabled (long timeout)
Parámetros | |
---|---|
timeout |
long |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
waitForWifiEnabled
public boolean waitForWifiEnabled ()
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |
estadodeesperadeWi-Fi
public boolean waitForWifiState (WifiState... expectedStates)
Parámetros | |
---|---|
expectedStates |
WifiState |
Muestra | |
---|---|
boolean |
Arroja | |
---|---|
DeviceNotAvailableException |