Testgerät

public class TestDevice
extends NativeDevice

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


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 Bauträger

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

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

Geschützte Methoden

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Führen Sie einen ADB-Neustart durch.

long getCheckNewUserSleep ()

Zum Testen ausgesetzt.

long getHostCurrentTime ()

Zum Testen ausgesetzt

void prePostBootSetup ()

Ermöglicht jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für bestimmte Post-Boot-Setups zu überschreiben.

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

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

createUser

public int createUser (String name)

Parameter
name String

Kehrt zurück
int

Würfe
DeviceNotAvailableException

createUser

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

Parameter
name String

guest boolean

ephemeral boolean

Kehrt zurück
int

Würfe
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parameter
name String

Kehrt zurück
int

Würfe
DeviceNotAvailableException

deaktivierenKeyguard

public void disableKeyguard ()

Würfe
DeviceNotAvailableException

DoesFileExist

public boolean doesFileExist (String deviceFilePath)

Parameter
deviceFilePath String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parameter
process String

devicePath String

Kehrt zurück
File

Würfe
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parameter
namespace String

Kehrt zurück

Würfe
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

Parameter
userId int

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parameter
packageName String

Kehrt zurück
PackageInfo

Würfe
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Kehrt zurück
DeviceFoldableState

Würfe
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Kehrt zurück
int

Würfe
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Kehrt zurück
KeyguardControllerState

Würfe
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Kehrt zurück
int

Würfe
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Kehrt zurück
int

Würfe
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Kehrt zurück
Integer

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)

Parameter
format String

Kehrt zurück
InputStreamSource

Würfe
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

Parameter
displayId long

Kehrt zurück
InputStreamSource

Würfe
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parameter
namespace String

key String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getSetting

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

Parameter
userId int

namespace String

key String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

Parameter
userId int

Kehrt zurück
int

Würfe
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Kehrt zurück

Würfe
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parameter
userId int

Kehrt zurück
int

Würfe
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

Parameter
feature String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

Installationspaket

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

Parameter
packageFile File

reinstall boolean

extraArgs String

Kehrt zurück
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

Kehrt zurück
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

Kehrt zurück
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

Kehrt zurück
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

Kehrt zurück
String

Würfe
DeviceNotAvailableException

installPackages

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

Parameter
packageFiles

reinstall boolean

extraArgs String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

installPackages

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

Parameter
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

Kehrt zurück
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

Kehrt zurück
String

Würfe
DeviceNotAvailableException

installPackagesForUser

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

Parameter
packageFiles

reinstall boolean

userId int

extraArgs String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

installRemotePackages

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

Parameter
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

installRemotePackages

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

Parameter
remoteApkPaths

reinstall boolean

extraArgs String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parameter
packageName String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parameter
packageName String

userId String

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Kehrt zurück

Würfe
DeviceNotAvailableException

listUsers

public  listUsers ()

Kehrt zurück

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

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

RemoveOwners

public void removeOwners ()

Würfe
DeviceNotAvailableException

RemoveUser

public boolean removeUser (int userId)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parameter
componentName String

userId int

Kehrt zurück
boolean

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)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parameter
userId int

waitFlag boolean

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

stopUser

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

Parameter
userId int

waitFlag boolean

forceFlag boolean

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

Benutzer wechseln

public boolean switchUser (int userId)

Parameter
userId int

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

Benutzer wechseln

public boolean switchUser (int userId, 
                long timeout)

Parameter
userId int

timeout long

Kehrt zurück
boolean

Würfe
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parameter
packageName String

Kehrt zurück
String

Würfe
DeviceNotAvailableException

uninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parameter
packageName String

userId int

Kehrt zurück
String

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.

Kehrt zurück
long

getHostCurrentTime

protected long getHostCurrentTime ()

Zum Testen ausgesetzt

Kehrt zurück
long

prePostBootSetup

protected void prePostBootSetup ()

Ermöglicht jedem Gerätetyp (AndroidNativeDevice, TestDevice), diese Methode für bestimmte Post-Boot-Setups zu überschreiben.

Würfe
DeviceNotAvailableException