TestDevice

public class TestDevice
extends NativeDevice

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


הטמעה של ITestDevice במכשיר Android עם סטאק מלא

סיכום

שדות

public static final String DISMISS_KEYGUARD_CMD

פקודות שאפשר להשתמש בהן כדי לסגור את מסך הנעילה.

קונסטרוקטורים גלויים לכולם

TestDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

שיטות ציבוריות

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)

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

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

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

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

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

שיטות מוגנות

void doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)

מבצעים הפעלה מחדש של adb.

long getCheckNewUserSleep()

חשוף לבדיקה.

long getHostCurrentTime()

חשיפה לצורך בדיקה

void prePostBootSetup()

מאפשר לכל סוג מכשיר (AndroidNativeDevice, ‏ TestDevice) לשנות את השיטה הזו להגדרה ספציפית לאחר האתחול.

שדות

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

פקודות שאפשר להשתמש בהן כדי לסגור את מסך הנעילה.

קונסטרוקטורים גלויים לכולם

TestDevice

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

שיטות ציבוריות

clearErrorDialogs

public boolean clearErrorDialogs ()

החזרות
boolean

זריקות
DeviceNotAvailableException

createUser

public int createUser (String name)

פרמטרים
name String

החזרות
int

זריקות
DeviceNotAvailableException

createUser

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

פרמטרים
name String

guest boolean

ephemeral boolean

החזרות
int

זריקות
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

פרמטרים
name String

החזרות
int

זריקות
DeviceNotAvailableException

disableKeyguard

public void disableKeyguard ()

זריקות
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

פרמטרים
deviceFilePath String

החזרות
boolean

זריקות
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

פרמטרים
process String

devicePath String

החזרות
File

זריקות
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

החזרות

זריקות
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

פרמטרים
namespace String

החזרות

זריקות
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

פרמטרים
userId int

החזרות
String

זריקות
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

החזרות

זריקות
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

פרמטרים
packageName String

החזרות
PackageInfo

זריקות
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

החזרות

זריקות
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

החזרות
DeviceFoldableState

זריקות
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

החזרות
int

זריקות
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

החזרות

זריקות
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

החזרות

זריקות
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

החזרות
KeyguardControllerState

זריקות
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

החזרות

זריקות
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

החזרות
int

זריקות
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

החזרות
int

זריקות
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

החזרות
Integer

זריקות
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

החזרות
InputStreamSource

זריקות
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

פרמטרים
format String

rescale boolean

החזרות
InputStreamSource

זריקות
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format)

פרמטרים
format String

החזרות
InputStreamSource

זריקות
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

פרמטרים
displayId long

החזרות
InputStreamSource

זריקות
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

פרמטרים
namespace String

key String

החזרות
String

זריקות
DeviceNotAvailableException

getSetting

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

פרמטרים
userId int

namespace String

key String

החזרות
String

זריקות
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

החזרות

זריקות
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

פרמטרים
userId int

החזרות
int

זריקות
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

החזרות

זריקות
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

פרמטרים
userId int

החזרות
int

זריקות
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

פרמטרים
feature String

החזרות
boolean

זריקות
DeviceNotAvailableException

installPackage

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

פרמטרים
packageFile File

reinstall boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackage

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

פרמטרים
packageFile File

certFile File

reinstall boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackage

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

פרמטרים
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackageForUser

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

פרמטרים
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackageForUser

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

פרמטרים
packageFile File

reinstall boolean

userId int

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackages

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

פרמטרים
packageFiles

reinstall boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackages

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

פרמטרים
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackagesForUser

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

פרמטרים
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installPackagesForUser

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

פרמטרים
packageFiles

reinstall boolean

userId int

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installRemotePackages

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

פרמטרים
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

installRemotePackages

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

פרמטרים
remoteApkPaths

reinstall boolean

extraArgs String

החזרות
String

זריקות
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

החזרות
boolean

זריקות
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

החזרות
boolean

זריקות
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

פרמטרים
packageName String

החזרות
boolean

זריקות
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

פרמטרים
packageName String

userId String

החזרות
boolean

זריקות
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

החזרות

זריקות
DeviceNotAvailableException

listUsers

public  listUsers ()

החזרות

זריקות
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

פרמטרים
exception Throwable

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

פרמטרים
componentName String

userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

removeOwners

public void removeOwners ()

זריקות
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

פרמטרים
componentName String

userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

setSetting

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

פרמטרים
namespace String

key String

value String

זריקות
DeviceNotAvailableException

setSetting

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

פרמטרים
userId int

namespace String

key String

value String

זריקות
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

פרמטרים
userId int

waitFlag boolean

החזרות
boolean

זריקות
DeviceNotAvailableException

stopUser

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

פרמטרים
userId int

waitFlag boolean

forceFlag boolean

החזרות
boolean

זריקות
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId)

פרמטרים
userId int

החזרות
boolean

זריקות
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId, 
                long timeout)

פרמטרים
userId int

timeout long

החזרות
boolean

זריקות
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

פרמטרים
packageName String

החזרות
String

זריקות
DeviceNotAvailableException

uninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

פרמטרים
packageName String

userId int

החזרות
String

זריקות
DeviceNotAvailableException

שיטות מוגנות

doAdbReboot

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

מבצעים הפעלה מחדש של adb.

פרמטרים
rebootMode NativeDevice.RebootMode: מצב ההפעלה מחדש.

reason String: להפעלה מחדש הזו.

זריקות
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

חשוף לבדיקה.

החזרות
long

getHostCurrentTime

protected long getHostCurrentTime ()

חשיפה לצורך בדיקה

החזרות
long

prePostBootSetup

protected void prePostBootSetup ()

מאפשר לכל סוג מכשיר (AndroidNativeDevice, ‏ TestDevice) לשנות את השיטה הזו להגדרה ספציפית לאחר האתחול.

זריקות
DeviceNotAvailableException