TestDevice

public class TestDevice
extends NativeDevice

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


הטמעת ITestDevice עבור מכשיר אנדרואיד מלא מחסנית

סיכום

שדות

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

שיטות מוגנות

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

צור משתמש

public int createUser (String name)

פרמטרים
name String

החזרות
int

זורק
DeviceNotAvailableException

צור משתמש

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

get Screenshot

public InputStreamSource getScreenshot ()

החזרות
InputStreamSource

זורק
DeviceNotAvailableException

get Screenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

פרמטרים
format String

rescale boolean

החזרות
InputStreamSource

זורק
DeviceNotAvailableException

get Screenshot

public InputStreamSource getScreenshot (String format)

פרמטרים
format String

החזרות
InputStreamSource

זורק
DeviceNotAvailableException

get Screenshot

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

יש תכונה

public boolean hasFeature (String feature)

פרמטרים
feature String

החזרות
boolean

זורק
DeviceNotAvailableException

חבילת התקנה

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

פרמטרים
packageFile File

reinstall boolean

extraArgs String

החזרות
String

זורק
DeviceNotAvailableException

חבילת התקנה

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

פרמטרים
packageFile File

certFile File

reinstall boolean

extraArgs String

החזרות
String

זורק
DeviceNotAvailableException

חבילת התקנה

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

התקנת חבילות

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

פרמטרים
packageFiles

reinstall boolean

extraArgs String

החזרות
String

זורק
DeviceNotAvailableException

התקנת חבילות

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

התקן RemotePackages

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

פרמטרים
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

החזרות
String

זורק
DeviceNotAvailableException

התקן RemotePackages

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

רשימת משתמשים

public  listUsers ()

החזרות

זורק
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

פרמטרים
exception Throwable

הסר אדמין

public boolean removeAdmin (String componentName, 
                int userId)

פרמטרים
componentName String

userId int

החזרות
boolean

זורק
DeviceNotAvailableException

להסיר בעלים

public void removeOwners ()

זורק
DeviceNotAvailableException

הסר משתמש

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

החלף משתמש

public boolean switchUser (int userId)

פרמטרים
userId int

החזרות
boolean

זורק
DeviceNotAvailableException

החלף משתמש

public boolean switchUser (int userId, 
                long timeout)

פרמטרים
userId int

timeout long

החזרות
boolean

זורק
DeviceNotAvailableException

הסר את חבילת ההתקנה

public String uninstallPackage (String packageName)

פרמטרים
packageName String

החזרות
String

זורק
DeviceNotAvailableException

הסר את ההתקנה שלPackageForUser

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