테스트 장치

public class TestDevice
extends NativeDevice

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


전체 스택 Android 장치용 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

키가드를 해제하는 데 사용할 수 있는 명령입니다.

공개 생성자

테스트 장치

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

공개 메소드

클리어오류대화상자

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

비활성화키가드

public void disableKeyguard ()

던지기
DeviceNotAvailableException

파일이 존재합니까?

public boolean doesFileExist (String deviceFilePath)

매개변수
deviceFilePath String

보고
boolean

던지기
DeviceNotAvailableException

덤프힙

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

getAndroidId

public  getAndroidIds ()

보고

던지기
DeviceNotAvailableException

getAppPackage정보

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

getKeyguard상태

public KeyguardControllerState getKeyguardState ()

보고
KeyguardControllerState

던지기
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

보고

던지기
DeviceNotAvailableException

getMaxNumberOfRunningUsers지원됨

public int getMaxNumberOfRunningUsersSupported ()

보고
int

던지기
DeviceNotAvailableException

getMaxNumberOfUsers지원됨

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

getUser일련번호

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

원격 패키지 설치

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

매개변수
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

보고
String

던지기
DeviceNotAvailableException

원격 패키지 설치

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

목록디스플레이 ID

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

설정설정

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

시작사용자

public boolean startUser (int userId)

매개변수
userId int

보고
boolean

던지기
DeviceNotAvailableException

시작사용자

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

제거패키지

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

사전 PostBoot 설정

protected void prePostBootSetup ()

각 장치 유형(AndroidNativeDevice, TestDevice)이 특정 부팅 후 설정에 대해 이 메서드를 재정의할 수 있도록 허용합니다.

던지기
DeviceNotAvailableException