RemoteAndroidVirtualDevice
public
class
RemoteAndroidVirtualDevice
extends RemoteAndroidDevice
implements
ITestLoggerReceiver
java.lang.Object | ||||
↳ | com.android.tradefed.device.NativeDevice | |||
↳ | com.android.tradefed.device.TestDevice | |||
↳ | com.android.tradefed.device.RemoteAndroidDevice | |||
↳ | com.android.tradefed.device.cloud.RemoteAndroidVirtualDevice |
針對在 Google Compute Engine (GCE) 中執行的完整堆疊 Android 裝置,擴充 RemoteAndroidDevice
行為。假設裝置序號的格式為
摘要
公用建構函式 | |
---|---|
RemoteAndroidVirtualDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
|
公用方法 | |
---|---|
GceAvdInfo
|
getAvdInfo()
從已建立的遠端 VM 傳回 |
DeviceDescriptor
|
getDeviceDescriptor()
|
|
getTombstones()
Cuttlefish 有特殊功能,可將墓碑帶到遠端主機,讓我們直接取得這些墓碑。 |
void
|
postBootSetup()
{@inherit } |
void
|
postInvocationTearDown(Throwable exception)
|
boolean
|
powerwashGce()
嘗試執行 GCE 執行個體的 Powerwash 作業 |
void
|
preInvocationSetup(IBuildInfo info, MultiMap<String, String> attributes)
|
void
|
recoverDevice()
嘗試恢復裝置通訊。 |
void
|
setGceSshMonitor(GceSshTunnelMonitor gceSshMonitor)
覆寫裝置的內部 |
void
|
setTestLogger(ITestLogger testLogger)
|
受保護的方法 | |
---|---|
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
執行 ADB 重新啟動。 |
long
|
getCurrentTime()
傳回目前的系統時間。 |
GceSshTunnelMonitor
|
getGceSshMonitor()
傳回裝置的 |
void
|
launchGce(IBuildInfo buildInfo, MultiMap<String, String> attributes)
根據建構資訊啟動實際的 gce 裝置。 |
void
|
waitForTunnelOnline(long waitTime)
檢查通道監控器是否正在執行。 |
公用建構函式
RemoteAndroidVirtualDevice
public RemoteAndroidVirtualDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
建立 RemoteAndroidVirtualDevice
。
參數 | |
---|---|
device |
IDevice :相關聯的 IDevice |
stateMonitor |
IDeviceStateMonitor :要使用的 IDeviceStateMonitor 機制 |
allocationMonitor |
IDeviceMonitor :用於通知分配狀態變更的 IDeviceMonitor 。 |
公用方法
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
傳回 | |
---|---|
DeviceDescriptor |
getTombstones
publicgetTombstones ()
Cuttlefish 有特殊功能,可將墓碑帶到遠端主機,讓我們直接取得這些墓碑。
傳回 | |
---|---|
|
擲回 | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
{@inherit }
擲回 | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
參數 | |
---|---|
exception |
Throwable |
powerwashGce
public boolean powerwashGce ()
嘗試對 GCE 執行個體執行 Powerwash
傳回 | |
---|---|
boolean |
如果 GCE 的 powerwash 作業成功,就會傳回 true。 |
擲回 | |
---|---|
|
com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException |
|
TargetSetupError |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
參數 | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
擲回 | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
recoverDevice
public void recoverDevice ()
嘗試恢復裝置通訊。
擲回 | |
---|---|
DeviceNotAvailableException |
setGceSshMonitor
public void setGceSshMonitor (GceSshTunnelMonitor gceSshMonitor)
覆寫裝置的內部 GceSshTunnelMonitor
。
參數 | |
---|---|
gceSshMonitor |
GceSshTunnelMonitor |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
參數 | |
---|---|
testLogger |
ITestLogger |
受保護的方法
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
執行 ADB 重新啟動。
參數 | |
---|---|
rebootMode |
NativeDevice.RebootMode :此重新啟動模式。 |
reason |
String :針對這次重新啟動。 |
擲回 | |
---|---|
DeviceNotAvailableException |
getCurrentTime
protected long getCurrentTime ()
傳回目前的系統時間。已公開供測試。
傳回 | |
---|---|
long |
getGceSshMonitor
protected GceSshTunnelMonitor getGceSshMonitor ()
傳回裝置的 GceSshTunnelMonitor
。已公開供測試。
傳回 | |
---|---|
GceSshTunnelMonitor |
launchGce
protected void launchGce (IBuildInfo buildInfo, MultiMap<String, String> attributes)
根據建構資訊啟動實際的 gce 裝置。
參數 | |
---|---|
buildInfo |
IBuildInfo |
attributes |
MultiMap |
擲回 | |
---|---|
TargetSetupError |
waitForTunnelOnline
protected void waitForTunnelOnline (long waitTime)
檢查通道監控器是否正在執行。
參數 | |
---|---|
waitTime |
long |
擲回 | |
---|---|
DeviceNotAvailableException |