WifiHelper

public class WifiHelper
extends Object

java.lang.Object
com.android.tradefed.device.WifiHelper


Classe d'assistance pour manipuler les services wifi sur l'appareil.

Résumé

Des champs

public static final String INSTRUMENTATION_PKG

Constructeurs publics

WifiHelper ( ITestDevice device)
WifiHelper ( ITestDevice device, String wifiUtilApkPath)
WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup)

Constructeur alternatif qui peut ignorer la configuration de l'apk wifi.

WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)

Constructeur pour spécifier s'il faut utiliser le nouveau wifi helper v2.

Méthodes publiques

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)

boolean disableWifi ()

boolean disconnectFromNetwork ()

boolean enableWifi ()

static File extractWifiUtilApk ()

Méthode d'assistance pour extraire l'apk de l'utilitaire wifi du chemin de classe

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)

Des champs

INSTRUMENTATION_PKG

public static final String INSTRUMENTATION_PKG

Constructeurs publics

WifiHelper

public WifiHelper (ITestDevice device)

Paramètres
device ITestDevice

Jetés
DeviceNotAvailableException

WifiHelper

public WifiHelper (ITestDevice device, 
                String wifiUtilApkPath)

Paramètres
device ITestDevice

wifiUtilApkPath String

Jetés
DeviceNotAvailableException

WifiHelper

public WifiHelper (ITestDevice device, 
                String wifiUtilApkPath, 
                boolean doSetup)

Constructeur alternatif qui peut ignorer la configuration de l'apk wifi.

Paramètres
device ITestDevice

wifiUtilApkPath String

doSetup boolean

Jetés
DeviceNotAvailableException

WifiHelper

public WifiHelper (ITestDevice device, 
                String wifiUtilApkPath, 
                boolean doSetup, 
                boolean useV2)

Constructeur pour spécifier s'il faut utiliser le nouveau wifi helper v2. Les opérations v2 n’ont pas besoin d’installer l’apk wifi util.

Paramètres
device ITestDevice

wifiUtilApkPath String

doSetup boolean

useV2 boolean

Jetés
DeviceNotAvailableException

Méthodes publiques

ajouterOpenNetwork

public boolean addOpenNetwork (String ssid)

Paramètres
ssid String

Retour
boolean

Jetés
DeviceNotAvailableException

ajouterOpenNetwork

public boolean addOpenNetwork (String ssid, 
                boolean scanSsid)

Paramètres
ssid String

scanSsid boolean

Retour
boolean

Jetés
DeviceNotAvailableException

addWpaPskNetwork

public boolean addWpaPskNetwork (String ssid, 
                String psk)

Paramètres
ssid String

psk String

Retour
boolean

Jetés
DeviceNotAvailableException

addWpaPskNetwork

public boolean addWpaPskNetwork (String ssid, 
                String psk, 
                boolean scanSsid)

Paramètres
ssid String

psk String

scanSsid boolean

Retour
boolean

Jetés
DeviceNotAvailableException

checkConnectivité

public boolean checkConnectivity (String urlToCheck)

Paramètres
urlToCheck String

Retour
boolean

Jetés
DeviceNotAvailableException

nettoyer

public void cleanUp ()

Jetés
DeviceNotAvailableException

se connecter au réseau

public boolean connectToNetwork (String ssid, 
                String psk, 
                String urlToCheck)

Paramètres
ssid String

psk String

urlToCheck String

Retour
boolean

Jetés
DeviceNotAvailableException

se connecter au réseau

public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, 
                String psk, 
                String urlToCheck, 
                boolean scanSsid)

Paramètres
ssid String

psk String

urlToCheck String

scanSsid boolean

Retour
IWifiHelper.WifiConnectionResult

Jetés
DeviceNotAvailableException

désactiverWifi

public boolean disableWifi ()

Retour
boolean

Jetés
DeviceNotAvailableException

déconnecter du réseau

public boolean disconnectFromNetwork ()

Retour
boolean

Jetés
DeviceNotAvailableException

activerWifi

public boolean enableWifi ()

Retour
boolean

Jetés
DeviceNotAvailableException

extraireWifiUtilApk

public static File extractWifiUtilApk ()

Méthode d'assistance pour extraire l'apk de l'utilitaire wifi du chemin de classe

Retour
File

obtenirBSSID

public String getBSSID ()

Retour
String

Jetés
DeviceNotAvailableException

obtenirIpAddress

public String getIpAddress ()

Retour
String

Jetés
DeviceNotAvailableException

obtenirSSID

public String getSSID ()

Retour
String

Jetés
DeviceNotAvailableException

obtenirWifiInfo

public  getWifiInfo ()

Retour

Jetés
DeviceNotAvailableException

hasValidIp

public boolean hasValidIp ()

Retour
boolean

Jetés
DeviceNotAvailableException

estWifiEnabled

public boolean isWifiEnabled ()

Retour
boolean

Jetés
DeviceNotAvailableException

supprimerTouslesRéseaux

public boolean removeAllNetworks ()

Retour
boolean

Jetés
DeviceNotAvailableException

démarrerMoniteur

public boolean startMonitor (long interval, 
                String urlToCheck)

Paramètres
interval long

urlToCheck String

Retour
boolean

Jetés
DeviceNotAvailableException

arrêterMoniteur

public  stopMonitor ()

Retour

Jetés
DeviceNotAvailableException

attendreIp

public boolean waitForIp (long timeout)

Paramètres
timeout long

Retour
boolean

Jetés
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled (long timeout)

Paramètres
timeout long

Retour
boolean

Jetés
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled ()

Retour
boolean

Jetés
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled (long timeout)

Paramètres
timeout long

Retour
boolean

Jetés
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled ()

Retour
boolean

Jetés
DeviceNotAvailableException

attendre l'état Wifi

public boolean waitForWifiState (WifiState... expectedStates)

Paramètres
expectedStates WifiState

Retour
boolean

Jetés
DeviceNotAvailableException