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

boolean 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)

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

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。

connectToWifiNetwork

public boolean connectToWifiNetwork ( wifiSsidToPsk, 
                boolean scanSsid)

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

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

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

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

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

例外
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

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

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

戻り値
DeviceDescriptor

getFastbootSerialNumber

public String getFastbootSerialNumber ()

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

戻り値
String

getMacAddress

public String getMacAddress ()

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

戻り値
String

isEncryptionSupported

public boolean isEncryptionSupported ()

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

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