NativeDeviceStateMonitor

public class NativeDeviceStateMonitor
extends Object implements IDeviceStateMonitor

java.lang.Object
   ↳ com.android.tradefed.device.NativeDeviceStateMonitor


Lớp trợ giúp để theo dõi trạng thái của IDevice không có khung hỗ trợ.

Tóm tắt

Hằng số

long MAX_CHECK_POLL_TIME

int MAX_OP_TIME

thời gian hoạt động tối đa tính bằng mili giây cho lệnh "poll for responsiveness" ("thăm dò khả năng phản hồi")

Trường

protected static final String PERM_DENIED_ERROR_PATTERN

Hàm khởi tạo công khai

NativeDeviceStateMonitor(IDeviceManager mgr, IDevice device, boolean fastbootEnabled)

Phương thức công khai

TestDeviceState getDeviceState()

String getFastbootSerialNumber()

String getMountPoint(String mountName)

String getSerialNumber()

boolean isAdbTcp()

void setDefaultAvailableTimeout(long timeoutMs)

Đặt thời gian tính bằng mili giây để chờ thiết bị có sẵn trong waitForDeviceAvailable().

void setDefaultOnlineTimeout(long timeoutMs)

Đặt thời gian (tính bằng mili giây) để chờ thiết bị có kết nối mạng trong waitForDeviceOnline().

void setFastbootSerialNumber(String serial)

Đặt số sê-ri của chế độ khởi động nhanh.

void setIDevice(IDevice newDevice)
void setState(TestDeviceState deviceState)

boolean waitForBootComplete(long waitTime)

IDevice waitForDeviceAvailable(long waitTime)

IDevice waitForDeviceAvailable()

boolean waitForDeviceBootloader(long time)

void waitForDeviceBootloaderStateUpdate()
boolean waitForDeviceFastbootd(String fastbootPath, long time)

IDevice waitForDeviceInRecovery()
boolean waitForDeviceInRecovery(long waitTime)

boolean waitForDeviceInSideload(long waitTime)

boolean waitForDeviceNotAvailable(long waitTime)

IDevice waitForDeviceOnline()

IDevice waitForDeviceOnline(long waitTime)

boolean waitForDeviceShell(long waitTime)

Phương thức được bảo vệ

CollectingOutputReceiver createOutputReceiver()

Được hiển thị để kiểm thử

long getCheckPollTime()

Được hiển thị để thử nghiệm

long getCurrentTime()

Được hiển thị để kiểm thử

IDevice getIDevice()
boolean postOnlineCheck(long waitTime)

Cần thực hiện các bước kiểm tra bổ sung trên thiết bị có kết nối mạng

boolean waitForStoreMount(long waitTime)

Chờ gắn bộ nhớ ngoài của thiết bị.

Hằng số

MAX_CHECK_POLL_TIME

protected static final long MAX_CHECK_POLL_TIME

Giá trị không đổi: 30000 (0x0000000000007530)

MAX_OP_TIME

protected static final int MAX_OP_TIME

thời gian hoạt động tối đa tính bằng mili giây cho lệnh "poll for responsiveness" ("thăm dò khả năng phản hồi")

Giá trị không đổi: 10000 (0x00002710)

Trường

PERM_DENIED_ERROR_ đợi

protected static final String PERM_DENIED_ERROR_PATTERN

Hàm khởi tạo công khai

NativeDeviceStateMonitor

public NativeDeviceStateMonitor (IDeviceManager mgr, 
                IDevice device, 
                boolean fastbootEnabled)

Tham số
mgr IDeviceManager

device IDevice

fastbootEnabled boolean

Phương thức công khai

nhận Trạng thái thiết bị

public TestDeviceState getDeviceState ()

Giá trị trả về
TestDeviceState

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Giá trị trả về
String

getMountPoint

public String getMountPoint (String mountName)

Tham số
mountName String

Giá trị trả về
String

getSerialNumber

public String getSerialNumber ()

Giá trị trả về
String

isAdbTcp

public boolean isAdbTcp ()

Giá trị trả về
boolean

setDefaultAvailableTimeout

public void setDefaultAvailableTimeout (long timeoutMs)

Đặt thời gian tính bằng mili giây để chờ thiết bị có sẵn trong waitForDeviceAvailable().

Tham số
timeoutMs long

setDefaultOnlineTimeout

public void setDefaultOnlineTimeout (long timeoutMs)

Đặt thời gian (tính bằng mili giây) để chờ thiết bị có kết nối mạng trong waitForDeviceOnline().

Tham số
timeoutMs long

setFastbootSerialNumber

public void setFastbootSerialNumber (String serial)

Đặt số sê-ri của chế độ khởi động nhanh.

Tham số
serial String

setIDevice

public void setIDevice (IDevice newDevice)

Tham số
newDevice IDevice

setState

public void setState (TestDeviceState deviceState)

Tham số
deviceState TestDeviceState

waitForBootComplete

public boolean waitForBootComplete (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

waitForDeviceAvailable

public IDevice waitForDeviceAvailable (long waitTime)

Tham số
waitTime long

Giá trị trả về
IDevice

waitForDeviceAvailable

public IDevice waitForDeviceAvailable ()

Giá trị trả về
IDevice

bộ lọc khởi động thiết bị

public boolean waitForDeviceBootloader (long time)

Tham số
time long

Giá trị trả về
boolean

Chờ

public void waitForDeviceBootloaderStateUpdate ()

waitForDeviceFastbootd

public boolean waitForDeviceFastbootd (String fastbootPath, 
                long time)

Tham số
fastbootPath String

time long

Giá trị trả về
boolean

waitForDeviceInRecovery

public IDevice waitForDeviceInRecovery ()

Giá trị trả về
IDevice

waitForDeviceInRecovery

public boolean waitForDeviceInRecovery (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

Chờ thiết bị không có sẵn

public boolean waitForDeviceNotAvailable (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

waitForDeviceOnline

public IDevice waitForDeviceOnline ()

Giá trị trả về
IDevice

ChờChoThiết bịTrực tuyến

public IDevice waitForDeviceOnline (long waitTime)

Tham số
waitTime long

Giá trị trả về
IDevice

waitForDeviceShell

public boolean waitForDeviceShell (long waitTime)

Tham số
waitTime long

Giá trị trả về
boolean

Phương thức được bảo vệ

createOutputReceiver

protected CollectingOutputReceiver createOutputReceiver ()

Được hiển thị để thử nghiệm

Giá trị trả về
CollectingOutputReceiver CollectingOutputReceiver

getCheckPollTime

protected long getCheckPollTime ()

Được hiển thị để kiểm thử

Giá trị trả về
long

getCurrentTime

protected long getCurrentTime ()

Được hiển thị để kiểm thử

Giá trị trả về
long

getIDevice

protected IDevice getIDevice ()

Giá trị trả về
IDevice IDevice liên kết với trình theo dõi trạng thái

đăng trực tuyến

protected boolean postOnlineCheck (long waitTime)

Các bước kiểm tra bổ sung cần thực hiện trên Thiết bị trực tuyến

Tham số
waitTime long: thời gian chờ tính bằng mili giây trước khi bỏ cuộc

Giá trị trả về
boolean true nếu các lần kiểm tra thành công trước khi waitTime hết hạn. Nếu không thì false

waitForStoreMount

protected boolean waitForStoreMount (long waitTime)

Chờ gắn bộ nhớ ngoài của thiết bị.

Tham số
waitTime long: thời gian chờ tính bằng mili giây trước khi bỏ cuộc

Giá trị trả về
boolean true nếu bộ nhớ ngoài được gắn trước khi waitTime hết hạn. false nếu không