Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.
Se usó la API de Cloud Translation para traducir esta página.
Switch to English

Dispositivo de prueba

public class TestDevice
extends NativeDevice

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


Implementación de un ITestDevice para un dispositivo Android de pila completa

Resumen

Campos

public static final String DISMISS_KEYGUARD_CMD

Comandos que se pueden usar para descartar el bloqueo del teclado.

Constructores públicos

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Métodos públicos

boolean clearErrorDialogs ()

int createUser (String name)

int createUser (String name, boolean guest, boolean ephemeral)

int createUserNoThrow (String name)

void disableKeyguard ()

boolean doesFileExist (String deviceFilePath)

File dumpHeap (String process, String devicePath)

getActiveApexes ()

getAllSettings (String namespace)

String getAndroidId (int userId)

getAndroidIds ()

PackageInfo getAppPackageInfo (String packageName)

getAppPackageInfos ()

int getCurrentUser ()

getInstalledPackageNames ()

KeyguardControllerState getKeyguardState ()

int getMaxNumberOfRunningUsersSupported ()

int getMaxNumberOfUsersSupported ()

Integer getPrimaryUserId ()

InputStreamSource getScreenshot ()

InputStreamSource getScreenshot (String format, boolean rescale)

InputStreamSource getScreenshot (String format)

InputStreamSource getScreenshot (long displayId)

String getSetting (String namespace, String key)

String getSetting (int userId, String namespace, String key)

getUninstallablePackageNames ()

int getUserFlags (int userId)

getUserInfos ()

int getUserSerialNumber (int userId)

boolean hasFeature (String feature)

String installPackage (File packageFile, boolean reinstall, String... extraArgs)

String installPackage (File packageFile, File certFile, boolean reinstall, String... extraArgs)

String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)

String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)

String installPackages ( packageFiles, boolean reinstall, String... extraArgs) installPackages ( packageFiles, boolean reinstall, String... extraArgs)

String installPackages ( packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs) installPackages ( packageFiles, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installPackagesForUser ( packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs) installPackagesForUser ( packageFiles, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)

String installPackagesForUser ( packageFiles, boolean reinstall, int userId, String... extraArgs) installPackagesForUser ( packageFiles, boolean reinstall, int userId, String... extraArgs)

String installRemotePackages ( remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs) installRemotePackages ( remoteApkPaths, boolean reinstall, boolean grantPermissions, String... extraArgs)

String installRemotePackages ( remoteApkPaths, boolean reinstall, String... extraArgs) installRemotePackages ( remoteApkPaths, boolean reinstall, String... extraArgs)

boolean isAppEnumerationSupported ()

boolean isMultiUserSupported ()

boolean isPackageInstalled (String packageName)

boolean isPackageInstalled (String packageName, String userId)

boolean isUserRunning (int userId)

boolean isUserSecondary (int userId)

listDisplayIds ()

listUsers ()

void postInvocationTearDown (Throwable exception)

boolean removeAdmin (String componentName, int userId)

void removeOwners ()

boolean removeUser (int userId)

boolean setDeviceOwner (String componentName, int userId)

void setSetting (String namespace, String key, String value)

void setSetting (int userId, String namespace, String key, String value)

boolean startUser (int userId)

boolean startUser (int userId, boolean waitFlag)

boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)

boolean stopUser (int userId)

boolean switchUser (int userId)

boolean switchUser (int userId, long timeout)

String uninstallPackage (String packageName)

Métodos protegidos

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Realice un reinicio de adb.

long getCheckNewUserSleep ()

Expuesto para pruebas.

long getHostCurrentTime ()

Expuesto para pruebas

void prePostBootSetup ()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica posterior al arranque.

Campos

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Comandos que se pueden usar para descartar el bloqueo del teclado.

Constructores públicos

Dispositivo de prueba

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

Métodos públicos

clearErrorDialogs

public boolean clearErrorDialogs ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

crear usuario

public int createUser (String name)

Parámetros
name String

Devoluciones
int

Lanza
DeviceNotAvailableException

crear usuario

public int createUser (String name, 
                boolean guest, 
                boolean ephemeral)

Parámetros
name String

guest boolean

ephemeral boolean

Devoluciones
int

Lanza
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parámetros
name String

Devoluciones
int

Lanza
DeviceNotAvailableException

desactivar Keyguard

public void disableKeyguard ()

Lanza
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

Parámetros
deviceFilePath String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parámetros
process String

devicePath String

Devoluciones
File

Lanza
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Devoluciones

Lanza
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parámetros
namespace String

Devoluciones

Lanza
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

Parámetros
userId int

Devoluciones
String

Lanza
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Devoluciones

Lanza
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parámetros
packageName String

Devoluciones
PackageInfo

Lanza
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Devoluciones

Lanza
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

Devoluciones

Lanza
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Devoluciones
KeyguardControllerState

Lanza
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Devoluciones
int

Lanza
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Devoluciones
Integer

Lanza
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parámetros
format String

rescale boolean

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format)

Parámetros
format String

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

Parámetros
displayId long

Devoluciones
InputStreamSource

Lanza
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parámetros
namespace String

key String

Devoluciones
String

Lanza
DeviceNotAvailableException

getSetting

public String getSetting (int userId, 
                String namespace, 
                String key)

Parámetros
userId int

namespace String

key String

Devoluciones
String

Lanza
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Devoluciones

Lanza
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

Parámetros
userId int

Devoluciones
int

Lanza
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Devoluciones

Lanza
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parámetros
userId int

Devoluciones
int

Lanza
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

Parámetros
feature String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

paquete de instalación

public String installPackage (File packageFile, 
                boolean reinstall, 
                String... extraArgs)

Parámetros
packageFile File

reinstall boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

paquete de instalación

public String installPackage (File packageFile, 
                File certFile, 
                boolean reinstall, 
                String... extraArgs)

Parámetros
packageFile File

certFile File

reinstall boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

paquete de instalación

public String installPackage (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                String... extraArgs)

Parámetros
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackageForUser

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                boolean grantPermissions, 
                int userId, 
                String... extraArgs)

Parámetros
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackageForUser

public String installPackageForUser (File packageFile, 
                boolean reinstall, 
                int userId, 
                String... extraArgs)

Parámetros
packageFile File

reinstall boolean

userId int

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackages

public String installPackages ( packageFiles, 
                boolean reinstall, 
                String... extraArgs)

Parámetros
packageFiles

reinstall boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackages

public String installPackages ( packageFiles, 
                boolean reinstall, 
                boolean grantPermissions, 
                String... extraArgs)

Parámetros
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackagesForUser

public String installPackagesForUser ( packageFiles, 
                boolean reinstall, 
                boolean grantPermissions, 
                int userId, 
                String... extraArgs)

Parámetros
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installPackagesForUser

public String installPackagesForUser ( packageFiles, 
                boolean reinstall, 
                int userId, 
                String... extraArgs)

Parámetros
packageFiles

reinstall boolean

userId int

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installRemotePackages

public String installRemotePackages ( remoteApkPaths, 
                boolean reinstall, 
                boolean grantPermissions, 
                String... extraArgs)

Parámetros
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

installRemotePackages

public String installRemotePackages ( remoteApkPaths, 
                boolean reinstall, 
                String... extraArgs)

Parámetros
remoteApkPaths

reinstall boolean

extraArgs String

Devoluciones
String

Lanza
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parámetros
packageName String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parámetros
packageName String

userId String

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Devoluciones

Lanza
DeviceNotAvailableException

listUsers

public  listUsers ()

Devoluciones

Lanza
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Parámetros
exception Throwable

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parámetros
componentName String

userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

removeOwners

public void removeOwners ()

Lanza
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parámetros
componentName String

userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

setSetting

public void setSetting (String namespace, 
                String key, 
                String value)

Parámetros
namespace String

key String

value String

Lanza
DeviceNotAvailableException

setSetting

public void setSetting (int userId, 
                String namespace, 
                String key, 
                String value)

Parámetros
userId int

namespace String

key String

value String

Lanza
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parámetros
userId int

waitFlag boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId, 
                boolean waitFlag, 
                boolean forceFlag)

Parámetros
userId int

waitFlag boolean

forceFlag boolean

Devoluciones
boolean

Lanza
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cambiar de usuario

public boolean switchUser (int userId)

Parámetros
userId int

Devoluciones
boolean

Lanza
DeviceNotAvailableException

cambiar de usuario

public boolean switchUser (int userId, 
                long timeout)

Parámetros
userId int

timeout long

Devoluciones
boolean

Lanza
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parámetros
packageName String

Devoluciones
String

Lanza
DeviceNotAvailableException

Métodos protegidos

doAdbReboot

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

Realice un reinicio de adb.

Parámetros
rebootMode NativeDevice.RebootMode : un modo de este reinicio.

reason String : para este reinicio.

Lanza
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Expuesto para pruebas.

Devoluciones
long

getHostCurrentTime

protected long getHostCurrentTime ()

Expuesto para pruebas

Devoluciones
long

prePostBootSetup

protected void prePostBootSetup ()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) anule este método para una configuración específica posterior al arranque.

Lanza
DeviceNotAvailableException