Urządzenie testowe

public class TestDevice
extends NativeDevice

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


Wdrożenie ITestDevice dla pełnowymiarowego urządzenia z systemem Android

Streszczenie

Pola

public static final String DISMISS_KEYGUARD_CMD

Polecenia, których można użyć do zwolnienia blokady klawiatury.

Konstruktorzy publiczni

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Metody publiczne

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)

Metody chronione

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Wykonaj ponowne uruchomienie adb.

long getCheckNewUserSleep ()

Wystawiony do testów.

long getHostCurrentTime ()

Wystawiony do testów

void prePostBootSetup ()

Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po uruchomieniu.

Pola

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Polecenia, których można użyć do zwolnienia blokady klawiatury.

Konstruktorzy publiczni

Urządzenie testowe

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

Metody publiczne

wyczyśćErrorDialogs

public boolean clearErrorDialogs ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Stwórz użytkownika

public int createUser (String name)

Parametry
name String

Zwroty
int

Rzuty
DeviceNotAvailableException

Stwórz użytkownika

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

Parametry
name String

guest boolean

ephemeral boolean

Zwroty
int

Rzuty
DeviceNotAvailableException

utwórzUżytkownikaNieRzucaj

public int createUserNoThrow (String name)

Parametry
name String

Zwroty
int

Rzuty
DeviceNotAvailableException

wyłącz ochronę klawiatury

public void disableKeyguard ()

Rzuty
DeviceNotAvailableException

czyFileExist

public boolean doesFileExist (String deviceFilePath)

Parametry
deviceFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parametry
process String

devicePath String

Zwroty
File

Rzuty
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Zwroty

Rzuty
DeviceNotAvailableException

pobierz wszystkie ustawienia

public  getAllSettings (String namespace)

Parametry
namespace String

Zwroty

Rzuty
DeviceNotAvailableException

pobierz identyfikator Androida

public String getAndroidId (int userId)

Parametry
userId int

Zwroty
String

Rzuty
DeviceNotAvailableException

pobierz identyfikatory Androida

public  getAndroidIds ()

Zwroty

Rzuty
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parametry
packageName String

Zwroty
PackageInfo

Rzuty
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Zwroty

Rzuty
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Zwroty
DeviceFoldableState

Rzuty
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Zwroty

Rzuty
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

Zwroty

Rzuty
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Zwroty
KeyguardControllerState

Rzuty
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Zwroty

Rzuty
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Zwroty
int

Rzuty
DeviceNotAvailableException

pobierzMaksymalnąLiczbęObsługiwanychUżytkowników

public int getMaxNumberOfUsersSupported ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Zwroty
Integer

Rzuty
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot ()

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parametry
format String

rescale boolean

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot (String format)

Parametry
format String

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

pobierz zrzut ekranu

public InputStreamSource getScreenshot (long displayId)

Parametry
displayId long

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parametry
namespace String

key String

Zwroty
String

Rzuty
DeviceNotAvailableException

getSetting

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

Parametry
userId int

namespace String

key String

Zwroty
String

Rzuty
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Zwroty

Rzuty
DeviceNotAvailableException

pobierz flagi użytkownika

public int getUserFlags (int userId)

Parametry
userId int

Zwroty
int

Rzuty
DeviceNotAvailableException

pobierzInformacjeUżytkownika

public  getUserInfos ()

Zwroty

Rzuty
DeviceNotAvailableException

pobierz numer seryjny użytkownika

public int getUserSerialNumber (int userId)

Parametry
userId int

Zwroty
int

Rzuty
DeviceNotAvailableException

ma funkcję

public boolean hasFeature (String feature)

Parametry
feature String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pakiet instalacyjny

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

Parametry
packageFile File

reinstall boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

pakiet instalacyjny

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

Parametry
packageFile File

certFile File

reinstall boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

pakiet instalacyjny

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

Parametry
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackageForUser

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

Parametry
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackageForUser

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

Parametry
packageFile File

reinstall boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackages

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

Parametry
packageFiles

reinstall boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackages

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

Parametry
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackagesForUser

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

Parametry
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackagesForUser

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

Parametry
packageFiles

reinstall boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installRemotePackages

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

Parametry
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installRemotePackages

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

Parametry
remoteApkPaths

reinstall boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

jest obsługiwana przez wielu użytkowników

public boolean isMultiUserSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Czy pakiet jest zainstalowany

public boolean isPackageInstalled (String packageName)

Parametry
packageName String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Czy pakiet jest zainstalowany

public boolean isPackageInstalled (String packageName, 
                String userId)

Parametry
packageName String

userId String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

jestUżytkownikUruchomiony

public boolean isUserRunning (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

jest drugorzędny użytkownik

public boolean isUserSecondary (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Zwroty

Rzuty
DeviceNotAvailableException

listaUżytkownicy

public  listUsers ()

Zwroty

Rzuty
DeviceNotAvailableException

postInwokacjaTearDown

public void postInvocationTearDown (Throwable exception)

Parametry
exception Throwable

usuńAdministratora

public boolean removeAdmin (String componentName, 
                int userId)

Parametry
componentName String

userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

usuńWłaściciele

public void removeOwners ()

Rzuty
DeviceNotAvailableException

usuńUżytkownika

public boolean removeUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parametry
componentName String

userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

ustawUstawienie

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

Parametry
namespace String

key String

value String

Rzuty
DeviceNotAvailableException

ustawUstawienie

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

Parametry
userId int

namespace String

key String

value String

Rzuty
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parametry
userId int

waitFlag boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

stopUżytkownik

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

Parametry
userId int

waitFlag boolean

forceFlag boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

stopUżytkownik

public boolean stopUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Zmień użytkownika

public boolean switchUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Zmień użytkownika

public boolean switchUser (int userId, 
                long timeout)

Parametry
userId int

timeout long

Zwroty
boolean

Rzuty
DeviceNotAvailableException

odinstalujPakiet

public String uninstallPackage (String packageName)

Parametry
packageName String

Zwroty
String

Rzuty
DeviceNotAvailableException

odinstaluj pakiet dla użytkownika

public String uninstallPackageForUser (String packageName, 
                int userId)

Parametry
packageName String

userId int

Zwroty
String

Rzuty
DeviceNotAvailableException

Metody chronione

doAdbReboot

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

Wykonaj ponowne uruchomienie adb.

Parametry
rebootMode NativeDevice.RebootMode : tryb tego ponownego uruchomienia.

reason String : dla tego restartu.

Rzuty
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Wystawiony do testów.

Zwroty
long

pobierzHostCurrentTime

protected long getHostCurrentTime ()

Wystawiony do testów

Zwroty
long

prePostBootSetup

protected void prePostBootSetup ()

Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po uruchomieniu.

Rzuty
DeviceNotAvailableException