Google berkomitmen untuk mendorong terwujudnya keadilan ras bagi komunitas Kulit Hitam. Lihat caranya.
Halaman ini diterjemahkan oleh Cloud Translation API.
Switch to English

TestDevice

public class TestDevice
extends NativeDevice

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


Implementasi ITestDevice untuk perangkat android full stack

Ringkasan

Fields

public static final String DISMISS_KEYGUARD_CMD

Perintah yang dapat digunakan untuk menutup pengaman tombol.

Konstruktor publik

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Metode publik

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

int getCurrentUser ()

getInstalledPackageNames ()

KeyguardControllerState getKeyguardState ()

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)

Metode yang dilindungi

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Lakukan reboot adb.

long getCheckNewUserSleep ()

Dipaparkan untuk pengujian.

long getHostCurrentTime ()

Dipaparkan untuk pengujian

void prePostBootSetup ()

Izinkan setiap jenis perangkat (AndroidNativeDevice, TestDevice) untuk mengganti metode ini untuk penyiapan pasca boot tertentu.

Fields

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Perintah yang dapat digunakan untuk menutup pengaman tombol.

Konstruktor publik

TestDevice

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

Metode publik

clearErrorDialogs

public boolean clearErrorDialogs ()

Kembali
boolean

Melempar
DeviceNotAvailableException

buat pengguna

public int createUser (String name)

Parameter
name String

Kembali
int

Melempar
DeviceNotAvailableException

buat pengguna

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

Parameter
name String

guest boolean

ephemeral boolean

Kembali
int

Melempar
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parameter
name String

Kembali
int

Melempar
DeviceNotAvailableException

disableKeyguard

public void disableKeyguard ()

Melempar
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

Parameter
deviceFilePath String

Kembali
boolean

Melempar
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parameter
process String

devicePath String

Kembali
File

Melempar
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Kembali

Melempar
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parameter
namespace String

Kembali

Melempar
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

Parameter
userId int

Kembali
String

Melempar
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Kembali

Melempar
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parameter
packageName String

Kembali
PackageInfo

Melempar
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Kembali

Melempar
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Kembali
int

Melempar
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

Kembali

Melempar
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Kembali
KeyguardControllerState

Melempar
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Kembali
int

Melempar
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Kembali
int

Melempar
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Kembali
Integer

Melempar
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

Kembali
InputStreamSource

Melempar
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parameter
format String

rescale boolean

Kembali
InputStreamSource

Melempar
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format)

Parameter
format String

Kembali
InputStreamSource

Melempar
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

Parameter
displayId long

Kembali
InputStreamSource

Melempar
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parameter
namespace String

key String

Kembali
String

Melempar
DeviceNotAvailableException

getSetting

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

Parameter
userId int

namespace String

key String

Kembali
String

Melempar
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Kembali

Melempar
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

Parameter
userId int

Kembali
int

Melempar
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Kembali

Melempar
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parameter
userId int

Kembali
int

Melempar
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

Parameter
feature String

Kembali
boolean

Melempar
DeviceNotAvailableException

installPackage

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

Parameter
packageFile File

reinstall boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackage

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

Parameter
packageFile File

certFile File

reinstall boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackage

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

Parameter
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackageForUser

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

Parameter
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackageForUser

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

Parameter
packageFile File

reinstall boolean

userId int

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackages

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

Parameter
packageFiles

reinstall boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackages

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

Parameter
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackagesForUser

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

Parameter
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installPackagesForUser

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

Parameter
packageFiles

reinstall boolean

userId int

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installRemotePackages

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

Parameter
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

installRemotePackages

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

Parameter
remoteApkPaths

reinstall boolean

extraArgs String

Kembali
String

Melempar
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Kembali
boolean

Melempar
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

Kembali
boolean

Melempar
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parameter
packageName String

Kembali
boolean

Melempar
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parameter
packageName String

userId String

Kembali
boolean

Melempar
DeviceNotAvailableException

isUserRunning

public boolean isUserRunning (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Kembali

Melempar
DeviceNotAvailableException

listUsers

public  listUsers ()

Kembali

Melempar
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Parameter
exception Throwable

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parameter
componentName String

userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

removeOwners

public void removeOwners ()

Melempar
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parameter
componentName String

userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

setSetting

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

Parameter
namespace String

key String

value String

Melempar
DeviceNotAvailableException

setSetting

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

Parameter
userId int

namespace String

key String

value String

Melempar
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parameter
userId int

waitFlag boolean

Kembali
boolean

Melempar
DeviceNotAvailableException

stopUser

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

Parameter
userId int

waitFlag boolean

forceFlag boolean

Kembali
boolean

Melempar
DeviceNotAvailableException

stopUser

public boolean stopUser (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId)

Parameter
userId int

Kembali
boolean

Melempar
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId, 
                long timeout)

Parameter
userId int

timeout long

Kembali
boolean

Melempar
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parameter
packageName String

Kembali
String

Melempar
DeviceNotAvailableException

Metode yang dilindungi

doAdbReboot

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

Lakukan reboot adb.

Parameter
rebootMode NativeDevice.RebootMode : mode reboot ini.

reason String : untuk reboot ini.

Melempar
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Dipaparkan untuk pengujian.

Kembali
long

getHostCurrentTime

protected long getHostCurrentTime ()

Dipaparkan untuk pengujian

Kembali
long

prePostBootSetup

protected void prePostBootSetup ()

Izinkan setiap jenis perangkat (AndroidNativeDevice, TestDevice) untuk mengganti metode ini untuk penyiapan pasca boot tertentu.

Melempar
DeviceNotAvailableException