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 の実装。デバイスのシリアル番号が : in 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 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

getMacAddress

public String getMacAddress ()

デバイスの MAC アドレスを返します。デバイスからクエリを実行できなかった場合は null を返します。

戻り値
String

isEncryptionSupported

public boolean isEncryptionSupported ()

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

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