Trình trợ giúp Wifi
public class WifiHelper
extends Object
java.lang.Object |
↳ | com.android.tradefed.device.WifiHelper |
Lớp trợ giúp thao tác các dịch vụ wifi trên thiết bị.
Bản tóm tắt
Nhà thầu xây dựng công cộng |
---|
WifiHelper ( ITestDevice device) |
WifiHelper ( ITestDevice device, String wifiUtilApkPath) |
WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup) Trình xây dựng thay thế có thể bỏ qua quá trình thiết lập apk wifi. |
WifiHelper ( ITestDevice device, String wifiUtilApkPath, boolean doSetup, boolean useV2) Trình xây dựng để chỉ định có sử dụng trình trợ giúp wifi mới v2 hay không. |
Phương pháp công cộng |
---|
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 () Phương pháp trợ giúp để trích xuất apk sử dụng wifi từ đường dẫn lớp |
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) |
Lĩnh vực
INSTRUMENTATION_PKG
public static final String INSTRUMENTATION_PKG
Nhà thầu xây dựng công cộng
Trình trợ giúp Wifi
public WifiHelper (ITestDevice device)
Thông số |
---|
device | ITestDevice |
Trình trợ giúp Wifi
public WifiHelper (ITestDevice device,
String wifiUtilApkPath)
Thông số |
---|
device | ITestDevice |
wifiUtilApkPath | String |
Trình trợ giúp Wifi
public WifiHelper (ITestDevice device,
String wifiUtilApkPath,
boolean doSetup)
Trình xây dựng thay thế có thể bỏ qua quá trình thiết lập apk wifi.
Thông số |
---|
device | ITestDevice |
wifiUtilApkPath | String |
doSetup | boolean |
Trình trợ giúp Wifi
public WifiHelper (ITestDevice device,
String wifiUtilApkPath,
boolean doSetup,
boolean useV2)
Trình xây dựng để chỉ định có sử dụng trình trợ giúp wifi mới v2 hay không. Hoạt động v2 không cần cài đặt apk sử dụng wifi.
Thông số |
---|
device | ITestDevice |
wifiUtilApkPath | String |
doSetup | boolean |
useV2 | boolean |
Phương pháp công cộng
thêmOpenNetwork
public boolean addOpenNetwork (String ssid)
thêmOpenNetwork
public boolean addOpenNetwork (String ssid,
boolean scanSsid)
Thông số |
---|
ssid | String |
scanSsid | boolean |
thêmWpaPskMạng
public boolean addWpaPskNetwork (String ssid,
String psk)
Thông số |
---|
ssid | String |
psk | String |
thêmWpaPskMạng
public boolean addWpaPskNetwork (String ssid,
String psk,
boolean scanSsid)
Thông số |
---|
ssid | String |
psk | String |
scanSsid | boolean |
kiểm traKết nối
public boolean checkConnectivity (String urlToCheck)
Thông số |
---|
urlToCheck | String |
dọn dẹp
public void cleanUp ()
kết nối với mạng
public boolean connectToNetwork (String ssid,
String psk,
String urlToCheck)
Thông số |
---|
ssid | String |
psk | String |
urlToCheck | String |
kết nối với mạng
public IWifiHelper.WifiConnectionResult connectToNetwork (String ssid,
String psk,
String urlToCheck,
boolean scanSsid)
Thông số |
---|
ssid | String |
psk | String |
urlToCheck | String |
scanSsid | boolean |
Trả lại |
---|
IWifiHelper.WifiConnectionResult | |
vô hiệu hóaWifi
public boolean disableWifi ()
ngắt kết nối khỏi mạng
public boolean disconnectFromNetwork ()
kích hoạtWifi
public boolean enableWifi ()
public static File extractWifiUtilApk ()
Phương pháp trợ giúp để trích xuất apk sử dụng wifi từ đường dẫn lớp
lấyBSSID
public String getBSSID ()
lấy địa chỉ Ip
public String getIpAddress ()
nhận SSID
public String getSSID ()
getWifiThông tin
public getWifiInfo ()
hasValidIp
public boolean hasValidIp ()
isWifiEnabled
public boolean isWifiEnabled ()
loại bỏTất cả các mạng
public boolean removeAllNetworks ()
màn hình bắt đầu
public boolean startMonitor (long interval,
String urlToCheck)
Thông số |
---|
interval | long |
urlToCheck | String |
dừng lạiMàn hình
public stopMonitor ()
chờForIp
public boolean waitForIp (long timeout)
chờForWifiĐã tắt
public boolean waitForWifiDisabled (long timeout)
chờForWifiĐã tắt
public boolean waitForWifiDisabled ()
chờForWifiĐã bật
public boolean waitForWifiEnabled (long timeout)
chờForWifiĐã bật
public boolean waitForWifiEnabled ()
chờForWifiState
public boolean waitForWifiState (WifiState... expectedStates)
Thông số |
---|
expectedStates | WifiState |