RemoteAndroidDevice

public class RemoteAndroidDevice
extends TestDevice

java.lang.Object
   ↳ com.android.tradefed.device.NativeDevice
     ↳ com.android.tradefed.device.TestDevice
       ↳ com.android.tradefed.device.RemoteAndroidDevice


การติดตั้งใช้งาน ITestDevice สําหรับอุปกรณ์ Android แบบสแต็กเต็มรูปแบบที่เชื่อมต่อผ่าน adb connect สมมติว่าซีเรียลของอุปกรณ์จะอยู่ในรูปแบบ : ใน 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 จริงหากรูปแบบถูกต้อง หรือเป็นเท็จหากไม่ถูกต้อง

connectToWifiNetwork

public boolean connectToWifiNetwork ( wifiSsidToPsk, 
                boolean scanSsid)

เชื่อมต่อกับเครือข่าย Wi-Fi

เปิด Wi-Fi และบล็อกจนกว่าจะเชื่อมต่อกับเครือข่าย Wi-Fi รายการใดรายการหนึ่งที่อยู่ในแผนที่ wifiSsidToPsk สำเร็จ เมื่อเชื่อมต่อแล้ว อินสแตนซ์จะพยายามคืนค่าการเชื่อมต่อหลังจากการรีบูตทุกครั้งจนกว่าจะมีการเรียก ITestDevice.disconnectFromWifi() หรือ ITestDevice.clearLastConnectedWifiNetwork()

พารามิเตอร์
wifiSsidToPsk : แผนที่ SSID ของ Wi-Fi กับรหัสผ่าน

scanSsid boolean: กำหนดว่าจะสแกนหา SSID ที่ซ่อนอยู่ของเครือข่ายนี้หรือไม่

คิกรีเทิร์น
boolean true หากเชื่อมต่อเครือข่าย Wi-Fi สำเร็จ false otherwise

โยน
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor (boolean shortDescriptor)

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

พารามิเตอร์
shortDescriptor boolean: กำหนดให้คำอธิบายมีข้อมูลขั้นต่ำเท่านั้นหรือไม่

คิกรีเทิร์น
DeviceDescriptor

getMacAddress

public String getMacAddress ()

แสดงผลที่อยู่ MAC ของอุปกรณ์ หรือแสดงผลเป็น Null หากค้นหาจากอุปกรณ์ไม่สำเร็จ

คิกรีเทิร์น
String

isEncryptionSupported

public boolean isEncryptionSupported ()

แสดงผลหากอุปกรณ์รองรับการเข้ารหัส

คิกรีเทิร์น
boolean true หากอุปกรณ์รองรับการเข้ารหัส