WifiHelper

public class WifiHelper
extends Object

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


Classe d'assistance permettant de manipuler les services Wi-Fi sur l'appareil.

Résumé

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 pouvant ignorer la configuration de l'APK Wi-Fi.

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

Constructeur permettant de spécifier si la nouvelle version 2 de l'assistant Wi-Fi doit être utilisée.

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, String defaultType)

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 Wi-Fi du chemin d'accès aux classes

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)

Champs

INSTRUMENTATION_PKG

public static final String INSTRUMENTATION_PKG

Constructeurs publics

WifiHelper

public WifiHelper (ITestDevice device)

Paramètres
device ITestDevice

Génère
DeviceNotAvailableException

WifiHelper

public WifiHelper (ITestDevice device, 
                String wifiUtilApkPath)

Paramètres
device ITestDevice

wifiUtilApkPath String

Génère
DeviceNotAvailableException

WifiHelper

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

Constructeur alternatif pouvant ignorer la configuration de l'APK Wi-Fi.

Paramètres
device ITestDevice

wifiUtilApkPath String

doSetup boolean

Génère
DeviceNotAvailableException

WifiHelper

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

Constructeur permettant de spécifier si vous souhaitez utiliser la nouvelle version 2 de l'assistant Wi-Fi. Les opérations v2 n'ont pas besoin d'installer l'APK d'utilitaire Wi-Fi.

Paramètres
device ITestDevice

wifiUtilApkPath String

doSetup boolean

useV2 boolean

Génère
DeviceNotAvailableException

Méthodes publiques

addOpenNetwork

public boolean addOpenNetwork (String ssid)

Paramètres
ssid String

Renvoie
boolean

Génère
DeviceNotAvailableException

addOpenNetwork

public boolean addOpenNetwork (String ssid, 
                boolean scanSsid)

Paramètres
ssid String

scanSsid boolean

Renvoie
boolean

Génère
DeviceNotAvailableException

addWpaPskNetwork

public boolean addWpaPskNetwork (String ssid, 
                String psk)

Paramètres
ssid String

psk String

Renvoie
boolean

Génère
DeviceNotAvailableException

addWpaPskNetwork

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

Paramètres
ssid String

psk String

scanSsid boolean

Renvoie
boolean

Génère
DeviceNotAvailableException

checkConnectivity

public boolean checkConnectivity (String urlToCheck)

Paramètres
urlToCheck String

Renvoie
boolean

Génère
DeviceNotAvailableException

cleanUp

public void cleanUp ()

Génère
DeviceNotAvailableException

connectToNetwork

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

Paramètres
ssid String

psk String

urlToCheck String

Renvoie
boolean

Génère
DeviceNotAvailableException

connectToNetwork

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

Paramètres
ssid String

psk String

urlToCheck String

scanSsid boolean

defaultType String

Renvoie
IWifiHelper.WifiConnectionResult

Génère
DeviceNotAvailableException

connectToNetwork

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

Paramètres
ssid String

psk String

urlToCheck String

scanSsid boolean

Renvoie
IWifiHelper.WifiConnectionResult

Génère
DeviceNotAvailableException

disableWifi

public boolean disableWifi ()

Renvoie
boolean

Génère
DeviceNotAvailableException

disconnectFromNetwork

public boolean disconnectFromNetwork ()

Renvoie
boolean

Génère
DeviceNotAvailableException

enableWifi

public boolean enableWifi ()

Renvoie
boolean

Génère
DeviceNotAvailableException

extractWifiUtilApk

public static File extractWifiUtilApk ()

Méthode d'assistance pour extraire l'APK de l'utilitaire Wi-Fi du chemin d'accès aux classes

Renvoie
File

getBSSID

public String getBSSID ()

Renvoie
String

Génère
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Renvoie
String

Génère
DeviceNotAvailableException

getSSID

public String getSSID ()

Renvoie
String

Génère
DeviceNotAvailableException

getWifiInfo

public  getWifiInfo ()

Renvoie

Génère
DeviceNotAvailableException

hasValidIp

public boolean hasValidIp ()

Renvoie
boolean

Génère
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

Renvoie
boolean

Génère
DeviceNotAvailableException

removeAllNetworks

public boolean removeAllNetworks ()

Renvoie
boolean

Génère
DeviceNotAvailableException

startMonitor

public boolean startMonitor (long interval, 
                String urlToCheck)

Paramètres
interval long

urlToCheck String

Renvoie
boolean

Génère
DeviceNotAvailableException

stopMonitor

public  stopMonitor ()

Renvoie

Génère
DeviceNotAvailableException

waitForIp

public boolean waitForIp (long timeout)

Paramètres
timeout long

Renvoie
boolean

Génère
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled (long timeout)

Paramètres
timeout long

Renvoie
boolean

Génère
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled ()

Renvoie
boolean

Génère
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled (long timeout)

Paramètres
timeout long

Renvoie
boolean

Génère
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled ()

Renvoie
boolean

Génère
DeviceNotAvailableException

waitForWifiState

public boolean waitForWifiState (WifiState... expectedStates)

Paramètres
expectedStates WifiState

Renvoie
boolean

Génère
DeviceNotAvailableException