Wi-FiHelper
public
class
WifiHelper
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.WifiHelper, |
Klasa pomocnicza do manipulowania usługami Wi-Fi na urządzeniu.
Podsumowanie
Fieldsem | |
---|---|
public
static
final
String |
INSTRUMENTATION_PKG
|
Konstruktory publiczne | |
---|---|
WifiHelper(ITestDevice device)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Alternatywny konstruktor, który może pominąć konfigurację pakietu Wi-Fi apk. |
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Konstruktor określający, czy należy użyć nowej pomocniczej Wi-Fi w wersji 2. |
Metody publiczne | |
---|---|
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()
Metoda pomocnicza do wyodrębniania pakietu Wi-Fi util apk ze ścieżki klasy |
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)
|
Fieldsem
INSTRUMENTATION_PKG
public static final String INSTRUMENTATION_PKG
Konstruktory publiczne
Wi-FiHelper
public WifiHelper (ITestDevice device)
Parametry | |
---|---|
device |
ITestDevice |
Rzuty | |
---|---|
DeviceNotAvailableException |
Wi-FiHelper
public WifiHelper (ITestDevice device, String wifiUtilApkPath)
Parametry | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
Rzuty | |
---|---|
DeviceNotAvailableException |
Wi-FiHelper
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Alternatywny konstruktor, który może pominąć konfigurację pakietu Wi-Fi apk.
Parametry | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Wi-FiHelper
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Konstruktor określający, czy należy użyć nowej pomocniczej Wi-Fi w wersji 2. Operacje w wersji 2 nie muszą Zainstaluj Wi-Fi util apk.
Parametry | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
useV2 |
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Metody publiczne
addOpenNetwork
public boolean addOpenNetwork (String ssid)
Parametry | |
---|---|
ssid |
String |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
addOpenNetwork
public boolean addOpenNetwork (String ssid, boolean scanSsid)
Parametry | |
---|---|
ssid |
String |
scanSsid |
boolean |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
addWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk)
Parametry | |
---|---|
ssid |
String |
psk |
String |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
addWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk, boolean scanSsid)
Parametry | |
---|---|
ssid |
String |
psk |
String |
scanSsid |
boolean |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
sprawdź połączenia
public boolean checkConnectivity (String urlToCheck)
Parametry | |
---|---|
urlToCheck |
String |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
ConnectToNetwork
public boolean connectToNetwork (String ssid, String psk, String urlToCheck)
Parametry | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
ConnectToNetwork
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid, String defaultType)
Parametry | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
defaultType |
String |
Zwroty | |
---|---|
IWifiHelper.WifiConnectionResult |
Rzuty | |
---|---|
DeviceNotAvailableException |
ConnectToNetwork
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid)
Parametry | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
Zwroty | |
---|---|
IWifiHelper.WifiConnectionResult |
Rzuty | |
---|---|
DeviceNotAvailableException |
odłączyćOd sieci
public boolean disconnectFromNetwork ()
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
WyodrębnijWifiUtilApk
public static File extractWifiUtilApk ()
Metoda pomocnicza do wyodrębniania pakietu Wi-Fi util apk ze ścieżki klasy
Zwroty | |
---|---|
File |
Ma prawidłowy adres IP
public boolean hasValidIp ()
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
usuń wszystkie sieci
public boolean removeAllNetworks ()
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Monitor startowy
public boolean startMonitor (long interval, String urlToCheck)
Parametry | |
---|---|
interval |
long |
urlToCheck |
String |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Oczekiwanie na IP
public boolean waitForIp (long timeout)
Parametry | |
---|---|
timeout |
long |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Oczekiwanie na Wi-FiDisabled
public boolean waitForWifiDisabled (long timeout)
Parametry | |
---|---|
timeout |
long |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Oczekiwanie na Wi-FiDisabled
public boolean waitForWifiDisabled ()
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Poczekaj na Wi-Fi
public boolean waitForWifiEnabled (long timeout)
Parametry | |
---|---|
timeout |
long |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Poczekaj na Wi-Fi
public boolean waitForWifiEnabled ()
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |
Oczekiwanie naWifiState
public boolean waitForWifiState (WifiState... expectedStates)
Parametry | |
---|---|
expectedStates |
WifiState |
Zwroty | |
---|---|
boolean |
Rzuty | |
---|---|
DeviceNotAvailableException |