WifiHelper

public class WifiHelper
extends Object

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


Hilfsklasse zur Manipulation von WLAN-Diensten auf dem Gerät.

Zusammenfassung

Felder

public static final String INSTRUMENTATION_PKG

Öffentliche Bauträger

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

Alternativer Konstruktor, der die Einrichtung der WLAN-Apk überspringen kann.

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

Konstruktor zum Angeben, ob der neue WLAN-Helfer v2 verwendet werden soll.

Öffentliche Methoden

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 ()

Hilfsmethode zum Extrahieren der wifi util apk aus dem Klassenpfad

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)

Felder

INSTRUMENTATION_PKG

public static final String INSTRUMENTATION_PKG

Öffentliche Bauträger

WifiHelper

public WifiHelper (ITestDevice device)

Parameter
device ITestDevice

Würfe
DeviceNotAvailableException

WifiHelper

public WifiHelper (ITestDevice device, 
                String wifiUtilApkPath)

Parameter
device ITestDevice

wifiUtilApkPath String

Würfe
DeviceNotAvailableException

WifiHelper

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

Alternativer Konstruktor, der die Einrichtung der WLAN-Apk überspringen kann.

Parameter
device ITestDevice

wifiUtilApkPath String

doSetup boolean

Würfe
DeviceNotAvailableException

WifiHelper

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

Konstruktor zum Angeben, ob der neue WLAN-Helfer v2 verwendet werden soll. v2-Vorgänge erfordern keine Installation des WiFi Util APK.

Parameter
device ITestDevice

wifiUtilApkPath String

doSetup boolean

useV2 boolean

Würfe
DeviceNotAvailableException

Öffentliche Methoden

addOpenNetwork

public boolean addOpenNetwork (String ssid)

Parameter
ssid String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

addOpenNetwork

public boolean addOpenNetwork (String ssid, 
                boolean scanSsid)

Parameter
ssid String

scanSsid boolean

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

addWpaPskNetwork

public boolean addWpaPskNetwork (String ssid, 
                String psk)

Parameter
ssid String

psk String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

addWpaPskNetwork

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

Parameter
ssid String

psk String

scanSsid boolean

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

checkConnectivity

public boolean checkConnectivity (String urlToCheck)

Parameter
urlToCheck String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

Aufräumen

public void cleanUp ()

Würfe
DeviceNotAvailableException

connectToNetwork

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

Parameter
ssid String

psk String

urlToCheck String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

connectToNetwork

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

Parameter
ssid String

psk String

urlToCheck String

scanSsid boolean

Kehrt zurück
IWifiHelper.WifiConnectionResult

Würfe
DeviceNotAvailableException

Deaktiviere WiFi

public boolean disableWifi ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

„disconnectFromNetwork“.

public boolean disconnectFromNetwork ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

WLAN aktivieren

public boolean enableWifi ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

extractWifiUtilApk

public static File extractWifiUtilApk ()

Hilfsmethode zum Extrahieren der wifi util apk aus dem Klassenpfad

Kehrt zurück
File

getBSSID

public String getBSSID ()

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getSSID

public String getSSID ()

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getWifiInfo

public  getWifiInfo ()

Kehrt zurück

Würfe
DeviceNotAvailableException

hasValidIp

public boolean hasValidIp ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

Alle Netzwerke entfernen

public boolean removeAllNetworks ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

startMonitor

public boolean startMonitor (long interval, 
                String urlToCheck)

Parameter
interval long

urlToCheck String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

stopMonitor

public  stopMonitor ()

Kehrt zurück

Würfe
DeviceNotAvailableException

waitForIp

public boolean waitForIp (long timeout)

Parameter
timeout long

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled (long timeout)

Parameter
timeout long

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

waitForWifiDisabled

public boolean waitForWifiDisabled ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled (long timeout)

Parameter
timeout long

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

waitForWifiEnabled

public boolean waitForWifiEnabled ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

waitForWifiState

public boolean waitForWifiState (WifiState... expectedStates)

Parameter
expectedStates WifiState

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException