Dispositivo di prova
public class TestDevice
extends NativeDevice
Sottoclassi dirette conosciute |
Sottoclassi indirette conosciute |
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. |
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) |
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 ()
Lancia |
---|
DeviceNotAvailableException | |
creare un utente
public int createUser (String name)
Lancia |
---|
DeviceNotAvailableException | |
creare un utente
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parametri |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Lancia |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Lancia |
---|
DeviceNotAvailableException | |
disabilitaKeyguard
public void disableKeyguard ()
Lancia |
---|
DeviceNotAvailableException | |
faFileExist
public boolean doesFileExist (String deviceFilePath)
Parametri |
---|
deviceFilePath | String |
Lancia |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Parametri |
---|
process | String |
devicePath | String |
Lancia |
---|
DeviceNotAvailableException | |
getActiveApex
public getActiveApexes ()
Lancia |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Parametri |
---|
namespace | String |
Lancia |
---|
DeviceNotAvailableException | |
getAndroidId
public String getAndroidId (int userId)
Lancia |
---|
DeviceNotAvailableException | |
getAndroidId
public getAndroidIds ()
Lancia |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parametri |
---|
packageName | String |
Lancia |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Lancia |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
ritorna |
---|
DeviceFoldableState | |
Lancia |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Lancia |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Lancia |
---|
DeviceNotAvailableException | |
getInstalledPackageNames
public getInstalledPackageNames ()
Lancia |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
ritorna |
---|
KeyguardControllerState | |
Lancia |
---|
DeviceNotAvailableException | |
getMainlineModuleInfo
public getMainlineModuleInfo ()
Lancia |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Lancia |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Lancia |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
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)
ritorna |
---|
InputStreamSource | |
Lancia |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
ritorna |
---|
InputStreamSource | |
Lancia |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Parametri |
---|
namespace | String |
key | String |
Lancia |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (int userId,
String namespace,
String key)
Parametri |
---|
userId | int |
namespace | String |
key | String |
Lancia |
---|
DeviceNotAvailableException | |
getUninstallablePackageNames
public getUninstallablePackageNames ()
Lancia |
---|
DeviceNotAvailableException | |
getUserFlags
public int getUserFlags (int userId)
Lancia |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Lancia |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Lancia |
---|
DeviceNotAvailableException | |
hasFeature
public boolean hasFeature (String feature)
Lancia |
---|
DeviceNotAvailableException | |
installPacchetto
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installPacchetto
public String installPackage (File packageFile,
File certFile,
boolean reinstall,
String... extraArgs)
Parametri |
---|
packageFile | File |
certFile | File |
reinstall | boolean |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installPacchetto
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | 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 |
Lancia |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parametri |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
String... extraArgs)
Parametri |
---|
packageFiles | |
reinstall | boolean |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parametri |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | 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 |
Lancia |
---|
DeviceNotAvailableException | |
installPackagesForUser
public String installPackagesForUser ( packageFiles,
boolean reinstall,
int userId,
String... extraArgs)
Parametri |
---|
packageFiles | |
reinstall | boolean |
userId | int |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installareRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parametri |
---|
remoteApkPaths | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
installareRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
String... extraArgs)
Parametri |
---|
remoteApkPaths | |
reinstall | boolean |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Lancia |
---|
DeviceNotAvailableException | |
è multiutente supportato
public boolean isMultiUserSupported ()
Lancia |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parametri |
---|
packageName | String |
Lancia |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parametri |
---|
packageName | String |
userId | String |
Lancia |
---|
DeviceNotAvailableException | |
isUserRunning
public boolean isUserRunning (int userId)
Lancia |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Lancia |
---|
DeviceNotAvailableException | |
listDisplayId
public listDisplayIds ()
Lancia |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Lancia |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parametri |
---|
exception | Throwable |
rimuoviAdmin
public boolean removeAdmin (String componentName,
int userId)
Parametri |
---|
componentName | String |
userId | int |
Lancia |
---|
DeviceNotAvailableException | |
rimuoviProprietari
public void removeOwners ()
Lancia |
---|
DeviceNotAvailableException | |
rimuoviUser
public boolean removeUser (int userId)
Lancia |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Parametri |
---|
componentName | String |
userId | int |
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)
Lancia |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Parametri |
---|
userId | int |
waitFlag | boolean |
Lancia |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parametri |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Lancia |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId)
Lancia |
---|
DeviceNotAvailableException | |
cambia utente
public boolean switchUser (int userId)
Lancia |
---|
DeviceNotAvailableException | |
cambia utente
public boolean switchUser (int userId,
long timeout)
Parametri |
---|
userId | int |
timeout | long |
Lancia |
---|
DeviceNotAvailableException | |
uninstallPackage
public String uninstallPackage (String packageName)
Parametri |
---|
packageName | String |
Lancia |
---|
DeviceNotAvailableException | |
disinstallarePackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parametri |
---|
packageName | String |
userId | int |
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.
getHostCurrentTime
protected long getHostCurrentTime ()
Esposto per test
prePostBootSetup
protected void prePostBootSetup ()
Consente a ciascun tipo di dispositivo (AndroidNativeDevice, TestDevice) di sovrascrivere questo metodo per una specifica configurazione post-avvio.
Lancia |
---|
DeviceNotAvailableException | |