RemoteAndroidDevice
public
class
RemoteAndroidDevice
extends TestDevice
| java.lang.Object | |||
| ↳ | com.android.tradefed.device.NativeDevice | ||
| ↳ | com.android.tradefed.device.TestDevice | ||
| ↳ | com.android.tradefed.device.RemoteAndroidDevice | ||
Implementation of a ITestDevice for a full stack android device connected via
adb connect.
Assume the device serial will be in the format
ملخّص
الثوابت | |
|---|---|
long |
DEFAULT_SHORT_CMD_TIMEOUT
|
int |
MAX_RETRIES
|
long |
RETRY_INTERVAL_MS
|
long |
WAIT_FOR_ADB_CONNECT
|
طُرق وضع التصميم العامة | |
|---|---|
RemoteAndroidDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Creates a |
|
الإجراءات العامة | |
|---|---|
static
boolean
|
checkSerialFormatValid(String serialString)
Check if the format of the serial is as expected |
IWifiHelper.WifiConnectionResult
|
connectToWifiNetworkWithResult(Map<String, String> wifiSsidToPsk, boolean scanSsid)
Connects to a wifi network. |
DeviceDescriptor
|
getDeviceDescriptor(boolean shortDescriptor)
Return a |
String
|
getMacAddress()
Returns the MAC address of the device, null if it fails to query from the device. |
boolean
|
isEncryptionSupported()
Returns if encryption is supported on the device. |
الثوابت
DEFAULT_SHORT_CMD_TIMEOUT
protected static final long DEFAULT_SHORT_CMD_TIMEOUT
Constant Value: 20000 (0x0000000000004e20)
MAX_RETRIES
protected static final int MAX_RETRIES
Constant Value: 5 (0x00000005)
RETRY_INTERVAL_MS
protected static final long RETRY_INTERVAL_MS
Constant Value: 5000 (0x0000000000001388)
WAIT_FOR_ADB_CONNECT
public static final long WAIT_FOR_ADB_CONNECT
Constant Value: 120000 (0x000000000001d4c0)
طُرق وضع التصميم العامة
RemoteAndroidDevice
public RemoteAndroidDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Creates a RemoteAndroidDevice.
| المعلَمات | |
|---|---|
device |
IDevice: the associated IDevice |
stateMonitor |
IDeviceStateMonitor: the IDeviceStateMonitor mechanism to use |
allocationMonitor |
IDeviceMonitor: the IDeviceMonitor to inform of allocation state changes. |
الإجراءات العامة
checkSerialFormatValid
public static boolean checkSerialFormatValid (String serialString)
Check if the format of the serial is as expected
| المعلَمات | |
|---|---|
serialString |
String |
| المرتجعات | |
|---|---|
boolean |
true if the format is valid, false otherwise. |
connectToWifiNetworkWithResult
public IWifiHelper.WifiConnectionResult connectToWifiNetworkWithResult (Map<String, String> wifiSsidToPsk, boolean scanSsid)
Connects to a wifi network.
Turns on wifi and blocks until a successful connection is made with one of the wifi
networks given in the wifiSsidToPsk map. Once a connection is made, the instance will try to
restore the connection after every reboot until ITestDevice.disconnectFromWifi() or
ITestDevice.clearLastConnectedWifiNetwork() is called.
| المعلَمات | |
|---|---|
wifiSsidToPsk |
Map: A map of wifi SSIDs to passwords. |
scanSsid |
boolean: whether to scan for hidden SSIDs for this network. |
| المرتجعات | |
|---|---|
IWifiHelper.WifiConnectionResult |
the WifiConnectionResult indicating the status of the connection. |
| عمليات الطرح | |
|---|---|
DeviceNotAvailableException |
|
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)
Return a DeviceDescriptor from the device information to get info on it without
passing the actual device object.
| المعلَمات | |
|---|---|
shortDescriptor |
boolean: Whether or not to limit descriptor to bare minimum info |
| المرتجعات | |
|---|---|
DeviceDescriptor |
|
getMacAddress
public String getMacAddress ()
Returns the MAC address of the device, null if it fails to query from the device.
| المرتجعات | |
|---|---|
String |
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Returns if encryption is supported on the device.
| المرتجعات | |
|---|---|
boolean |
true if the device supports encryption. |