Testgerät
public class TestDevice
extends NativeDevice
Bekannte direkte Unterklassen ManagedRemoteDevice | Ein Gerät, das in einer virtuellen Maschine läuft, die wir remote über eine Tradefed-Instanz innerhalb der VM verwalten. | NestedRemoteDevice | Darstellung des Geräts, das in einer Remote-Cuttlefish-VM ausgeführt wird. | RemoteAndroidDevice | Implementierung eines ITestDevice für ein Full-Stack-Android-Gerät, das über adb connect verbunden ist. |
|
Bekannte indirekte Unterklassen |
Implementierung eines ITestDevice
für ein Full-Stack-Android-Gerät
Zusammenfassung
Felder |
---|
public static final String | DISMISS_KEYGUARD_CMD Befehle, die zum Aufheben des Keyguards verwendet werden können. |
Öffentliche Methoden |
---|
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) |
Felder
DISMISS_KEYGUARD_CMD
public static final String DISMISS_KEYGUARD_CMD
Befehle, die zum Aufheben des Keyguards verwendet werden können.
Öffentliche Bauträger
Testgerät
public TestDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Öffentliche Methoden
clearErrorDialogs
public boolean clearErrorDialogs ()
Würfe |
---|
DeviceNotAvailableException | |
createUser
public int createUser (String name)
Würfe |
---|
DeviceNotAvailableException | |
createUser
public int createUser (String name,
boolean guest,
boolean ephemeral)
Parameter |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Würfe |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Würfe |
---|
DeviceNotAvailableException | |
deaktivierenKeyguard
public void disableKeyguard ()
Würfe |
---|
DeviceNotAvailableException | |
DoesFileExist
public boolean doesFileExist (String deviceFilePath)
Parameter |
---|
deviceFilePath | String |
Würfe |
---|
DeviceNotAvailableException | |
dumpHeap
public File dumpHeap (String process,
String devicePath)
Parameter |
---|
process | String |
devicePath | String |
Würfe |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Würfe |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Parameter |
---|
namespace | String |
Würfe |
---|
DeviceNotAvailableException | |
getAndroidId
public String getAndroidId (int userId)
Würfe |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
Würfe |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parameter |
---|
packageName | String |
Würfe |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Würfe |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Kehrt zurück |
---|
DeviceFoldableState | |
Würfe |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Würfe |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Würfe |
---|
DeviceNotAvailableException | |
getInstalledPackageNames
public getInstalledPackageNames ()
Würfe |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Kehrt zurück |
---|
KeyguardControllerState | |
Würfe |
---|
DeviceNotAvailableException | |
getMainlineModuleInfo
public getMainlineModuleInfo ()
Würfe |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Würfe |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Würfe |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Würfe |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
Kehrt zurück |
---|
InputStreamSource | |
Würfe |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Parameter |
---|
format | String |
rescale | boolean |
Kehrt zurück |
---|
InputStreamSource | |
Würfe |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format)
Kehrt zurück |
---|
InputStreamSource | |
Würfe |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Kehrt zurück |
---|
InputStreamSource | |
Würfe |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Parameter |
---|
namespace | String |
key | String |
Würfe |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (int userId,
String namespace,
String key)
Parameter |
---|
userId | int |
namespace | String |
key | String |
Würfe |
---|
DeviceNotAvailableException | |
getUninstallablePackageNames
public getUninstallablePackageNames ()
Würfe |
---|
DeviceNotAvailableException | |
getUserFlags
public int getUserFlags (int userId)
Würfe |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Würfe |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Würfe |
---|
DeviceNotAvailableException | |
hasFeature
public boolean hasFeature (String feature)
Würfe |
---|
DeviceNotAvailableException | |
Installationspaket
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
Installationspaket
public String installPackage (File packageFile,
File certFile,
boolean reinstall,
String... extraArgs)
Parameter |
---|
packageFile | File |
certFile | File |
reinstall | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
Installationspaket
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Parameter |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
String... extraArgs)
Parameter |
---|
packageFiles | |
reinstall | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackages
public String installPackages ( packageFiles,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parameter |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackagesForUser
public String installPackagesForUser ( packageFiles,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Parameter |
---|
packageFiles | |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installPackagesForUser
public String installPackagesForUser ( packageFiles,
boolean reinstall,
int userId,
String... extraArgs)
Parameter |
---|
packageFiles | |
reinstall | boolean |
userId | int |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Parameter |
---|
remoteApkPaths | |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
installRemotePackages
public String installRemotePackages ( remoteApkPaths,
boolean reinstall,
String... extraArgs)
Parameter |
---|
remoteApkPaths | |
reinstall | boolean |
extraArgs | String |
Würfe |
---|
DeviceNotAvailableException | |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Würfe |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Würfe |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Parameter |
---|
packageName | String |
Würfe |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Parameter |
---|
packageName | String |
userId | String |
Würfe |
---|
DeviceNotAvailableException | |
isUserRunning
public boolean isUserRunning (int userId)
Würfe |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Würfe |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Würfe |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Würfe |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Parameter |
---|
exception | Throwable |
RemoveAdmin
public boolean removeAdmin (String componentName,
int userId)
Parameter |
---|
componentName | String |
userId | int |
Würfe |
---|
DeviceNotAvailableException | |
RemoveOwners
public void removeOwners ()
Würfe |
---|
DeviceNotAvailableException | |
RemoveUser
public boolean removeUser (int userId)
Würfe |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Parameter |
---|
componentName | String |
userId | int |
Würfe |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (String namespace,
String key,
String value)
Parameter |
---|
namespace | String |
key | String |
value | String |
Würfe |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
Parameter |
---|
userId | int |
namespace | String |
key | String |
value | String |
Würfe |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId)
Würfe |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Parameter |
---|
userId | int |
waitFlag | boolean |
Würfe |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Parameter |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Würfe |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId)
Würfe |
---|
DeviceNotAvailableException | |
Benutzer wechseln
public boolean switchUser (int userId)
Würfe |
---|
DeviceNotAvailableException | |
Benutzer wechseln
public boolean switchUser (int userId,
long timeout)
Parameter |
---|
userId | int |
timeout | long |
Würfe |
---|
DeviceNotAvailableException | |
uninstallPackage
public String uninstallPackage (String packageName)
Parameter |
---|
packageName | String |
Würfe |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Parameter |
---|
packageName | String |
userId | int |
Würfe |
---|
DeviceNotAvailableException | |
Geschützte Methoden
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Führen Sie einen ADB-Neustart durch.
Parameter |
---|
rebootMode | NativeDevice.RebootMode : ein Modus dieses Neustarts. |
reason | String : für diesen Neustart. |
Würfe |
---|
DeviceNotAvailableException | |
getCheckNewUserSleep
protected long getCheckNewUserSleep ()
Zum Testen ausgesetzt.
getHostCurrentTime
protected long getHostCurrentTime ()
Zum Testen ausgesetzt
prePostBootSetup
protected void prePostBootSetup ()
Ermöglicht jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für bestimmte Post-Boot-Setups zu überschreiben.
Würfe |
---|
DeviceNotAvailableException | |