リモートAndroidデバイス

public class RemoteAndroidDevice
extends TestDevice

java.lang.オブジェクト
com.android.tradefed.device.NativeDevice
com.android.tradefed.device.TestDevice
com.android.tradefed.device.RemoteAndroidDevice


adb connect 経由で接続されたフルスタック Android デバイス用のITestDeviceの実装。デバイスのシリアルは次の形式であると仮定します。 : adbで。

まとめ

定数

long DEFAULT_SHORT_CMD_TIMEOUT

int MAX_RETRIES

long RETRY_INTERVAL_MS

long WAIT_FOR_ADB_CONNECT

パブリックコンストラクター

RemoteAndroidDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

RemoteAndroidDeviceを作成します。

パブリックメソッド

static boolean checkSerialFormatValid (String serialString)

シリアルの形式が期待どおりであるかどうかを確認します:ポート

boolean connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid) connectToWifiNetwork ( wifiSsidToPsk, boolean scanSsid)

Wi-Fi ネットワークに接続します。

DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

実際のデバイス オブジェクトを渡さずにデバイス情報を取得するには、デバイス情報からDeviceDescriptorを返します。

String getFastbootSerialNumber ()

fastboot モードのシリアル番号を返します。

String getMacAddress ()

デバイスの MAC アドレスを返します。デバイスからのクエリに失敗した場合は null を返します。

boolean isEncryptionSupported ()

デバイスで暗号化がサポートされているかどうかを返します。

定数

DEFAULT_SHORT_CMD_TIMEOUT

protected static final long DEFAULT_SHORT_CMD_TIMEOUT

定数値: 20000 (0x0000000000004e20)

MAX_RETRIES

protected static final int MAX_RETRIES

定数値: 5 (0x00000005)

RETRY_INTERVAL_MS

protected static final long RETRY_INTERVAL_MS

定数値: 5000 (0x0000000000001388)

WAIT_FOR_ADB_CONNECT

public static final long WAIT_FOR_ADB_CONNECT

定数値: 120000 (0x000000000001d4c0)

パブリックコンストラクター

リモートAndroidデバイス

public RemoteAndroidDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

RemoteAndroidDeviceを作成します。

パラメーター
device IDevice : 関連付けられたIDevice

stateMonitor IDeviceStateMonitor : 使用するIDeviceStateMonitorメカニズム

allocationMonitor IDeviceMonitor : 割り当て状態の変更を通知するIDeviceMonitor

パブリックメソッド

checkSerialFormatValid

public static boolean checkSerialFormatValid (String serialString)

シリアルの形式が期待どおりであるかどうかを確認します:ポート

パラメーター
serialString String

戻り値
boolean形式が有効な場合は true、それ以外の場合は false。

Wifiネットワークに接続する

public boolean connectToWifiNetwork ( wifiSsidToPsk, 
                boolean scanSsid)

Wi-Fi ネットワークに接続します。

Wi-Fi をオンにし、wifiSsidToPsk マップで指定された Wi-Fi ネットワークの 1 つとの接続が成功するまでブロックします。接続が確立されると、インスタンスはITestDevice#disconnectFromWifi()またはITestDevice#clearLastConnectedWifiNetwork()が呼び出されるまで、再起動のたびに接続の復元を試みます。

パラメーター
wifiSsidToPsk : Wi-Fi SSID とパスワードのマップ。

scanSsid boolean : このネットワークの非表示の SSID をスキャンするかどうか。

戻り値
boolean Wi-Fi ネットワークに正常に接続された場合はtrue 。それ以外の場合はfalse

投げる
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

実際のデバイス オブジェクトを渡さずにデバイス情報を取得するには、デバイス情報からDeviceDescriptorを返します。

パラメーター
shortDescriptor boolean : 記述子を最小限の情報に制限するかどうか

戻り値
DeviceDescriptor

getFastbootSerialNumber

public String getFastbootSerialNumber ()

fastboot モードのシリアル番号を返します。

戻り値
String

マックアドレスを取得する

public String getMacAddress ()

デバイスの MAC アドレスを返します。デバイスからのクエリに失敗した場合は null を返します。

戻り値
String

暗号化がサポートされています

public boolean isEncryptionSupported ()

デバイスで暗号化がサポートされているかどうかを返します。

戻り値
booleanデバイスが暗号化をサポートする場合はtrue