RemoteAndroid VirtualDevice

public class RemoteAndroidVirtualDevice
extends RemoteAndroidDevice

java.lang.Object
com.android.tradefed.device.NativeDevice
com.android.tradefed.device.TestDevice
com.android.tradefed.device.RemoteAndroidDevice
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 ระยะไกลที่สร้างขึ้น

GceAvdInfo getAvdInfoAnyState ()

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

DeviceDescriptor getDeviceDescriptor ()

ส่งกลับ DeviceDescriptor จากข้อมูลอุปกรณ์เพื่อรับข้อมูลโดยไม่ต้องผ่านวัตถุอุปกรณ์จริง

GceSshTunnelMonitor getGceSshMonitor ()

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

getTombstones ()

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

void postBootSetup ()

{@สืบทอด }

void postInvocationTearDown (Throwable exception)

ขั้นตอนเพิ่มเติมสำหรับการล้างข้อมูลที่จำเป็นเฉพาะอุปกรณ์ซึ่งจะดำเนินการหลังจากการเรียกใช้เสร็จสิ้น

CommandResult powerwash ()

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

CommandResult powerwashGce (String user, Integer offset)

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

boolean powerwashGce ()

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

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

ขั้นตอนเพิ่มเติมสำหรับการตั้งค่าที่จำเป็นเฉพาะอุปกรณ์ซึ่งจะดำเนินการบนอุปกรณ์ก่อนขั้นตอนการเรียกใช้

boolean recoverDevice ()

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

void setAvdInfo ( GceAvdInfo gceAvdInfo)

ตั้งค่า GceAvdInfo สำหรับอุปกรณ์ที่เปิดใช้งาน

void setGceSshMonitor ( GceSshTunnelMonitor gceSshMonitor)

แทนที่ GceSshTunnelMonitor ภายในของอุปกรณ์

วิธีการป้องกัน

void addExtraConnectionBuilderArgs ( DefaultConnection.ConnectionBuilder builder)
void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

ทำการรีบูต adb

long getCurrentTime ()

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

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

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

void postAdbReboot ()

การดำเนินการเพิ่มเติมที่เป็นไปได้ซึ่งสามารถทำได้หลังจากรีบูต

void waitForTunnelOnline (long waitTime)

ตรวจสอบว่าจอภาพอุโมงค์ทำงานอยู่หรือไม่

ผู้สร้างสาธารณะ

RemoteAndroid VirtualDevice

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

สร้าง RemoteAndroidVirtualDevice

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

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

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

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

รับ AVdInfo

public GceAvdInfo getAvdInfo ()

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

ส่งคืน
GceAvdInfo

getAvdInfoAnyState

public GceAvdInfo getAvdInfoAnyState ()

ส่งคืน GceAvdInfo จาก VM ระยะไกลที่สร้างขึ้น ส่งคืนโดยไม่คำนึงถึงสถานะเพื่อให้เราสามารถตรวจสอบข้อมูลได้

ส่งคืน
GceAvdInfo

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

ส่งกลับ DeviceDescriptor จากข้อมูลอุปกรณ์เพื่อรับข้อมูลโดยไม่ต้องผ่านวัตถุอุปกรณ์จริง

ส่งคืน
DeviceDescriptor

getGceSshMonitor

public GceSshTunnelMonitor getGceSshMonitor ()

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

ส่งคืน
GceSshTunnelMonitor

รับ Tombstones

public  getTombstones ()

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

ส่งคืน
รายการไฟล์หลุมฝังศพ ว่างเปล่าหากไม่มีหินหลุมฝังศพ

พ่น
DeviceNotAvailableException

postBootSetup

public void postBootSetup ()

{@สืบทอด }

พ่น
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

ขั้นตอนเพิ่มเติมสำหรับการล้างข้อมูลที่จำเป็นเฉพาะอุปกรณ์ซึ่งจะดำเนินการหลังจากการเรียกใช้เสร็จสิ้น

พารามิเตอร์
exception Throwable : ถ้ามี ข้อยกเว้นขั้นสุดท้ายที่เกิดจากการเรียกใช้ล้มเหลว

พาวเวอร์วอช

public CommandResult powerwash ()

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

ส่งคืน
CommandResult ส่งคืน CommandResult ของความพยายาม Powerwash

พ่น
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

powerwashGce

public CommandResult powerwashGce (String user, 
                Integer offset)

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

พารามิเตอร์
user String : โฮสต์ที่เรียกใช้ผู้ใช้ AVD, null หากไม่เกี่ยวข้อง

offset Integer : จำนวนอุปกรณ์ออฟเซ็ตของ AVD ในโฮสต์ null หากไม่เกี่ยวข้อง

ส่งคืน
CommandResult ส่งคืน CommandResult ของความพยายาม Powerwash

พ่น
com.android.tradefed.targetprep.TargetSetupError
TargetSetupError

powerwashGce

public boolean powerwashGce ()

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

ส่งคืน
boolean ส่งคืน CommandResult ของความพยายาม Powerwash

พ่น
TargetSetupError

preInvocationSetup

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

ขั้นตอนเพิ่มเติมสำหรับการตั้งค่าที่จำเป็นเฉพาะอุปกรณ์ซึ่งจะดำเนินการบนอุปกรณ์ก่อนขั้นตอนการเรียกใช้

พารามิเตอร์
info IBuildInfo : IBuildInfo ของอุปกรณ์

attributes MultiMap : แอตทริบิวต์ที่จัดเก็บไว้ในบริบทการร้องขอ

พ่น
DeviceNotAvailableException
TargetSetupError

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

public boolean recoverDevice ()

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

ส่งคืน
boolean True หากพยายามกู้คืนและสำเร็จ คืนค่า False หากข้ามการกู้คืน

พ่น
DeviceNotAvailableException

setAvdInfo

public void setAvdInfo (GceAvdInfo gceAvdInfo)

ตั้งค่า GceAvdInfo สำหรับอุปกรณ์ที่เปิดใช้งาน

พารามิเตอร์
gceAvdInfo GceAvdInfo

พ่น
TargetSetupError

setGceSshMonitor

public void setGceSshMonitor (GceSshTunnelMonitor gceSshMonitor)

แทนที่ GceSshTunnelMonitor ภายในของอุปกรณ์

พารามิเตอร์
gceSshMonitor GceSshTunnelMonitor

วิธีการป้องกัน

เพิ่มExtraConnectionBuilderArgs

protected void addExtraConnectionBuilderArgs (DefaultConnection.ConnectionBuilder builder)

พารามิเตอร์
builder DefaultConnection.ConnectionBuilder

doAdbReboot

protected void doAdbReboot (NativeDevice.RebootMode rebootMode, 
                String reason)

ทำการรีบูต adb

พารามิเตอร์
rebootMode NativeDevice.RebootMode : โหมดของการรีบูตนี้

reason String : สำหรับการรีบูตครั้งนี้

พ่น
DeviceNotAvailableException

รับเวลาปัจจุบัน

protected long getCurrentTime ()

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

ส่งคืน
long

เปิดตัว Gce

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

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

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

attributes MultiMap

พ่น
TargetSetupError

โพสต์ AdbReboot

protected void postAdbReboot ()

การดำเนินการเพิ่มเติมที่เป็นไปได้ซึ่งสามารถทำได้หลังจากรีบูต

พ่น
DeviceNotAvailableException

waitForTunnelOnline

protected void waitForTunnelOnline (long waitTime)

ตรวจสอบว่าจอภาพอุโมงค์ทำงานอยู่หรือไม่

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

พ่น
DeviceNotAvailableException