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