Test cihazı

public class TestDevice
extends NativeDevice

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


Tam yığın android cihaz için bir ITestDevice uygulaması

Özet

Alanlar

public static final String DISMISS_KEYGUARD_CMD

Tuş kilidini kapatmak için kullanılabilecek komutlar.

Kamu inşaatçıları

TestDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Genel yöntemler

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)

Korumalı yöntemler

void doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason)

Bir adb yeniden başlatma gerçekleştirin.

long getCheckNewUserSleep ()

Test için maruz bırakıldı.

long getHostCurrentTime ()

Teste tabi tutuldu

void prePostBootSetup ()

Her cihaz türünün (AndroidNativeDevice, TestDevice) belirli önyükleme sonrası kurulum için bu yöntemi geçersiz kılmasına izin verir.

Alanlar

DISMISS_KEYGUARD_CMD

public static final String DISMISS_KEYGUARD_CMD

Tuş kilidini kapatmak için kullanılabilecek komutlar.

Kamu inşaatçıları

Test cihazı

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

Genel yöntemler

clearErrorDialogs

public boolean clearErrorDialogs ()

İadeler
boolean

atar
DeviceNotAvailableException

Kullanıcı oluştur

public int createUser (String name)

parametreler
name String

İadeler
int

atar
DeviceNotAvailableException

Kullanıcı oluştur

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

parametreler
name String

guest boolean

ephemeral boolean

İadeler
int

atar
DeviceNotAvailableException

oluşturKullanıcıNoThrow

public int createUserNoThrow (String name)

parametreler
name String

İadeler
int

atar
DeviceNotAvailableException

devre dışı bırakKeyguard

public void disableKeyguard ()

atar
DeviceNotAvailableException

doFileExist

public boolean doesFileExist (String deviceFilePath)

parametreler
deviceFilePath String

İadeler
boolean

atar
DeviceNotAvailableException

çöp yığını

public File dumpHeap (String process, 
                String devicePath)

parametreler
process String

devicePath String

İadeler
File

atar
DeviceNotAvailableException

getActiveApex'ler

public  getActiveApexes ()

İadeler

atar
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

parametreler
namespace String

İadeler

atar
DeviceNotAvailableException

getAndroidId

public String getAndroidId (int userId)

parametreler
userId int

İadeler
String

atar
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

İadeler

atar
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

parametreler
packageName String

İadeler
PackageInfo

atar
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

İadeler

atar
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

İadeler
DeviceFoldableState

atar
DeviceNotAvailableException

getCurrentKullanıcı

public int getCurrentUser ()

İadeler
int

atar
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

İadeler

atar
DeviceNotAvailableException

getInstalledPackageNames

public  getInstalledPackageNames ()

İadeler

atar
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

İadeler
KeyguardControllerState

atar
DeviceNotAvailableException

getMainlineModuleInfo

public  getMainlineModuleInfo ()

İadeler

atar
DeviceNotAvailableException

getMaxNumberOfRunningUsersDesteklenen

public int getMaxNumberOfRunningUsersSupported ()

İadeler
int

atar
DeviceNotAvailableException

getMaxNumberOfUsersDesteklenen

public int getMaxNumberOfUsersSupported ()

İadeler
int

atar
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

İadeler
Integer

atar
DeviceNotAvailableException

Ekran görüntüsü al

public InputStreamSource getScreenshot ()

İadeler
InputStreamSource

atar
DeviceNotAvailableException

Ekran görüntüsü al

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

parametreler
format String

rescale boolean

İadeler
InputStreamSource

atar
DeviceNotAvailableException

Ekran görüntüsü al

public InputStreamSource getScreenshot (String format)

parametreler
format String

İadeler
InputStreamSource

atar
DeviceNotAvailableException

Ekran görüntüsü al

public InputStreamSource getScreenshot (long displayId)

parametreler
displayId long

İadeler
InputStreamSource

atar
DeviceNotAvailableException

getAyar

public String getSetting (String namespace, 
                String key)

parametreler
namespace String

key String

İadeler
String

atar
DeviceNotAvailableException

getAyar

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

parametreler
userId int

namespace String

key String

İadeler
String

atar
DeviceNotAvailableException

getUninstallablePackageNames

public  getUninstallablePackageNames ()

İadeler

atar
DeviceNotAvailableException

getUserFlags

public int getUserFlags (int userId)

parametreler
userId int

İadeler
int

atar
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

İadeler

atar
DeviceNotAvailableException

getKullanıcıSeriSayısı

public int getUserSerialNumber (int userId)

parametreler
userId int

İadeler
int

atar
DeviceNotAvailableException

hasFeature

public boolean hasFeature (String feature)

parametreler
feature String

İadeler
boolean

atar
DeviceNotAvailableException

kurulum paketi

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

parametreler
packageFile File

reinstall boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

kurulum paketi

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

parametreler
packageFile File

certFile File

reinstall boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

kurulum paketi

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

parametreler
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

Kullanıcı İçin Paket Yükle

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

parametreler
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

Kullanıcı İçin Paket Yükle

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

parametreler
packageFile File

reinstall boolean

userId int

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

yükleme Paketleri

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

parametreler
packageFiles

reinstall boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

yükleme Paketleri

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

parametreler
packageFiles

reinstall boolean

grantPermissions boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

Kullanıcı İçin Paketler

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

parametreler
packageFiles

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

Kullanıcı İçin Paketler

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

parametreler
packageFiles

reinstall boolean

userId int

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

UzakPaketleri kurun

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

parametreler
remoteApkPaths

reinstall boolean

grantPermissions boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

UzakPaketleri kurun

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

parametreler
remoteApkPaths

reinstall boolean

extraArgs String

İadeler
String

atar
DeviceNotAvailableException

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

İadeler
boolean

atar
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

İadeler
boolean

atar
DeviceNotAvailableException

Paket Yüklendi

public boolean isPackageInstalled (String packageName)

parametreler
packageName String

İadeler
boolean

atar
DeviceNotAvailableException

Paket Yüklendi

public boolean isPackageInstalled (String packageName, 
                String userId)

parametreler
packageName String

userId String

İadeler
boolean

atar
DeviceNotAvailableException

isKullanıcıRunning

public boolean isUserRunning (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

isKullanıcıİkincil

public boolean isUserSecondary (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

listeGörüntüleme Kimlikleri

public  listDisplayIds ()

İadeler

atar
DeviceNotAvailableException

listeKullanıcılar

public  listUsers ()

İadeler

atar
DeviceNotAvailableException

postInceptionTearDown

public void postInvocationTearDown (Throwable exception)

parametreler
exception Throwable

kaldırYönetici

public boolean removeAdmin (String componentName, 
                int userId)

parametreler
componentName String

userId int

İadeler
boolean

atar
DeviceNotAvailableException

Sahipleri kaldır

public void removeOwners ()

atar
DeviceNotAvailableException

Kullanıcıyı kaldır

public boolean removeUser (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

setCihaz Sahibi

public boolean setDeviceOwner (String componentName, 
                int userId)

parametreler
componentName String

userId int

İadeler
boolean

atar
DeviceNotAvailableException

setAyar

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

parametreler
namespace String

key String

value String

atar
DeviceNotAvailableException

setAyar

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

parametreler
userId int

namespace String

key String

value String

atar
DeviceNotAvailableException

startUser

public boolean startUser (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

parametreler
userId int

waitFlag boolean

İadeler
boolean

atar
DeviceNotAvailableException

durdurKullanıcı

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

parametreler
userId int

waitFlag boolean

forceFlag boolean

İadeler
boolean

atar
DeviceNotAvailableException

durdurKullanıcı

public boolean stopUser (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

Kullanıcı değiştir

public boolean switchUser (int userId)

parametreler
userId int

İadeler
boolean

atar
DeviceNotAvailableException

Kullanıcı değiştir

public boolean switchUser (int userId, 
                long timeout)

parametreler
userId int

timeout long

İadeler
boolean

atar
DeviceNotAvailableException

Kaldırma Paketi

public String uninstallPackage (String packageName)

parametreler
packageName String

İadeler
String

atar
DeviceNotAvailableException

UninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

parametreler
packageName String

userId int

İadeler
String

atar
DeviceNotAvailableException

Korumalı yöntemler

doAdbReboot

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

Bir adb yeniden başlatma gerçekleştirin.

parametreler
rebootMode NativeDevice.RebootMode : bu yeniden başlatmanın bir modu.

reason String : bu yeniden başlatma için.

atar
DeviceNotAvailableException

getCheckNewUserSleep

protected long getCheckNewUserSleep ()

Test için maruz bırakıldı.

İadeler
long

getHostCurrentTime

protected long getHostCurrentTime ()

Teste tabi tutuldu

İadeler
long

Önyükleme ÖncesiKurulum

protected void prePostBootSetup ()

Her cihaz türünün (AndroidNativeDevice, TestDevice) belirli önyükleme sonrası kurulum için bu yöntemi geçersiz kılmasına izin verir.

atar
DeviceNotAvailableException