Penunjang Wifi
public
class
WifiHelper
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.WifiHelper |
Class helper untuk memanipulasi layanan Wi-Fi di perangkat.
Ringkasan
Kolom | |
---|---|
public
static
final
String |
INSTRUMENTATION_PKG
|
Konstruktor publik | |
---|---|
WifiHelper(ITestDevice device)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath)
|
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Konstruktor alternatif yang dapat melewati penyiapan apk wifi. |
|
WifiHelper(ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Konstruktor untuk menentukan apakah akan menggunakan wifi helper v2 baru. |
Metode publik | |
---|---|
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()
Metode helper untuk mengekstrak apk utilitas wifi dari classpath |
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)
|
Kolom
INSTRUMENTASI_PKG
public static final String INSTRUMENTATION_PKG
Konstruktor publik
Penunjang Wifi
public WifiHelper (ITestDevice device)
Parameter | |
---|---|
device |
ITestDevice |
Menampilkan | |
---|---|
DeviceNotAvailableException |
Penunjang Wifi
public WifiHelper (ITestDevice device, String wifiUtilApkPath)
Parameter | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
Menampilkan | |
---|---|
DeviceNotAvailableException |
Penunjang Wifi
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup)
Konstruktor alternatif yang dapat melewati penyiapan apk wifi.
Parameter | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
Penunjang Wifi
public WifiHelper (ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2)
Konstruktor untuk menentukan apakah akan menggunakan wifi helper v2 baru. Operasi v2 tidak perlu instal apk util wifi.
Parameter | |
---|---|
device |
ITestDevice |
wifiUtilApkPath |
String |
doSetup |
boolean |
useV2 |
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
Metode publik
{i>addOpenNetwork<i}
public boolean addOpenNetwork (String ssid)
Parameter | |
---|---|
ssid |
String |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
{i>addOpenNetwork<i}
public boolean addOpenNetwork (String ssid, boolean scanSsid)
Parameter | |
---|---|
ssid |
String |
scanSsid |
boolean |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
TambahkanWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk)
Parameter | |
---|---|
ssid |
String |
psk |
String |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
TambahkanWpaPskNetwork
public boolean addWpaPskNetwork (String ssid, String psk, boolean scanSsid)
Parameter | |
---|---|
ssid |
String |
psk |
String |
scanSsid |
boolean |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
checkKonektivitas
public boolean checkConnectivity (String urlToCheck)
Parameter | |
---|---|
urlToCheck |
String |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
sambungkan ke Jaringan
public boolean connectToNetwork (String ssid, String psk, String urlToCheck)
Parameter | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
sambungkan ke Jaringan
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid, String defaultType)
Parameter | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
defaultType |
String |
Hasil | |
---|---|
IWifiHelper.WifiConnectionResult |
Menampilkan | |
---|---|
DeviceNotAvailableException |
sambungkan ke Jaringan
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid, String psk, String urlToCheck, boolean scanSsid)
Parameter | |
---|---|
ssid |
String |
psk |
String |
urlToCheck |
String |
scanSsid |
boolean |
Hasil | |
---|---|
IWifiHelper.WifiConnectionResult |
Menampilkan | |
---|---|
DeviceNotAvailableException |
nonaktifkan Wi-Fi
public boolean disableWifi ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
pemutusanDariJaringan
public boolean disconnectFromNetwork ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
ekstrakWifiUtilApk
public static File extractWifiUtilApk ()
Metode helper untuk mengekstrak apk utilitas wifi dari classpath
Hasil | |
---|---|
File |
IsWi-FiEnabled
public boolean isWifiEnabled ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
hapusSemuaJaringan
public boolean removeAllNetworks ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
startMonitor
public boolean startMonitor (long interval, String urlToCheck)
Parameter | |
---|---|
interval |
long |
urlToCheck |
String |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
tungguForIp
public boolean waitForIp (long timeout)
Parameter | |
---|---|
timeout |
long |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
tungguForWi-FiDinonaktifkan
public boolean waitForWifiDisabled (long timeout)
Parameter | |
---|---|
timeout |
long |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
tungguForWi-FiDinonaktifkan
public boolean waitForWifiDisabled ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
tungguForWifiEnabled
public boolean waitForWifiEnabled (long timeout)
Parameter | |
---|---|
timeout |
long |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
tungguForWifiEnabled
public boolean waitForWifiEnabled ()
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |
waitForWi-FiState
public boolean waitForWifiState (WifiState... expectedStates)
Parameter | |
---|---|
expectedStates |
WifiState |
Hasil | |
---|---|
boolean |
Menampilkan | |
---|---|
DeviceNotAvailableException |