NativeDeviceStateMonitor
public
class
NativeDeviceStateMonitor
extends Object
implements
IDeviceStateMonitor
| java.lang.Object | |
| ↳ | com.android.tradefed.device.NativeDeviceStateMonitor |
Clase auxiliar para supervisar el estado de un IDevice sin compatibilidad con el framework.
Resumen
Constantes | |
|---|---|
long |
MAX_CHECK_POLL_TIME
|
int |
MAX_OP_TIME
Es el tiempo máximo de operación en ms para un comando "poll for responsiveness". |
Campos | |
|---|---|
protected
static
final
String |
PERM_DENIED_ERROR_PATTERN
|
Constructores públicos | |
|---|---|
NativeDeviceStateMonitor(IDeviceManager mgr, IDevice device, boolean fastbootEnabled)
|
|
Métodos públicos | |
|---|---|
TestDeviceState
|
getDeviceState()
|
String
|
getFastbootSerialNumber()
|
String
|
getMountPoint(String mountName)
|
String
|
getSerialNumber()
|
boolean
|
isAdbTcp()
|
void
|
setDefaultAvailableTimeout(long timeoutMs)
Establece el tiempo en ms para esperar a que un dispositivo esté disponible en |
void
|
setDefaultOnlineTimeout(long timeoutMs)
Establece el tiempo en ms para esperar a que un dispositivo esté en línea en |
void
|
setFastbootSerialNumber(String serial)
Establece el número de serie del modo fastboot. |
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)
|
Métodos protegidos | |
|---|---|
CollectingOutputReceiver
|
createOutputReceiver()
Se expone para pruebas |
long
|
getCheckPollTime()
Se expone para pruebas |
long
|
getCurrentTime()
Se expone para pruebas |
IDevice
|
getIDevice()
|
boolean
|
postOnlineCheck(long waitTime)
Verificaciones adicionales que se deben realizar en un dispositivo en línea |
boolean
|
waitForStoreMount(long waitTime)
Espera a que se active el almacenamiento externo del dispositivo. |
Constantes
MAX_CHECK_POLL_TIME
protected static final long MAX_CHECK_POLL_TIME
Valor constante: 30000 (0x0000000000007530)
MAX_OP_TIME
protected static final int MAX_OP_TIME
Es el tiempo máximo de operación en ms para un comando "poll for responsiveness".
Valor constante: 10000 (0x00002710)
Campos
PERM_DENIED_ERROR_PATTERN
protected static final String PERM_DENIED_ERROR_PATTERN
Constructores públicos
NativeDeviceStateMonitor
public NativeDeviceStateMonitor (IDeviceManager mgr, IDevice device, boolean fastbootEnabled)
| Parámetros | |
|---|---|
mgr |
IDeviceManager |
device |
IDevice |
fastbootEnabled |
boolean |
Métodos públicos
getDeviceState
public TestDeviceState getDeviceState ()
| Muestra | |
|---|---|
TestDeviceState |
|
getFastbootSerialNumber
public String getFastbootSerialNumber ()
| Muestra | |
|---|---|
String |
|
getMountPoint
public String getMountPoint (String mountName)
| Parámetros | |
|---|---|
mountName |
String |
| Muestra | |
|---|---|
String |
|
getSerialNumber
public String getSerialNumber ()
| Muestra | |
|---|---|
String |
|
isAdbTcp
public boolean isAdbTcp ()
| Muestra | |
|---|---|
boolean |
|
setDefaultAvailableTimeout
public void setDefaultAvailableTimeout (long timeoutMs)
Establece el tiempo en ms para esperar a que un dispositivo esté disponible en waitForDeviceAvailable().
| Parámetros | |
|---|---|
timeoutMs |
long |
setDefaultOnlineTimeout
public void setDefaultOnlineTimeout (long timeoutMs)
Establece el tiempo en ms para esperar a que un dispositivo esté en línea en waitForDeviceOnline().
| Parámetros | |
|---|---|
timeoutMs |
long |
setFastbootSerialNumber
public void setFastbootSerialNumber (String serial)
Establece el número de serie del modo fastboot.
| Parámetros | |
|---|---|
serial |
String |
setIDevice
public void setIDevice (IDevice newDevice)
| Parámetros | |
|---|---|
newDevice |
IDevice |
setState
public void setState (TestDeviceState deviceState)
| Parámetros | |
|---|---|
deviceState |
TestDeviceState |
waitForBootComplete
public boolean waitForBootComplete (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceAvailable
public IDevice waitForDeviceAvailable (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
IDevice |
|
waitForDeviceAvailable
public IDevice waitForDeviceAvailable ()
| Muestra | |
|---|---|
IDevice |
|
waitForDeviceBootloader
public boolean waitForDeviceBootloader (long time)
| Parámetros | |
|---|---|
time |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceBootloaderStateUpdate
public void waitForDeviceBootloaderStateUpdate ()
waitForDeviceFastbootd
public boolean waitForDeviceFastbootd (String fastbootPath,
long time)
| Parámetros | |
|---|---|
fastbootPath |
String |
time |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceInRecovery
public IDevice waitForDeviceInRecovery ()
| Muestra | |
|---|---|
IDevice |
|
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
boolean |
|
waitForDeviceOnline
public IDevice waitForDeviceOnline ()
| Muestra | |
|---|---|
IDevice |
|
waitForDeviceOnline
public IDevice waitForDeviceOnline (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
IDevice |
|
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
| Parámetros | |
|---|---|
waitTime |
long |
| Muestra | |
|---|---|
boolean |
|
Métodos protegidos
createOutputReceiver
protected CollectingOutputReceiver createOutputReceiver ()
Se expone para pruebas
| Muestra | |
|---|---|
CollectingOutputReceiver |
CollectingOutputReceiver
|
getCheckPollTime
protected long getCheckPollTime ()
Se expone para pruebas
| Muestra | |
|---|---|
long |
|
getCurrentTime
protected long getCurrentTime ()
Se expone para pruebas
| Muestra | |
|---|---|
long |
|
getIDevice
protected IDevice getIDevice ()
| Muestra | |
|---|---|
IDevice |
IDevice se asocia con el monitor de estado
|
postOnlineCheck
protected boolean postOnlineCheck (long waitTime)
Verificaciones adicionales que se deben realizar en un dispositivo en línea
| Parámetros | |
|---|---|
waitTime |
long: Es el tiempo en ms que se espera antes de que se agote el tiempo de espera. |
| Muestra | |
|---|---|
boolean |
true si las verificaciones se realizan correctamente antes de que venza waitTime.
false de lo contrario
|
waitForStoreMount
protected boolean waitForStoreMount (long waitTime)
Espera a que se active el almacenamiento externo del dispositivo.
| Parámetros | |
|---|---|
waitTime |
long: Es el tiempo en ms que se espera antes de que se agote el tiempo de espera. |
| Muestra | |
|---|---|
boolean |
true si la tienda externa se activa antes de que venza waitTime.
false de lo contrario
|