อุปกรณ์ทดสอบ

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

คำสั่งที่สามารถใช้เพื่อยกเลิกคีย์การ์ดได้

ผู้รับเหมาก่อสร้างสาธารณะ

อุปกรณ์ทดสอบ

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

วิธีการสาธารณะ

ล้างข้อผิดพลาด Dialogs

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

ปิดการใช้งานKeyguard

public void disableKeyguard ()

ขว้าง
DeviceNotAvailableException

ไม่FileExist

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

รับการตั้งค่าทั้งหมด

public  getAllSettings (String namespace)

พารามิเตอร์
namespace String

การส่งคืน

ขว้าง
DeviceNotAvailableException

รับ AndroidId

public String getAndroidId (int userId)

พารามิเตอร์
userId int

การส่งคืน
String

ขว้าง
DeviceNotAvailableException

รับรหัส Android

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

getMaxNumberOfRunningUsersได้รับการสนับสนุน

public int getMaxNumberOfRunningUsersSupported ()

การส่งคืน
int

ขว้าง
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

การส่งคืน
int

ขว้าง
DeviceNotAvailableException

รับ PrimaryUserId

public Integer getPrimaryUserId ()

การส่งคืน
Integer

ขว้าง
DeviceNotAvailableException

รับภาพหน้าจอ

public InputStreamSource getScreenshot ()

การส่งคืน
InputStreamSource

ขว้าง
DeviceNotAvailableException

รับภาพหน้าจอ

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

พารามิเตอร์
format String

rescale boolean

การส่งคืน
InputStreamSource

ขว้าง
DeviceNotAvailableException

รับภาพหน้าจอ

public InputStreamSource getScreenshot (String format)

พารามิเตอร์
format String

การส่งคืน
InputStreamSource

ขว้าง
DeviceNotAvailableException

รับภาพหน้าจอ

public InputStreamSource getScreenshot (long displayId)

พารามิเตอร์
displayId long

การส่งคืน
InputStreamSource

ขว้าง
DeviceNotAvailableException

รับการตั้งค่า

public String getSetting (String namespace, 
                String key)

พารามิเตอร์
namespace String

key String

การส่งคืน
String

ขว้าง
DeviceNotAvailableException

รับการตั้งค่า

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

ติดตั้ง PackageForUser

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

ติดตั้ง PackageForUser

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

ติดตั้งPackagesForUser

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

พารามิเตอร์
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

การส่งคืน
String

ขว้าง
DeviceNotAvailableException

ติดตั้งPackagesForUser

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

รองรับ isAppEnumeration แล้ว

public boolean isAppEnumerationSupported ()

การส่งคืน
boolean

ขว้าง
DeviceNotAvailableException

รองรับผู้ใช้หลายราย

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

โพสต์คำร้องขอTearDown

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

ตั้งค่าการตั้งค่า

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

พารามิเตอร์
namespace String

key String

value String

ขว้าง
DeviceNotAvailableException

ตั้งค่าการตั้งค่า

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

ผู้ใช้หยุด

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

พารามิเตอร์
userId int

waitFlag boolean

forceFlag boolean

การส่งคืน
boolean

ขว้าง
DeviceNotAvailableException

ผู้ใช้หยุด

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

ถอนการติดตั้ง Package

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