RemoteAndroidDevice

public class RemoteAndroidDevice
extends TestDevice

java.lang.Object
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)

シリアル番号の形式が想定どおりの :port であるかどうかを確認します。

IWifiHelper.WifiConnectionResult connectToWifiNetworkWithResult(Map<String, String> wifiSsidToPsk, boolean scanSsid)

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

DeviceDescriptor getDeviceDescriptor(boolean shortDescriptor)

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

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)

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

RemoteAndroidDevice

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)

シリアル番号の形式が想定どおりの :port であるかどうかを確認します。

パラメータ
serialString String

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

connectToWifiNetworkWithResult

public IWifiHelper.WifiConnectionResult connectToWifiNetworkWithResult (Map<String, String> wifiSsidToPsk, 
                boolean scanSsid)

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

Wi-Fi をオンにし、wifiSsidToPsk マップに指定された Wi-Fi ネットワークのいずれかに接続されるまでブロックします。接続が確立されると、ITestDevice.disconnectFromWifi() または ITestDevice.clearLastConnectedWifiNetwork() が呼び出されるまで、再起動のたびに接続の復元が試行されます。

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

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

戻り値
IWifiHelper.WifiConnectionResult 接続のステータスを示す WifiConnectionResult

例外
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

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

パラメータ
shortDescriptor boolean: ディスクリプタを最小限の情報に制限するかどうか

戻り値
DeviceDescriptor

getMacAddress

public String getMacAddress ()

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

戻り値
String

isEncryptionSupported

public boolean isEncryptionSupported ()

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

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