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 |
Mở rộng hành vi RemoteAndroidDevice
cho một thiết bị Android toàn ngăn xếp chạy trong Google Compute Engine (Gce). Giả sử số sê-ri của thiết bị sẽ có định dạng
Tóm tắt
Hàm khởi tạo công khai | |
---|---|
RemoteAndroidVirtualDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
|
Phương thức công khai | |
---|---|
GceAvdInfo
|
getAvdInfo()
Trả về |
DeviceDescriptor
|
getDeviceDescriptor()
|
|
getTombstones()
Cuttlefish có một tính năng đặc biệt giúp đưa các mốc tombstone đến máy chủ từ xa để chúng ta có thể lấy trực tiếp các mốc đó. |
void
|
postBootSetup()
{@inherit } |
void
|
postInvocationTearDown(Throwable exception)
|
boolean
|
powerwashGce()
Cố gắng xoá sạch một phiên bản máy ảo GCE |
void
|
preInvocationSetup(IBuildInfo info, MultiMap<String, String> attributes)
|
void
|
recoverDevice()
Cố gắng khôi phục khả năng giao tiếp của thiết bị. |
void
|
setGceSshMonitor(GceSshTunnelMonitor gceSshMonitor)
Ghi đè |
void
|
setTestLogger(ITestLogger testLogger)
|
Phương thức được bảo vệ | |
---|---|
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Khởi động lại adb. |
long
|
getCurrentTime()
Trả về thời gian hệ thống hiện tại. |
GceSshTunnelMonitor
|
getGceSshMonitor()
Trả về |
void
|
launchGce(IBuildInfo buildInfo, MultiMap<String, String> attributes)
Chạy thiết bị gce thực tế dựa trên thông tin bản dựng. |
void
|
waitForTunnelOnline(long waitTime)
Kiểm tra xem trình giám sát đường hầm có đang chạy hay không. |
Hàm khởi tạo công khai
RemoteAndroidVirtualDevice
public RemoteAndroidVirtualDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Tạo RemoteAndroidVirtualDevice
.
Tham số | |
---|---|
device |
IDevice : IDevice được liên kết |
stateMonitor |
IDeviceStateMonitor : cơ chế IDeviceStateMonitor cần sử dụng |
allocationMonitor |
IDeviceMonitor : IDeviceMonitor để thông báo về các thay đổi trạng thái phân bổ.
|
Phương thức công khai
getAvdInfo
public GceAvdInfo getAvdInfo ()
Trả về GceAvdInfo
từ máy ảo từ xa đã tạo. Trả về giá trị rỗng nếu không thành công khi hiển thị.
Giá trị trả về | |
---|---|
GceAvdInfo |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Giá trị trả về | |
---|---|
DeviceDescriptor |
getTombstones
publicgetTombstones ()
Cuttlefish có một tính năng đặc biệt giúp đưa các mốc tombstone đến máy chủ từ xa để chúng ta có thể lấy trực tiếp các mốc đó.
Giá trị trả về | |
---|---|
|
Gửi | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
{@inherit }
Gửi | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Tham số | |
---|---|
exception |
Throwable |
powerwashGce
public boolean powerwashGce ()
Cố gắng xoá sạch một phiên bản máy ảo GCE
Giá trị trả về | |
---|---|
boolean |
trả về true nếu quá trình dọn sạch Gce thành công. |
Gửi | |
---|---|
|
com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException |
|
TargetSetupError |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Tham số | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Gửi | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
recoverDevice
public void recoverDevice ()
Cố gắng khôi phục khả năng giao tiếp của thiết bị.
Gửi | |
---|---|
DeviceNotAvailableException |
setGceSshMonitor
public void setGceSshMonitor (GceSshTunnelMonitor gceSshMonitor)
Ghi đè GceSshTunnelMonitor
nội bộ của thiết bị.
Tham số | |
---|---|
gceSshMonitor |
GceSshTunnelMonitor |
setTestLogger
public void setTestLogger (ITestLogger testLogger)
Tham số | |
---|---|
testLogger |
ITestLogger |
Phương thức được bảo vệ
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Khởi động lại adb.
Tham số | |
---|---|
rebootMode |
NativeDevice.RebootMode : chế độ khởi động lại này. |
reason |
String : cho lần khởi động lại này. |
Gửi | |
---|---|
DeviceNotAvailableException |
getCurrentTime
protected long getCurrentTime ()
Trả về thời gian hệ thống hiện tại. Được hiển thị để kiểm thử.
Giá trị trả về | |
---|---|
long |
getGceSshMonitor
protected GceSshTunnelMonitor getGceSshMonitor ()
Trả về GceSshTunnelMonitor
của thiết bị.
Được hiển thị để kiểm thử.
Giá trị trả về | |
---|---|
GceSshTunnelMonitor |
launchGce
protected void launchGce (IBuildInfo buildInfo, MultiMap<String, String> attributes)
Chạy thiết bị gce thực tế dựa trên thông tin bản dựng.
Tham số | |
---|---|
buildInfo |
IBuildInfo |
attributes |
MultiMap |
Gửi | |
---|---|
TargetSetupError |
waitForTunnelOnline
protected void waitForTunnelOnline (long waitTime)
Kiểm tra xem trình giám sát đường hầm có đang chạy hay không.
Tham số | |
---|---|
waitTime |
long |
Gửi | |
---|---|
DeviceNotAvailableException |