Dispositivo di prova

public class TestDevice
extends NativeDevice

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


Implementazione di un ITestDevice per un dispositivo Android full stack

Riepilogo

Campi

public static final String DISMISS_KEYGUARD_CMD

Comandi che possono essere utilizzati per disattivare lo scudo 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)

Esegui un riavvio adb.

long getCheckNewUserSleep ()

Esposto per test.

long getHostCurrentTime ()

Esposto per test

void prePostBootSetup ()

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

Campi

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Comandi che possono essere utilizzati per disattivare lo scudo tastiera.

Costruttori pubblici

Dispositivo di prova

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

Metodi pubblici

clearErrorDialogs

public boolean clearErrorDialogs ()

ritorna
boolean

Lancia
DeviceNotAvailableException

creare un utente

public int createUser (String name)

Parametri
name String

ritorna
int

Lancia
DeviceNotAvailableException

creare un utente

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

Parametri
name String

guest boolean

ephemeral boolean

ritorna
int

Lancia
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parametri
name String

ritorna
int

Lancia
DeviceNotAvailableException

disabilitaKeyguard

public void disableKeyguard ()

Lancia
DeviceNotAvailableException

faFileExist

public boolean doesFileExist (String deviceFilePath)

Parametri
deviceFilePath String

ritorna
boolean

Lancia
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parametri
process String

devicePath String

ritorna
File

Lancia
DeviceNotAvailableException

getActiveApex

public  getActiveApexes ()

ritorna

Lancia
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parametri
namespace String

ritorna

Lancia
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

Parametri
userId int

ritorna
String

Lancia
DeviceNotAvailableException

getAndroidId

public  getAndroidIds ()

ritorna

Lancia
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parametri
packageName String

ritorna
PackageInfo

Lancia
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

ritorna

Lancia
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

ritorna
DeviceFoldableState

Lancia
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

ritorna
int

Lancia
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

ritorna

Lancia
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

ritorna

Lancia
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

ritorna
KeyguardControllerState

Lancia
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

ritorna

Lancia
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

ritorna
int

Lancia
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

ritorna
int

Lancia
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

ritorna
Integer

Lancia
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

ritorna
InputStreamSource

Lancia
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parametri
format String

rescale boolean

ritorna
InputStreamSource

Lancia
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format)

Parametri
format String

ritorna
InputStreamSource

Lancia
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

Parametri
displayId long

ritorna
InputStreamSource

Lancia
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parametri
namespace String

key String

ritorna
String

Lancia
DeviceNotAvailableException

getSetting

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

Parametri
userId int

namespace String

key String

ritorna
String

Lancia
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

ritorna

Lancia
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

Parametri
userId int

ritorna
int

Lancia
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

ritorna

Lancia
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parametri
userId int

ritorna
int

Lancia
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

Parametri
feature String

ritorna
boolean

Lancia
DeviceNotAvailableException

installPacchetto

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

Parametri
packageFile File

reinstall boolean

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installPacchetto

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

Parametri
packageFile File

certFile File

reinstall boolean

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installPacchetto

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

Parametri
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

Lancia
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

Lancia
DeviceNotAvailableException

installPackageForUser

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

Parametri
packageFile File

reinstall boolean

userId int

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installPackages

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

Parametri
packageFiles

reinstall boolean

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installPackages

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

Parametri
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

Lancia
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

Lancia
DeviceNotAvailableException

installPackagesForUser

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

Parametri
packageFiles

reinstall boolean

userId int

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installareRemotePackages

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

Parametri
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

installareRemotePackages

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

Parametri
remoteApkPaths

reinstall boolean

extraArgs String

ritorna
String

Lancia
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

ritorna
boolean

Lancia
DeviceNotAvailableException

è multiutente supportato

public boolean isMultiUserSupported ()

ritorna
boolean

Lancia
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parametri
packageName String

ritorna
boolean

Lancia
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parametri
packageName String

userId String

ritorna
boolean

Lancia
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

listDisplayId

public  listDisplayIds ()

ritorna

Lancia
DeviceNotAvailableException

listUsers

public  listUsers ()

ritorna

Lancia
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Parametri
exception Throwable

rimuoviAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parametri
componentName String

userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

rimuoviProprietari

public void removeOwners ()

Lancia
DeviceNotAvailableException

rimuoviUser

public boolean removeUser (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parametri
componentName String

userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

setImpostazione

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

Parametri
namespace String

key String

value String

Lancia
DeviceNotAvailableException

setImpostazione

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

Parametri
userId int

namespace String

key String

value String

Lancia
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parametri
userId int

waitFlag boolean

ritorna
boolean

Lancia
DeviceNotAvailableException

stopUser

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

Parametri
userId int

waitFlag boolean

forceFlag boolean

ritorna
boolean

Lancia
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

cambia utente

public boolean switchUser (int userId)

Parametri
userId int

ritorna
boolean

Lancia
DeviceNotAvailableException

cambia utente

public boolean switchUser (int userId, 
                long timeout)

Parametri
userId int

timeout long

ritorna
boolean

Lancia
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parametri
packageName String

ritorna
String

Lancia
DeviceNotAvailableException

disinstallarePackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parametri
packageName String

userId int

ritorna
String

Lancia
DeviceNotAvailableException

Metodi protetti

doAdbReboot

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

Esegui un riavvio adb.

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

reason String : per questo riavvio.

Lancia
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Esposto per test.

ritorna
long

getHostCurrentTime

protected long getHostCurrentTime ()

Esposto per test

ritorna
long

prePostBootSetup

protected void prePostBootSetup ()

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

Lancia
DeviceNotAvailableException