Dispositivo di prova

public class TestDevice
extends NativeDevice

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


Attuazione di un ITestDevice per un dispositivo android stack completo

Riepilogo

Campi

public static final String DISMISS_KEYGUARD_CMD

Comandi che possono essere usati per chiudere il blocco tastiera.

Costruttori pubblici

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Metodi pubblici

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 ()

DeviceFoldableState getCurrentFoldableState ()
int getCurrentUser ()

getFoldableStates ()
getInstalledPackageNames ()

KeyguardControllerState getKeyguardState ()

getMainlineModuleInfo ()

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)

String uninstallPackageForUser (String packageName, int userId)

Metodi protetti

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Eseguire un riavvio adb.

long getCheckNewUserSleep ()

Esposto per test.

long getHostCurrentTime ()

Esposto per il test

void prePostBootSetup ()

Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di sovrascrivere questo metodo per una configurazione post-avvio specifica.

Campi

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Comandi che possono essere usati per chiudere il blocco tastiera.

Costruttori pubblici

Dispositivo di prova

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

Metodi pubblici

clearErrorDialogs

public boolean clearErrorDialogs ()

ritorna
boolean

tiri
DeviceNotAvailableException

creare un utente

public int createUser (String name)

Parametri
name String

ritorna
int

tiri
DeviceNotAvailableException

creare un utente

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

Parametri
name String

guest boolean

ephemeral boolean

ritorna
int

tiri
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parametri
name String

ritorna
int

tiri
DeviceNotAvailableException

disabilita il blocco tastiera

public void disableKeyguard ()

tiri
DeviceNotAvailableException

il file esiste?

public boolean doesFileExist (String deviceFilePath)

Parametri
deviceFilePath String

ritorna
boolean

tiri
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parametri
process String

devicePath String

ritorna
File

tiri
DeviceNotAvailableException

getActiveApex

public  getActiveApexes ()

ritorna

tiri
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parametri
namespace String

ritorna

tiri
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

Parametri
userId int

ritorna
String

tiri
DeviceNotAvailableException

ottieni ID Android

public  getAndroidIds ()

ritorna

tiri
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parametri
packageName String

ritorna
PackageInfo

tiri
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

ritorna

tiri
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

ritorna
DeviceFoldableState

tiri
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

ritorna
int

tiri
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

ritorna

tiri
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

ritorna

tiri
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

ritorna
KeyguardControllerState

tiri
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

ritorna

tiri
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

ritorna
int

tiri
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

ritorna
int

tiri
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

ritorna
Integer

tiri
DeviceNotAvailableException

ottieni Screenshot

public InputStreamSource getScreenshot ()

ritorna
InputStreamSource

tiri
DeviceNotAvailableException

ottieni Screenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parametri
format String

rescale boolean

ritorna
InputStreamSource

tiri
DeviceNotAvailableException

ottieni Screenshot

public InputStreamSource getScreenshot (String format)

Parametri
format String

ritorna
InputStreamSource

tiri
DeviceNotAvailableException

ottieni Screenshot

public InputStreamSource getScreenshot (long displayId)

Parametri
displayId long

ritorna
InputStreamSource

tiri
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parametri
namespace String

key String

ritorna
String

tiri
DeviceNotAvailableException

getSetting

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

Parametri
userId int

namespace String

key String

ritorna
String

tiri
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

ritorna

tiri
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

Parametri
userId int

ritorna
int

tiri
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

ritorna

tiri
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parametri
userId int

ritorna
int

tiri
DeviceNotAvailableException

haCaratteristica

public boolean hasFeature (String feature)

Parametri
feature String

ritorna
boolean

tiri
DeviceNotAvailableException

pacchetto di installazione

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

Parametri
packageFile File

reinstall boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

pacchetto di installazione

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

Parametri
packageFile File

certFile File

reinstall boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

pacchetto di installazione

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

Parametri
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installPackageForUser

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

Parametri
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installPackageForUser

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

Parametri
packageFile File

reinstall boolean

userId int

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

Pacchetti di installazione

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

Parametri
packageFiles

reinstall boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

pacchetti di installazione

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

Parametri
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installPackagesForUser

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

Parametri
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installPackagesForUser

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

Parametri
packageFiles

reinstall boolean

userId int

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installRemotePackages

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

Parametri
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

installRemotePackages

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

Parametri
remoteApkPaths

reinstall boolean

extraArgs String

ritorna
String

tiri
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

ritorna
boolean

tiri
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

ritorna
boolean

tiri
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parametri
packageName String

ritorna
boolean

tiri
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parametri
packageName String

userId String

ritorna
boolean

tiri
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

ritorna

tiri
DeviceNotAvailableException

listUsers

public  listUsers ()

ritorna

tiri
DeviceNotAvailableException

postInvocazioneTearDown

public void postInvocationTearDown (Throwable exception)

Parametri
exception Throwable

rimuovereAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parametri
componentName String

userId int

ritorna
boolean

tiri
DeviceNotAvailableException

rimuovere i proprietari

public void removeOwners ()

tiri
DeviceNotAvailableException

rimuoviUtente

public boolean removeUser (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parametri
componentName String

userId int

ritorna
boolean

tiri
DeviceNotAvailableException

setImpostazione

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

Parametri
namespace String

key String

value String

tiri
DeviceNotAvailableException

setImpostazione

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

Parametri
userId int

namespace String

key String

value String

tiri
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parametri
userId int

waitFlag boolean

ritorna
boolean

tiri
DeviceNotAvailableException

stopUser

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

Parametri
userId int

waitFlag boolean

forceFlag boolean

ritorna
boolean

tiri
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

cambia utente

public boolean switchUser (int userId)

Parametri
userId int

ritorna
boolean

tiri
DeviceNotAvailableException

cambia utente

public boolean switchUser (int userId, 
                long timeout)

Parametri
userId int

timeout long

ritorna
boolean

tiri
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parametri
packageName String

ritorna
String

tiri
DeviceNotAvailableException

uninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parametri
packageName String

userId int

ritorna
String

tiri
DeviceNotAvailableException

Metodi protetti

doAdbReboot

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

Eseguire un riavvio adb.

Parametri
rebootMode NativeDevice.RebootMode : una modalità di questo riavvio.

reason String : per questo riavvio.

tiri
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Esposto per test.

ritorna
long

getHostCurrentTime

protected long getHostCurrentTime ()

Esposto per il test

ritorna
long

prePostBootSetup

protected void prePostBootSetup ()

Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di sovrascrivere questo metodo per una configurazione post-avvio specifica.

tiri
DeviceNotAvailableException