NativeDevice

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

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


Domyślna implementacja na urządzeniach z Androidem, które nie mają pełnego stosu.ITestDevice

Podsumowanie

Zagnieżdżone klasy

class NativeDevice.AdbAction

DeviceAction do uruchamiania polecenia „adb…” w systemie operacyjnym. 

class NativeDevice.AdbShellAction

 

class NativeDevice.RebootDeviceAction

DeviceAction aby ponownie uruchomić urządzenie. 

enum NativeDevice.RebootMode

Tryb ponownego uruchamiania. 

Stałe

int INVALID_USER_ID

Wartość zwrócona w przypadku nieprawidłowego lub niewykrytego identyfikatora użytkownika: UserHandle zdefiniował wartość -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

domyślna liczba prób ponownego wykonania polecenia,

Fieldsem

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

Konstruktory publiczne

NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Tworzy TestDevice.

Metody publiczne

boolean checkApiLevelAgainstNextRelease(int strictMinLevel)

boolean checkConnectivity()

boolean clearErrorDialogs()

void clearLastConnectedWifiNetwork()

void clearLogcat()

boolean connectToWifiNetwork(String wifiSsid, String wifiPsk)

boolean connectToWifiNetwork(String wifiSsid, String wifiPsk, boolean scanSsid)

boolean connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk, boolean scanSsid)

boolean connectToWifiNetworkIfNeeded(String wifiSsid, String wifiPsk)

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

int createUser(String name)

int createUserNoThrow(String name)

void deleteFile(String deviceFilePath)

boolean deviceSoftRestarted(ProcessInfo prevSystemServerProcess)

boolean deviceSoftRestartedSince(long utcEpochTime, TimeUnit timeUnit)

boolean disableAdbRoot()

void disableKeyguard()

boolean disableNetworkMonitor()

boolean disconnectFromWifi()

boolean doesFileExist(String deviceFilePath)

File dumpHeap(String process, String devicePath)

boolean enableAdbRoot()

boolean enableNetworkMonitor()

boolean encryptDevice(boolean inplace)

String executeAdbCommand(long timeout, String... cmdArgs)

String executeAdbCommand(String... cmdArgs)

CommandResult executeFastbootCommand(String... cmdArgs)

CommandResult executeFastbootCommand(long timeout, String... cmdArgs)

CommandResult executeLongFastbootCommand(String... cmdArgs)

String executeShellCommand(String command)

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)

void executeShellCommand(String command, IShellOutputReceiver receiver)

CommandResult executeShellV2Command(String cmd)

CommandResult executeShellV2Command(String cmd, OutputStream pipeToOutput)

CommandResult executeShellV2Command(String cmd, File pipeAsInput)

CommandResult executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult executeShellV2Command(String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)

CommandResult executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult executeShellV2Command(String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)

CommandResult fastbootWipePartition(String partition)

getActiveApexes()

getAllSettings(String namespace)

DeviceAllocationState getAllocationState()
String getAndroidId(int userId)

getAndroidIds()

int getApiLevel()

PackageInfo getAppPackageInfo(String packageName)

getAppPackageInfos()

String getBasebandVersion()
Integer getBattery()

boolean getBooleanProperty(String name, boolean defaultValue)

getBootHistory()

getBootHistorySince(long utcEpochTime, TimeUnit timeUnit)

String getBootloaderVersion()

InputStreamSource getBugreport()

InputStreamSource getBugreportz()

String getBuildAlias()

String getBuildFlavor()

String getBuildId()

String getBuildSigningKeys()

DeviceDescriptor getCachedDeviceDescriptor()

String[] getChildren(String path)

DeviceFoldableState getCurrentFoldableState()
int getCurrentUser()

String getDeviceClass()

long getDeviceDate()

DeviceDescriptor getDeviceDescriptor()

TestDeviceState getDeviceState()

long getDeviceTimeOffset(Date date)

InputStreamSource getEmulatorOutput()

Process getEmulatorProcess()

final File getExecuteShellCommandLog()

Dziennik zawierający wszystkie logi executeShellCommand(String).

long getExternalStoreFreeSpace()

String getFastbootPath()

String getFastbootProductType()

String getFastbootProductVariant()

String getFastbootSerialNumber()

String getFastbootVariable(String variableName)

String getFastbootVersion()

IFileEntry getFileEntry(String path)

IFileEntry getFileEntry(FileListingService.FileEntry entry)

Nieoficjalna pomoc w przypadku uzyskania FileEntry z ścieżki niebędącej ścieżką główną.

getFoldableStates()
IDevice getIDevice()

getInstalledPackageNames()

long getIntProperty(String name, long defaultValue)

String getIpAddress()

KeyguardControllerState getKeyguardState()

long getLastExpectedRebootTimeMillis()

int getLaunchApiLevel()

InputStreamSource getLogcat()

InputStreamSource getLogcat(int maxBytes)

InputStreamSource getLogcatDump()

InputStreamSource getLogcatSince(long date)

String getMacAddress()

getMainlineModuleInfo()

int getMaxNumberOfRunningUsersSupported()
int getMaxNumberOfUsersSupported()

IDeviceStateMonitor getMonitor()
String getMountPoint(String mountName)

ITestDevice.MountPointInfo getMountPointInfo(String mountpoint)

getMountPointInfo()

TestDeviceOptions getOptions()

long getPartitionFreeSpace(String partition)

Integer getPrimaryUserId()

ProcessInfo getProcessByName(String processName)

String getProcessPid(String process)

String getProductType()

String getProductVariant()

String getProperty(String name)

ITestDevice.RecoveryMode getRecoveryMode()

InputStreamSource getScreenshot(String format)

InputStreamSource getScreenshot(long displayId)

InputStreamSource getScreenshot(String format, boolean rescale)

InputStreamSource getScreenshot()

String getSerialNumber()

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

String getSetting(String namespace, String key)

String getSimOperator()

String getSimState()

getTombstones()

long getTotalMemory()

getUninstallablePackageNames()

boolean getUseFastbootErase()

int getUserFlags(int userId)

getUserInfos()

int getUserSerialNumber(int userId)

IManagedTestDevice.DeviceEventResponse handleAllocationEvent(DeviceEvent event)

Przetwarzanie zdarzenia urządzenia, które może, ale nie musi spowodować przeniesienie urządzenia do nowego stanu alokacji.

boolean hasFeature(String feature)

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

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

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

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

boolean isAdbRoot()

boolean isAdbTcp()
boolean isAppEnumerationSupported()

boolean isDeviceEncrypted()

boolean isDirectory(String path)

boolean isEnableAdbRoot()
boolean isEncryptionSupported()

boolean isExecutable(String fullPath)

boolean isFastbootEnabled()

boolean isHeadless()

boolean isMultiUserSupported()

boolean isPackageInstalled(String packageName, String userId)

boolean isPackageInstalled(String packageName)

boolean isRuntimePermissionSupported()

boolean isStateBootloaderOrFastbootd()

boolean isUserRunning(int userId)

boolean isUserSecondary(int userId)

boolean isWifiEnabled()

listDisplayIds()

listUsers()

boolean logBugreport(String dataName, ITestLogger listener)

void logOnDevice(String tag, Log.LogLevel level, String format, Object... args)

void nonBlockingReboot()

void postAdbRootAction()

Zastąpić, jeśli urządzenie wymaga wykonania określonych czynności po uzyskaniu uprawnień root w adb, zanim będzie można przywrócić urządzenie do trybu online.

void postAdbUnrootAction()

Zastąpić, jeśli urządzenie wymaga wykonania określonych czynności po usunięciu uprawnień roota za pomocą adb, a przed przywróceniem urządzenia do trybu online.

void postBootSetup()

void postInvocationTearDown(Throwable exception)

void preInvocationSetup(IBuildInfo info, MultiMap<String, String> attributes)

boolean pullDir(String deviceFilePath, File localDir)

boolean pullFile(String remoteFilePath, File localFile)

File pullFile(String remoteFilePath)

String pullFileContents(String remoteFilePath)

File pullFileFromExternal(String remoteFilePath)

boolean pushDir(File localFileDir, String deviceFilePath, excludedDirectories)

boolean pushDir(File localFileDir, String deviceFilePath)

boolean pushFile(File localFile, String remoteFilePath)

boolean pushString(String contents, String remoteFilePath)

void reboot(String reason)

void reboot()

void rebootIntoBootloader()

void rebootIntoFastbootd()

void rebootIntoRecovery()

void rebootIntoSideload()

void rebootIntoSideload(boolean autoReboot)

void rebootUntilOnline()
void rebootUntilOnline(String reason)

void rebootUserspace()
void rebootUserspaceUntilOnline()
void recoverDevice()

Próby przywrócenia komunikacji z urządzeniem.

void remountSystemWritable()

void remountVendorWritable()

boolean removeAdmin(String componentName, int userId)

void removeOwners()

boolean removeUser(int userId)

void resetContentProviderSetup()

Zresetuj flagę konfiguracji dostawcy treści, aby ponownie ją uruchomić.

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTests(IRemoteAndroidTestRunner runner, listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)

boolean runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, listeners)

void setConfiguration(IConfiguration configuration)

Wstrzykuje IConfiguration w użyciu.

void setDate(Date date)

boolean setDeviceOwner(String componentName, int userId)

void setDeviceState(TestDeviceState deviceState)

void setEmulatorOutputStream(SizeLimitedOutputStream output)

W emulatorze ustaw SizeLimitedOutputStream na rejestrowanie danych wyjściowych.

void setEmulatorProcess(Process p)

void setFastbootEnabled(boolean fastbootEnabled)

void setFastbootPath(String fastbootPath)

void setIDevice(IDevice newDevice)

void setOptions(TestDeviceOptions options)

boolean setProperty(String propKey, String propValue)

void setRecovery(IDeviceRecovery recovery)

void setRecoveryMode(ITestDevice.RecoveryMode mode)

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

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

void setUseFastbootErase(boolean useFastbootErase)

void startLogcat()

boolean startUser(int userId)

boolean startUser(int userId, boolean waitFlag)

void stopEmulatorOutput()

void stopLogcat()

boolean stopUser(int userId)

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

String switchToAdbTcp()

boolean switchToAdbUsb()

boolean switchUser(int userId)

boolean switchUser(int userId, long timeout)

boolean syncFiles(File localFileDir, String deviceFilePath)

Bugreport takeBugreport()

boolean unencryptDevice()

String uninstallPackage(String packageName)

String uninstallPackageForUser(String packageName, int userId)

boolean unlockDevice()

boolean waitForBootComplete(long timeOut)

void waitForDeviceAvailable()

void waitForDeviceAvailable(long waitTime)

boolean waitForDeviceInRecovery(long waitTime)

boolean waitForDeviceInSideload(long waitTime)

boolean waitForDeviceNotAvailable(long waitTime)

void waitForDeviceOnline()

void waitForDeviceOnline(long waitTime)

boolean waitForDeviceShell(long waitTime)

Chronione metody

void checkApiLevelAgainst(String feature, int strictMinLevel)
NativeDevice.RebootDeviceAction createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)

Utwórz RebootDeviceAction, który będzie używany podczas wykonywania działania ponownego uruchamiania.

void doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)

Uruchom ponownie urządzenie za pomocą adb.

void ensureRuntimePermissionSupported()

metoda pomocnicza do rzucania wyjątkiem, jeśli uprawnienia czasu działania nie są obsługiwane

InputStreamSource getBugreportInternal()
File getBugreportzInternal()

Metoda pomocnicza wewnętrzna służąca do pobierania pliku zip z bugreportem jako ERROR(/File).

IRunUtil getRunUtil()

Uzyskaj instancję RunUtil, której chcesz użyć.

String internalGetProperty(String propName, String fastbootVar, String description)

Pobierać właściwości urządzenia z domyślnej pamięci podręcznej ddmlib, a w razie potrzeby używać polecenia „adb shell getprop” lub „fastboot getvar” w zależności od tego, czy urządzenie jest w trybie Fastboot.

boolean isNewer(File localFile, IFileEntry entry)

Zwraca true, jeśli plik lokalny jest nowszy niż plik zdalny.

boolean performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)

Wykonywanie czynności na tym urządzeniu.

void postAdbReboot()

Możliwe dodatkowe działania, które można wykonać po ponownym uruchomieniu.

void prePostBootSetup()

Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po uruchomieniu.

void setClock(Clock clock)

Ustaw instancję zegara, której chcesz używać.

void setLogStartDelay(int delay)

Określa czas (w milisekundach) oczekiwania przed rozpoczęciem przechwytywania logcat na urządzeniu online.

void waitForDeviceNotAvailable(String operationDesc, long time)

Stałe

INVALID_USER_ID

public static final int INVALID_USER_ID

Wartość zwrócona w przypadku nieprawidłowego lub niewykrytego identyfikatora użytkownika: UserHandle zdefiniował wartość -10000

Wartość stała: -10000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

Wartość stała: 5000 (0x0000000000001388)

MAX_RETRY_ATTEMPTS

protected static final int MAX_RETRY_ATTEMPTS

domyślna liczba prób ponownego wykonania polecenia,

Wartość stała: 2 (0x00000002)

Fieldsem

SD_CARD

protected static final String SD_CARD

STORAGE_EMULATED

protected static final String STORAGE_EMULATED

mOptions

protected TestDeviceOptions mOptions

mStateMonitor

protected final IDeviceStateMonitor mStateMonitor

Konstruktory publiczne

NativeDevice

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

Tworzy TestDevice.

Parametry
device IDevice: powiązany IDevice

stateMonitor IDeviceStateMonitor: mechanizm IDeviceStateMonitor do użycia

allocationMonitor IDeviceMonitor: IDeviceMonitor, aby poinformować o zmianach stanu alokacji. Może być null

Metody publiczne

checkApiLevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Parametry
strictMinLevel int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

checkConnectivity

public boolean checkConnectivity ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

clearErrorDialogs

public boolean clearErrorDialogs ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

clearLastConnectedWifiNetwork

public void clearLastConnectedWifiNetwork ()

clearLogcat

public void clearLogcat ()

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

Parametry
wifiSsid String

wifiPsk String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

connectToWifiNetwork

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

Parametry
wifiSsid String

wifiPsk String

scanSsid boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk, 
                boolean scanSsid)

Parametry
wifiSsid String

wifiPsk String

scanSsid boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

connectToWifiNetworkIfNeeded

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Parametry
wifiSsid String

wifiPsk String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

createUser

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

Parametry
name String

guest boolean

ephemeral boolean

Zwroty
int

Rzuty
DeviceNotAvailableException

createUser

public int createUser (String name)

Parametry
name String

Zwroty
int

Rzuty
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parametry
name String

Zwroty
int

Rzuty
DeviceNotAvailableException

deleteFile

public void deleteFile (String deviceFilePath)

Parametry
deviceFilePath String

Rzuty
DeviceNotAvailableException

deviceSoftRestarted

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

Parametry
prevSystemServerProcess ProcessInfo

Zwroty
boolean

Rzuty
DeviceNotAvailableException

deviceSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Parametry
utcEpochTime long

timeUnit TimeUnit

Zwroty
boolean

Rzuty
DeviceNotAvailableException

disableAdbRoot

public boolean disableAdbRoot ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

disableKeyguard

public void disableKeyguard ()

Rzuty
DeviceNotAvailableException

disableNetworkMonitor

public boolean disableNetworkMonitor ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

disconnectFromWifi

public boolean disconnectFromWifi ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

doesFileExist

public boolean doesFileExist (String deviceFilePath)

Parametry
deviceFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parametry
process String

devicePath String

Zwroty
File

Rzuty
DeviceNotAvailableException

enableAdbRoot

public boolean enableAdbRoot ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

enableNetworkMonitor

public boolean enableNetworkMonitor ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

encryptDevice

public boolean encryptDevice (boolean inplace)

Parametry
inplace boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (long timeout, 
                String... cmdArgs)

Parametry
timeout long

cmdArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (long timeout, 
                String... cmdArgs)

Parametry
timeout long

cmdArgs String

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Parametry
cmdArgs String

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellCommand

public String executeShellCommand (String command)

Parametry
command String

Zwroty
String

Rzuty
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Parametry
command String

receiver IShellOutputReceiver

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Rzuty
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeoutForCommand, 
                long maxTimeToOutputShellResponse, 
                TimeUnit timeUnit, 
                int retryAttempts)

Parametry
command String

receiver IShellOutputReceiver

maxTimeoutForCommand long

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Rzuty
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Parametry
command String

receiver IShellOutputReceiver

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd)

Parametry
cmd String

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Parametry
cmd String

pipeToOutput OutputStream

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Parametry
cmd String

pipeAsInput File

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Parametry
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit)

Parametry
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Parametry
cmd String

pipeAsInput File

pipeToOutput OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput, 
                OutputStream pipeToOutput, 
                OutputStream pipeToError, 
                long maxTimeoutForCommand, 
                TimeUnit timeUnit, 
                int retryAttempts)

Parametry
cmd String

pipeAsInput File

pipeToOutput OutputStream

pipeToError OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

fastbootWipePartition

public CommandResult fastbootWipePartition (String partition)

Parametry
partition String

Zwroty
CommandResult

Rzuty
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Zwroty

Rzuty
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parametry
namespace String

Zwroty

Rzuty
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

Zwroty
DeviceAllocationState

getAndroidId

public String getAndroidId (int userId)

Parametry
userId int

Zwroty
String

Rzuty
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Zwroty

Rzuty
DeviceNotAvailableException

getApiLevel

public int getApiLevel ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parametry
packageName String

Zwroty
PackageInfo

Rzuty
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Zwroty

Rzuty
DeviceNotAvailableException

getBasebandVersion

public String getBasebandVersion ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getBattery

public Integer getBattery ()

Zwroty
Integer

getBooleanProperty

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Parametry
name String

defaultValue boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

getBootHistory

public  getBootHistory ()

Zwroty

Rzuty
DeviceNotAvailableException

getBootHistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Parametry
utcEpochTime long

timeUnit TimeUnit

Zwroty

Rzuty
DeviceNotAvailableException

getBootloaderVersion

public String getBootloaderVersion ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getBugreport

public InputStreamSource getBugreport ()

Zwroty
InputStreamSource

getBugreportz

public InputStreamSource getBugreportz ()

Zwroty
InputStreamSource

getBuildAlias

public String getBuildAlias ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getBuildFlavor

public String getBuildFlavor ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getBuildId

public String getBuildId ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

Zwroty
DeviceDescriptor

getChildren

public String[] getChildren (String path)

Parametry
path String

Zwroty
String[]

Rzuty
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Zwroty
DeviceFoldableState

Rzuty
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

Zwroty
String

getDeviceDate

public long getDeviceDate ()

Zwroty
long

Rzuty
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Zwroty
DeviceDescriptor

getDeviceState

public TestDeviceState getDeviceState ()

Zwroty
TestDeviceState

getDeviceTimeOffset

public long getDeviceTimeOffset (Date date)

Parametry
date Date

Zwroty
long

Rzuty
DeviceNotAvailableException

getEmulatorOutput

public InputStreamSource getEmulatorOutput ()

Zwroty
InputStreamSource

getEmulatorProcess

public Process getEmulatorProcess ()

Zwroty
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

Dziennik zawierający wszystkie logi executeShellCommand(String).

Zwroty
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Zwroty
long

Rzuty
DeviceNotAvailableException

getFastbootPath

public String getFastbootPath ()

Zwroty
String

getFastbootProductType

public String getFastbootProductType ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Zwroty
String

getFastbootVariable

public String getFastbootVariable (String variableName)

Parametry
variableName String

Zwroty
String

Rzuty
DeviceNotAvailableException

getFastbootVersion

public String getFastbootVersion ()

Zwroty
String

getFileEntry

public IFileEntry getFileEntry (String path)

Parametry
path String

Zwroty
IFileEntry

Rzuty
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

Nieoficjalna pomoc w przypadku uzyskania FileEntry z ścieżki niebędącej ścieżką główną. FIXME: Refactor the FileEntry system to have it available from any path. (nawet bez uprawnień root).

Parametry
entry FileListingService.FileEntry: FileEntry niekoniecznie musi być rootem, jak wymaga tego Ddmlib.

Zwroty
IFileEntry FileEntryWrapper reprezentujący wpis pliku.

Rzuty
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Zwroty

Rzuty
DeviceNotAvailableException

getIDevice

public IDevice getIDevice ()

Zwroty
IDevice

getInstalledPackageNames

public  getInstalledPackageNames ()

Zwroty

Rzuty
DeviceNotAvailableException

getIntProperty

public long getIntProperty (String name, 
                long defaultValue)

Parametry
name String

defaultValue long

Zwroty
long

Rzuty
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Zwroty
KeyguardControllerState

Rzuty
DeviceNotAvailableException

getLastExpectedRebootTimeMillis

public long getLastExpectedRebootTimeMillis ()

Zwroty
long

getLaunchApiLevel

public int getLaunchApiLevel ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getLogcat

public InputStreamSource getLogcat ()

Zwroty
InputStreamSource

getLogcat

public InputStreamSource getLogcat (int maxBytes)

Parametry
maxBytes int

Zwroty
InputStreamSource

getLogcatDump

public InputStreamSource getLogcatDump ()

Zwroty
InputStreamSource

getLogcatSince

public InputStreamSource getLogcatSince (long date)

Parametry
date long

Zwroty
InputStreamSource

getMacAddress

public String getMacAddress ()

Zwroty
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Zwroty

Rzuty
DeviceNotAvailableException

getMaxNumberOfRunningUsersSupported

public int getMaxNumberOfRunningUsersSupported ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getMaxNumberOfUsersSupported

public int getMaxNumberOfUsersSupported ()

Zwroty
int

Rzuty
DeviceNotAvailableException

getMonitor

public IDeviceStateMonitor getMonitor ()

Zwroty
IDeviceStateMonitor

getMountPoint

public String getMountPoint (String mountName)

Parametry
mountName String

Zwroty
String

getMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Parametry
mountpoint String

Zwroty
ITestDevice.MountPointInfo

Rzuty
DeviceNotAvailableException

getMountPointInfo

public  getMountPointInfo ()

Zwroty

Rzuty
DeviceNotAvailableException

getOptions

public TestDeviceOptions getOptions ()

Zwroty
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

Parametry
partition String

Zwroty
long

Rzuty
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Zwroty
Integer

Rzuty
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

Parametry
processName String

Zwroty
ProcessInfo

Rzuty
DeviceNotAvailableException

getProcessPid

public String getProcessPid (String process)

Parametry
process String

Zwroty
String

Rzuty
DeviceNotAvailableException

getProductType

public String getProductType ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getProductVariant

public String getProductVariant ()

Zwroty
String

Rzuty
DeviceNotAvailableException

getProperty

public String getProperty (String name)

Parametry
name String

Zwroty
String

Rzuty
DeviceNotAvailableException

getRecoveryMode

public ITestDevice.RecoveryMode getRecoveryMode ()

Zwroty
ITestDevice.RecoveryMode

getScreenshot

public InputStreamSource getScreenshot (String format)

Parametry
format String

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (long displayId)

Parametry
displayId long

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parametry
format String

rescale boolean

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

getScreenshot

public InputStreamSource getScreenshot ()

Zwroty
InputStreamSource

Rzuty
DeviceNotAvailableException

getSerialNumber

public String getSerialNumber ()

Zwroty
String

getSetting

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

Parametry
userId int

namespace String

key String

Zwroty
String

Rzuty
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parametry
namespace String

key String

Zwroty
String

Rzuty
DeviceNotAvailableException

getSimOperator

public String getSimOperator ()

Zwroty
String

getSimState

public String getSimState ()

Zwroty
String

getTombstones

public  getTombstones ()

Zwroty

Rzuty
DeviceNotAvailableException

getTotalMemory

public long getTotalMemory ()

Zwroty
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Zwroty

Rzuty
DeviceNotAvailableException

getUseFastbootErase

public boolean getUseFastbootErase ()

Zwroty
boolean

getUserFlags

public int getUserFlags (int userId)

Parametry
userId int

Zwroty
int

Rzuty
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Zwroty

Rzuty
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parametry
userId int

Zwroty
int

Rzuty
DeviceNotAvailableException

handleAllocationEvent

public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

Przetwarzanie zdarzenia urządzenia, które może, ale nie musi spowodować przeniesienie urządzenia do nowego stanu alokacji.

Parametry
event DeviceEvent

Zwroty
IManagedTestDevice.DeviceEventResponse

hasFeature

public boolean hasFeature (String feature)

Parametry
feature String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

installPackage

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

Parametry
packageFile File

reinstall boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackage

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

Parametry
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackageForUser

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

Parametry
packageFile File

reinstall boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

installPackageForUser

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

Parametry
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Zwroty
String

Rzuty
DeviceNotAvailableException

isAdbRoot

public boolean isAdbRoot ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

Zwroty
boolean

isAppEnumerationSupported

public boolean isAppEnumerationSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isDeviceEncrypted

public boolean isDeviceEncrypted ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isDirectory

public boolean isDirectory (String path)

Parametry
path String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Zwroty
boolean true czy na urządzeniu ma być włączony dostęp roota adb

isEncryptionSupported

public boolean isEncryptionSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isExecutable

public boolean isExecutable (String fullPath)

Parametry
fullPath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isFastbootEnabled

public boolean isFastbootEnabled ()

Zwroty
boolean

isHeadless

public boolean isHeadless ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isMultiUserSupported

public boolean isMultiUserSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName, 
                String userId)

Parametry
packageName String

userId String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isPackageInstalled

public boolean isPackageInstalled (String packageName)

Parametry
packageName String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isRuntimePermissionSupported

public boolean isRuntimePermissionSupported ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isStateBootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

Zwroty
boolean

isUserRunning

public boolean isUserRunning (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isUserSecondary

public boolean isUserSecondary (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

isWifiEnabled

public boolean isWifiEnabled ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Zwroty

Rzuty
DeviceNotAvailableException

listUsers

public  listUsers ()

Zwroty

Rzuty
DeviceNotAvailableException

logBugreport

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Parametry
dataName String

listener ITestLogger

Zwroty
boolean

logOnDevice

public void logOnDevice (String tag, 
                Log.LogLevel level, 
                String format, 
                Object... args)

Parametry
tag String

level Log.LogLevel

format String

args Object

nonBlockingReboot

public void nonBlockingReboot ()

Rzuty
DeviceNotAvailableException

postAdbRootAction

public void postAdbRootAction ()

Zastąpić, jeśli urządzenie wymaga wykonania określonych czynności po uzyskaniu uprawnień root w adb, zanim będzie można przywrócić urządzenie do trybu online. Implementacja domyślna nie zawiera żadnych dodatkowych działań. Na tym etapie nie ma gwarancji, że adb root jest włączone.

Rzuty
DeviceNotAvailableException

postAdbUnrootAction

public void postAdbUnrootAction ()

Zastąpić, jeśli urządzenie wymaga wykonania określonych czynności po usunięciu uprawnień roota za pomocą adb, a przed przywróceniem urządzenia do trybu online. Implementacja domyślna nie obejmuje żadnych dodatkowych działań. Na tym etapie nie ma gwarancji, że adb root jest wyłączony.

Rzuty
DeviceNotAvailableException

postBootSetup

public void postBootSetup ()

Rzuty
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Parametry
exception Throwable

preInvocationSetup

public void preInvocationSetup (IBuildInfo info, 
                MultiMap<String, String> attributes)

Parametry
info IBuildInfo

attributes MultiMap

Rzuty
DeviceNotAvailableException
TargetSetupError

pullDir

public boolean pullDir (String deviceFilePath, 
                File localDir)

Parametry
deviceFilePath String

localDir File

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pullFile

public boolean pullFile (String remoteFilePath, 
                File localFile)

Parametry
remoteFilePath String

localFile File

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pullFile

public File pullFile (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
File

Rzuty
DeviceNotAvailableException

pullFileContents

public String pullFileContents (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
String

Rzuty
DeviceNotAvailableException

pullFileFromExternal

public File pullFileFromExternal (String remoteFilePath)

Parametry
remoteFilePath String

Zwroty
File

Rzuty
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath, 
                 excludedDirectories)

Parametry
localFileDir File

deviceFilePath String

excludedDirectories

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Parametry
localFileDir File

deviceFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pushFile

public boolean pushFile (File localFile, 
                String remoteFilePath)

Parametry
localFile File

remoteFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

pushString

public boolean pushString (String contents, 
                String remoteFilePath)

Parametry
contents String

remoteFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

Uruchom ponownie

public void reboot (String reason)

Parametry
reason String

Rzuty
DeviceNotAvailableException

Uruchom ponownie

public void reboot ()

Rzuty
DeviceNotAvailableException

rebootIntoBootloader

public void rebootIntoBootloader ()

Rzuty
DeviceNotAvailableException

rebootIntoFastbootd

public void rebootIntoFastbootd ()

Rzuty
DeviceNotAvailableException

rebootIntoRecovery

public void rebootIntoRecovery ()

Rzuty
DeviceNotAvailableException

rebootIntoSideload

public void rebootIntoSideload ()

Rzuty
DeviceNotAvailableException

rebootIntoSideload

public void rebootIntoSideload (boolean autoReboot)

Parametry
autoReboot boolean

Rzuty
DeviceNotAvailableException

rebootUntilOnline

public void rebootUntilOnline ()

Rzuty
DeviceNotAvailableException

rebootUntilOnline

public void rebootUntilOnline (String reason)

Parametry
reason String

Rzuty
DeviceNotAvailableException

rebootUserspace

public void rebootUserspace ()

Rzuty
DeviceNotAvailableException

rebootUserspaceUntilOnline

public void rebootUserspaceUntilOnline ()

Rzuty
DeviceNotAvailableException

recoverDevice

public void recoverDevice ()

Próby przywrócenia komunikacji z urządzeniem.

Rzuty
DeviceNotAvailableException jeśli urządzenie nie jest już dostępne

remountSystemWritable

public void remountSystemWritable ()

Rzuty
DeviceNotAvailableException

remountVendorWritable

public void remountVendorWritable ()

Rzuty
DeviceNotAvailableException

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parametry
componentName String

userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

removeOwners

public void removeOwners ()

Rzuty
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

resetContentProviderSetup

public void resetContentProviderSetup ()

Zresetuj flagę konfiguracji dostawcy treści, aby ponownie ją uruchomić.

runInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                ITestLifeCycleReceiver... listeners)

Parametry
runner IRemoteAndroidTestRunner

listeners ITestLifeCycleReceiver

Zwroty
boolean

Rzuty
DeviceNotAvailableException

runInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Parametry
runner IRemoteAndroidTestRunner

listeners

Zwroty
boolean

Rzuty
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                ITestLifeCycleReceiver... listeners)

Parametry
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Zwroty
boolean

Rzuty
DeviceNotAvailableException

runInstrumentationTestsAsUser

public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, 
                int userId, 
                 listeners)

Parametry
runner IRemoteAndroidTestRunner

userId int

listeners

Zwroty
boolean

Rzuty
DeviceNotAvailableException

setConfiguration

public void setConfiguration (IConfiguration configuration)

Wstrzykuje IConfiguration w użyciu.

Parametry
configuration IConfiguration

setDate

public void setDate (Date date)

Parametry
date Date

Rzuty
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parametry
componentName String

userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

setDeviceState

public void setDeviceState (TestDeviceState deviceState)

Parametry
deviceState TestDeviceState

setEmulatorOutputStream

public void setEmulatorOutputStream (SizeLimitedOutputStream output)

W emulatorze ustaw SizeLimitedOutputStream na rejestrowanie danych wyjściowych.

Parametry
output SizeLimitedOutputStream: do rejestrowania danych wyjściowych

setEmulatorProcess

public void setEmulatorProcess (Process p)

Parametry
p Process

setFastbootEnabled

public void setFastbootEnabled (boolean fastbootEnabled)

Parametry
fastbootEnabled boolean

setFastbootPath

public void setFastbootPath (String fastbootPath)

Parametry
fastbootPath String

setIDevice

public void setIDevice (IDevice newDevice)

Parametry
newDevice IDevice

setOptions

public void setOptions (TestDeviceOptions options)

Parametry
options TestDeviceOptions

setProperty

public boolean setProperty (String propKey, 
                String propValue)

Parametry
propKey String

propValue String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

setRecovery

public void setRecovery (IDeviceRecovery recovery)

Parametry
recovery IDeviceRecovery

setRecoveryMode

public void setRecoveryMode (ITestDevice.RecoveryMode mode)

Parametry
mode ITestDevice.RecoveryMode

setSetting

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

Parametry
namespace String

key String

value String

Rzuty
DeviceNotAvailableException

setSetting

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

Parametry
userId int

namespace String

key String

value String

Rzuty
DeviceNotAvailableException

setUseFastbootErase

public void setUseFastbootErase (boolean useFastbootErase)

Parametry
useFastbootErase boolean

startLogcat

public void startLogcat ()

startUser

public boolean startUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

startUser

public boolean startUser (int userId, 
                boolean waitFlag)

Parametry
userId int

waitFlag boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

stopEmulatorOutput

public void stopEmulatorOutput ()

stopLogcat

public void stopLogcat ()

stopUser

public boolean stopUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

stopUser

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

Parametry
userId int

waitFlag boolean

forceFlag boolean

Zwroty
boolean

Rzuty
DeviceNotAvailableException

switchToAdbTcp

public String switchToAdbTcp ()

Zwroty
String

Rzuty
DeviceNotAvailableException

switchToAdbUsb

public boolean switchToAdbUsb ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId)

Parametry
userId int

Zwroty
boolean

Rzuty
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId, 
                long timeout)

Parametry
userId int

timeout long

Zwroty
boolean

Rzuty
DeviceNotAvailableException

syncFiles

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Parametry
localFileDir File

deviceFilePath String

Zwroty
boolean

Rzuty
DeviceNotAvailableException

takeBugreport

public Bugreport takeBugreport ()

Zwroty
Bugreport

unencryptDevice

public boolean unencryptDevice ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

uninstallPackage

public String uninstallPackage (String packageName)

Parametry
packageName String

Zwroty
String

Rzuty
DeviceNotAvailableException

uninstallPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parametry
packageName String

userId int

Zwroty
String

Rzuty
DeviceNotAvailableException

unlockDevice

public boolean unlockDevice ()

Zwroty
boolean

Rzuty
DeviceNotAvailableException

waitForBootComplete

public boolean waitForBootComplete (long timeOut)

Parametry
timeOut long

Zwroty
boolean

Rzuty
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable ()

Rzuty
DeviceNotAvailableException

waitForDeviceAvailable

public void waitForDeviceAvailable (long waitTime)

Parametry
waitTime long

Rzuty
DeviceNotAvailableException

waitForDeviceInRecovery

public boolean waitForDeviceInRecovery (long waitTime)

Parametry
waitTime long

Zwroty
boolean

waitForDeviceInSideload

public boolean waitForDeviceInSideload (long waitTime)

Parametry
waitTime long

Zwroty
boolean

waitForDeviceNotAvailable

public boolean waitForDeviceNotAvailable (long waitTime)

Parametry
waitTime long

Zwroty
boolean

waitForDeviceOnline

public void waitForDeviceOnline ()

Rzuty
DeviceNotAvailableException

waitForDeviceOnline

public void waitForDeviceOnline (long waitTime)

Parametry
waitTime long

Rzuty
DeviceNotAvailableException

waitForDeviceShell

public boolean waitForDeviceShell (long waitTime)

Parametry
waitTime long

Zwroty
boolean

Chronione metody

checkApiLevelAgainst

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

Parametry
feature String

strictMinLevel int

createRebootDeviceAction

protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, 
                String reason)

Utwórz RebootDeviceAction, który będzie używany podczas wykonywania działania ponownego uruchamiania.

Parametry
rebootMode NativeDevice.RebootMode: tryb ponownego uruchamiania.

reason String: w przypadku tego restartu.

Zwroty
NativeDevice.RebootDeviceAction utworzono RebootDeviceAction.

doAdbReboot

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

Uruchom ponownie urządzenie za pomocą adb.

Parametry
rebootMode NativeDevice.RebootMode: tryb ponownego uruchamiania.

reason String: w przypadku tego restartu.

Rzuty
DeviceNotAvailableException

ensureRuntimePermissionSupported

protected void ensureRuntimePermissionSupported ()

metoda pomocnicza do rzucania wyjątkiem, jeśli uprawnienia czasu działania nie są obsługiwane

Rzuty
DeviceNotAvailableException

getBugreportInternal

protected InputStreamSource getBugreportInternal ()

Zwroty
InputStreamSource

getBugreportzInternal

protected File getBugreportzInternal ()

Metoda pomocnicza wewnętrzna służąca do pobierania pliku zip z bugreportem jako ERROR(/File).

Zwroty
File

getRunUtil

protected IRunUtil getRunUtil ()

Uzyskaj instancję RunUtil, której chcesz użyć.

Zwroty
IRunUtil

internalGetProperty

protected String internalGetProperty (String propName, 
                String fastbootVar, 
                String description)

Pobierać właściwości urządzenia z domyślnej pamięci podręcznej ddmlib, a w razie potrzeby używać polecenia „adb shell getprop” lub „fastboot getvar” w zależności od tego, czy urządzenie jest w trybie Fastboot.

Parametry
propName String: nazwa właściwości urządzenia zwracana przez polecenie „adb shell getprop”

fastbootVar String: nazwa zmiennej fastboot, której dotyczy zapytanie. Jeśli jest to wartość null, nie będzie wysyłane zapytanie fastboot.

description String: prosty opis zmiennej. Pierwsza litera powinna być duża.

Zwroty
String Ciąg tekstowy, który może być null lub pusty, zawierający wartość danej właściwości.

Rzuty
DeviceNotAvailableException

isNewer

protected boolean isNewer (File localFile, 
                IFileEntry entry)

Zwraca true, jeśli plik lokalny jest nowszy niż plik zdalny. IFileEntry jest dokładny do minuty, a w przypadku równych czasów plik jest uznawany za nowszy.

Parametry
localFile File

entry IFileEntry

Zwroty
boolean

performDeviceAction

protected boolean performDeviceAction (String actionDescription, 
                com.android.tradefed.device.NativeDevice.DeviceAction action, 
                int retryAttempts)

Wykonywanie czynności na tym urządzeniu. Próbuje odzyskać urządzenie i opcjonalnie powtórzyć polecenie, jeśli działanie się nie powiedzie.

Parametry
actionDescription String: krótki opis działania, które należy wykonać. Służy tylko do celów rejestrowania.

action com.android.tradefed.device.NativeDevice.DeviceAction: działanie do wykonania

retryAttempts int: próby ponownego wykonania działania, jeśli nie powiodło się, ale odzyskanie się udało

Zwroty
boolean true, jeśli działanie zostało wykonane;

Rzuty
DeviceNotAvailableException jeśli próba odzyskania nie powiedzie się lub zostanie wykonana maksymalna liczba prób bez powodzenia

postAdbReboot

protected void postAdbReboot ()

Możliwe dodatkowe działania, które można wykonać po ponownym uruchomieniu.

Rzuty
DeviceNotAvailableException

prePostBootSetup

protected void prePostBootSetup ()

Umożliwia każdemu typowi urządzenia (AndroidNativeDevice, TestDevice) zastąpienie tej metody w przypadku określonej konfiguracji po uruchomieniu.

Rzuty
DeviceNotAvailableException

setClock

protected void setClock (Clock clock)

Ustaw instancję zegara, której chcesz używać.

Parametry
clock Clock

setLogStartDelay

protected void setLogStartDelay (int delay)

Określa czas (w milisekundach) oczekiwania przed rozpoczęciem przechwytywania logcat na urządzeniu online.

Parametry
delay int: opóźnienie w ms

waitForDeviceNotAvailable

protected void waitForDeviceNotAvailable (String operationDesc, 
                long time)

Parametry
operationDesc String

time long