อุปกรณ์เสมือน Android ระยะไกล

public class RemoteAndroidVirtualDevice
extends RemoteAndroidDevice implements ITestLoggerReceiver

java.lang.Object
com.android.tradefed.device.NativeDevice
com.android.tradefed.device.TestDevice
com.android.tradefed.device.RemoteAndroidอุปกรณ์
com.android.tradefed.device.cloud.RemoteAndroidVirtualDevice


ขยายพฤติกรรมของอุปกรณ์ RemoteAndroidDevice สำหรับอุปกรณ์ Android แบบสแต็กเต็มรูปแบบที่ทำงานใน Google Compute Engine (Gce) สมมติว่าซีเรียลของอุปกรณ์จะอยู่ในรูปแบบ : : ใน adb

สรุป

ผู้รับเหมาก่อสร้างสาธารณะ

RemoteAndroidVirtualDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

สร้าง RemoteAndroidVirtualDevice

วิธีการสาธารณะ

GceAvdInfo getAvdInfo ()

ส่งคืน GceAvdInfo จาก VM ระยะไกลที่สร้างขึ้น

DeviceDescriptor getDeviceDescriptor ()

getTombstones ()

ปลาหมึกมีคุณสมบัติพิเศษที่จะนำศิลาจารึกหลุมศพไปยังโฮสต์ระยะไกลซึ่งเราสามารถรับพวกมันได้โดยตรง

void postBootSetup ()

{@สืบทอด }

void postInvocationTearDown (Throwable exception)

boolean powerwashGce ()

พยายาม Powerwash อินสแตนซ์ GCE

void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)

void recoverDevice ()

พยายามกู้คืนการสื่อสารของอุปกรณ์

void setGceSshMonitor ( GceSshTunnelMonitor gceSshMonitor)

ลบล้าง GceSshTunnelMonitor ภายในของอุปกรณ์

void setTestLogger (ITestLogger testLogger)

วิธีการที่ได้รับการป้องกัน

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

ทำการรีบูต adb

long getCurrentTime ()

ส่งกลับเวลาของระบบปัจจุบัน

GceSshTunnelMonitor getGceSshMonitor ()

ส่งคืน GceSshTunnelMonitor ของอุปกรณ์

void launchGce (IBuildInfo buildInfo, MultiMap<String, String> attributes)

เปิดตัวอุปกรณ์ gce จริงตามข้อมูลบิวด์

void waitForTunnelOnline (long waitTime)

ตรวจสอบว่ามอนิเตอร์ทันเนลกำลังทำงานอยู่หรือไม่

ผู้รับเหมาก่อสร้างสาธารณะ

อุปกรณ์เสมือน Android ระยะไกล

public RemoteAndroidVirtualDevice (IDevice device, 
                IDeviceStateMonitor stateMonitor, 
                IDeviceMonitor allocationMonitor)

สร้าง RemoteAndroidVirtualDevice

พารามิเตอร์
device IDevice : IDevice ที่เกี่ยวข้อง

stateMonitor IDeviceStateMonitor : กลไก IDeviceStateMonitor ที่จะใช้

allocationMonitor IDeviceMonitor : IDeviceMonitor เพื่อแจ้งการเปลี่ยนแปลงสถานะการจัดสรร

วิธีการสาธารณะ

getAvdInfo

public GceAvdInfo getAvdInfo ()

ส่งคืน GceAvdInfo จาก VM ระยะไกลที่สร้างขึ้น ส่งคืนค่าว่างหากการนำขึ้นมาไม่สำเร็จ

การส่งคืน
GceAvdInfo

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

การส่งคืน
DeviceDescriptor

รับTombstones

public  getTombstones ()

ปลาหมึกมีคุณสมบัติพิเศษที่จะนำศิลาจารึกหลุมศพไปยังโฮสต์ระยะไกลซึ่งเราสามารถรับพวกมันได้โดยตรง

การส่งคืน

ขว้าง
DeviceNotAvailableException

โพสต์ BootSetup

public void postBootSetup ()

{@สืบทอด }

ขว้าง
DeviceNotAvailableException

โพสต์คำร้องขอTearDown

public void postInvocationTearDown (Throwable exception)

พารามิเตอร์
exception Throwable

พาวเวอร์วอชGce

public boolean powerwashGce ()

พยายาม Powerwash อินสแตนซ์ GCE

การส่งคืน
boolean คืนค่าเป็นจริงหาก powerwash Gce สำเร็จ

ขว้าง
com.android.tradefed.targetprep.TargetSetupError
DeviceNotAvailableException
TargetSetupError

preInvocationSetup

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

พารามิเตอร์
info IBuildInfo

attributes MultiMap

ขว้าง
DeviceNotAvailableException
TargetSetupError

กู้คืนอุปกรณ์

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

รับ CurrentTime

protected long getCurrentTime ()

ส่งกลับเวลาของระบบปัจจุบัน เปิดเผยสำหรับการทดสอบ

การส่งคืน
long

getGceSshMonitor.getGceSshMonitor

protected GceSshTunnelMonitor getGceSshMonitor ()

ส่งคืน GceSshTunnelMonitor ของอุปกรณ์ เปิดเผยสำหรับการทดสอบ

การส่งคืน
GceSshTunnelMonitor

เปิดตัวGce

protected void launchGce (IBuildInfo buildInfo, 
                MultiMap<String, String> attributes)

เปิดตัวอุปกรณ์ gce จริงตามข้อมูลบิวด์

พารามิเตอร์
buildInfo IBuildInfo

attributes MultiMap

ขว้าง
TargetSetupError

waitForTunnelOnline

protected void waitForTunnelOnline (long waitTime)

ตรวจสอบว่ามอนิเตอร์ทันเนลกำลังทำงานอยู่หรือไม่

พารามิเตอร์
waitTime long

ขว้าง
DeviceNotAvailableException