Dispositivo nativo

public class NativeDevice
extends Object implements IManagedTestDevice, IConfigurationReceiver

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


Implementação padrão de um dispositivo Android ITestDevice que não é de pilha completa.

Resumo

Classes aninhadas

class NativeDevice.AdbAction

Um DeviceAction para executar um SO "adb ...." kubectl. 

class NativeDevice.AdbShellAction

 

class NativeDevice.RebootDeviceAction

DeviceAction para reinicializar um dispositivo. 

enum NativeDevice.RebootMode

Um modo de reinicialização. 

Constantes

int INVALID_USER_ID

Valor retornado para qualquer ID de usuário inválido/não encontrado: UserHandle definiu o valor -10000

long MAX_HOST_DEVICE_TIME_OFFSET

int MAX_RETRY_ATTEMPTS

o número padrão de tentativas de repetição do comando a serem executadas

Campos

protected static final String SD_CARD

protected static final String STORAGE_EMULATED

protected TestDeviceOptions mOptions

protected final IDeviceStateMonitor mStateMonitor

Construtores públicos

NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)

Cria um TestDevice.

Métodos públicos

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

O registro que contém todos os registros 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)

Assistente não oficial para receber um FileEntry de um caminho não raiz.

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)

Processar o DeviceEvent, que pode ou não fazer a transição deste dispositivo para uma nova alocação estado.

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

Modifique se o dispositivo precisar que algumas ações específicas sejam realizadas após o adb root e antes do dispositivo está on-line novamente.

void postAdbUnrootAction()

Substituir se o dispositivo precisar que algumas ações específicas sejam realizadas depois do adb unroot e antes o dispositivo ficará on-line novamente.

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

Tenta recuperar a comunicação do dispositivo.

void remountSystemWritable()

void remountVendorWritable()

boolean removeAdmin(String componentName, int userId)

void removeOwners()

boolean removeUser(int userId)

void resetContentProviderSetup()

Redefina a flag de configuração do provedor de conteúdo para acioná-la novamente.

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)

Injeta o IConfiguration em uso.

void setDate(Date date)

boolean setDeviceOwner(String componentName, int userId)

void setDeviceState(TestDeviceState deviceState)

void setEmulatorOutputStream(SizeLimitedOutputStream output)

Para o emulador, defina SizeLimitedOutputStream para registrar a saída

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)

Métodos protegidos

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

Crie um RebootDeviceAction para ser usado ao executar uma ação de reinicialização.

void doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)

Execute uma reinicialização do adb.

void ensureRuntimePermissionSupported()

método auxiliar para gerar uma exceção se a permissão de tempo de execução não for compatível

InputStreamSource getBugreportInternal()
File getBugreportzInternal()

Método auxiliar interno para receber o arquivo ZIP do bugreportz como um ERROR(/File).

IRunUtil getRunUtil()

Consiga a instância RunUtil a ser usada.

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

Busca uma propriedade do dispositivo no cache ddmlib por padrão e volta para o adb shell getprop` ou `fastboot getvar`, dependendo se o dispositivo está ou não em fastboot.

boolean isNewer(File localFile, IFileEntry entry)

Retorne true se o arquivo local for mais recente que o arquivo remoto.

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

Executa uma ação neste dispositivo.

void postAdbReboot()

Possíveis ações extras que podem ser realizadas após uma reinicialização.

void prePostBootSetup()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) modifique esse método para configuração específica pós-inicialização.

void setClock(Clock clock)

Define a instância do Relógio a ser usada.

void setLogStartDelay(int delay)

Define o tempo em ms de espera antes de iniciar a captura do logcat para um dispositivo on-line.

void waitForDeviceNotAvailable(String operationDesc, long time)

Constantes

INVALID_USER_ID

public static final int INVALID_USER_ID

Valor retornado para qualquer ID de usuário inválido/não encontrado: UserHandle definiu o valor -10000

Valor constante: -10.000 (0xffffd8f0)

MAX_HOST_DEVICE_TIME_OFFSET

protected static final long MAX_HOST_DEVICE_TIME_OFFSET

Valor constante: 5.000 (0x0000000000001388)

MAX_RETRY_ATTEMPTS

protected static final int MAX_RETRY_ATTEMPTS

o número padrão de tentativas de repetição do comando a serem executadas

Valor constante: 2 (0x00000002)

Campos

Cartão SD

protected static final String SD_CARD

STORAGE_EMULATED

protected static final String STORAGE_EMULATED

Opções

protected TestDeviceOptions mOptions

mStateMonitor

protected final IDeviceStateMonitor mStateMonitor

Construtores públicos

Dispositivo nativo

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

Cria um TestDevice.

Parâmetros
device IDevice: o IDevice associado

stateMonitor IDeviceStateMonitor: o mecanismo IDeviceStateMonitor a ser usado.

allocationMonitor IDeviceMonitor: o IDeviceMonitor para informar sobre mudanças no estado de alocação. Pode ser nulo

Métodos públicos

checkApiLevelAgainstNextRelease

public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)

Parâmetros
strictMinLevel int

Retorna
boolean

Gera
DeviceNotAvailableException

verificarConectividade

public boolean checkConnectivity ()

Retorna
boolean

Gera
DeviceNotAvailableException

ClearErrorDialogs

public boolean clearErrorDialogs ()

Retorna
boolean

Gera
DeviceNotAvailableException

ClearLastConnectedWiFiNetwork

public void clearLastConnectedWifiNetwork ()

limparLogcat

public void clearLogcat ()

conectar à rede Wi-Fi

public boolean connectToWifiNetwork (String wifiSsid, 
                String wifiPsk)

Parâmetros
wifiSsid String

wifiPsk String

Retorna
boolean

Gera
DeviceNotAvailableException

conectar à rede Wi-Fi

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

Parâmetros
wifiSsid String

wifiPsk String

scanSsid boolean

Retorna
boolean

Gera
DeviceNotAvailableException

conectar aRedeWiFiSeÉ necessário

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

Parâmetros
wifiSsid String

wifiPsk String

scanSsid boolean

Retorna
boolean

Gera
DeviceNotAvailableException

conectar aRedeWiFiSeÉ necessário

public boolean connectToWifiNetworkIfNeeded (String wifiSsid, 
                String wifiPsk)

Parâmetros
wifiSsid String

wifiPsk String

Retorna
boolean

Gera
DeviceNotAvailableException

usuário

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

Parâmetros
name String

guest boolean

ephemeral boolean

Retorna
int

Gera
DeviceNotAvailableException

usuário

public int createUser (String name)

Parâmetros
name String

Retorna
int

Gera
DeviceNotAvailableException

createUserNoThrow

public int createUserNoThrow (String name)

Parâmetros
name String

Retorna
int

Gera
DeviceNotAvailableException

deleteFile

public void deleteFile (String deviceFilePath)

Parâmetros
deviceFilePath String

Gera
DeviceNotAvailableException

deviceSoftReiniciado

public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)

Parâmetros
prevSystemServerProcess ProcessInfo

Retorna
boolean

Gera
DeviceNotAvailableException

deviceSoftRestartedSince

public boolean deviceSoftRestartedSince (long utcEpochTime, 
                TimeUnit timeUnit)

Parâmetros
utcEpochTime long

timeUnit TimeUnit

Retorna
boolean

Gera
DeviceNotAvailableException

desativarAdbRoot

public boolean disableAdbRoot ()

Retorna
boolean

Gera
DeviceNotAvailableException

desativarKeyguard

public void disableKeyguard ()

Gera
DeviceNotAvailableException

desativarNetworkMonitor

public boolean disableNetworkMonitor ()

Retorna
boolean

Gera
DeviceNotAvailableException

desconectarDoWi-Fi

public boolean disconnectFromWifi ()

Retorna
boolean

Gera
DeviceNotAvailableException

fazFileExist

public boolean doesFileExist (String deviceFilePath)

Parâmetros
deviceFilePath String

Retorna
boolean

Gera
DeviceNotAvailableException

dumpHeap

public File dumpHeap (String process, 
                String devicePath)

Parâmetros
process String

devicePath String

Retorna
File

Gera
DeviceNotAvailableException

enableAdbRoot

public boolean enableAdbRoot ()

Retorna
boolean

Gera
DeviceNotAvailableException

enableNetworkMonitor

public boolean enableNetworkMonitor ()

Retorna
boolean

Gera
DeviceNotAvailableException

encryptionDevice

public boolean encryptDevice (boolean inplace)

Parâmetros
inplace boolean

Retorna
boolean

Gera
DeviceNotAvailableException

executeAdbCommand

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

Parâmetros
timeout long

cmdArgs String

Retorna
String

Gera
DeviceNotAvailableException

executeAdbCommand

public String executeAdbCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Retorna
String

Gera
DeviceNotAvailableException

executeFastbootCommand

public CommandResult executeFastbootCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeFastbootCommand

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

Parâmetros
timeout long

cmdArgs String

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeLongFastbootCommand

public CommandResult executeLongFastbootCommand (String... cmdArgs)

Parâmetros
cmdArgs String

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellCommand

public String executeShellCommand (String command)

Parâmetros
command String

Retorna
String

Gera
DeviceNotAvailableException

executeShellCommand

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

Parâmetros
command String

receiver IShellOutputReceiver

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Gera
DeviceNotAvailableException

executeShellCommand

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

Parâmetros
command String

receiver IShellOutputReceiver

maxTimeoutForCommand long

maxTimeToOutputShellResponse long

timeUnit TimeUnit

retryAttempts int

Gera
DeviceNotAvailableException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Parâmetros
command String

receiver IShellOutputReceiver

Gera
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd)

Parâmetros
cmd String

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                OutputStream pipeToOutput)

Parâmetros
cmd String

pipeToOutput OutputStream

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

public CommandResult executeShellV2Command (String cmd, 
                File pipeAsInput)

Parâmetros
cmd String

pipeAsInput File

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

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

Parâmetros
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

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

Parâmetros
cmd String

maxTimeoutForCommand long

timeUnit TimeUnit

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

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

Parâmetros
cmd String

pipeAsInput File

pipeToOutput OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Retorna
CommandResult

Gera
DeviceNotAvailableException

executeShellV2Command

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

Parâmetros
cmd String

pipeAsInput File

pipeToOutput OutputStream

pipeToError OutputStream

maxTimeoutForCommand long

timeUnit TimeUnit

retryAttempts int

Retorna
CommandResult

Gera
DeviceNotAvailableException

fastbootWipePartition

public CommandResult fastbootWipePartition (String partition)

Parâmetros
partition String

Retorna
CommandResult

Gera
DeviceNotAvailableException

getActiveApexes

public  getActiveApexes ()

Retorna

Gera
DeviceNotAvailableException

getAllSettings

public  getAllSettings (String namespace)

Parâmetros
namespace String

Retorna

Gera
DeviceNotAvailableException

getAllocationState

public DeviceAllocationState getAllocationState ()

Retorna
DeviceAllocationState

getAndroidId

public String getAndroidId (int userId)

Parâmetros
userId int

Retorna
String

Gera
DeviceNotAvailableException

getAndroidIds

public  getAndroidIds ()

Retorna

Gera
DeviceNotAvailableException

getApiLevel

public int getApiLevel ()

Retorna
int

Gera
DeviceNotAvailableException

getAppPackageInfo

public PackageInfo getAppPackageInfo (String packageName)

Parâmetros
packageName String

Retorna
PackageInfo

Gera
DeviceNotAvailableException

getAppPackageInfos

public  getAppPackageInfos ()

Retorna

Gera
DeviceNotAvailableException

getBasebandVersion

public String getBasebandVersion ()

Retorna
String

Gera
DeviceNotAvailableException

getBateria

public Integer getBattery ()

Retorna
Integer

getBooleanProperty

public boolean getBooleanProperty (String name, 
                boolean defaultValue)

Parâmetros
name String

defaultValue boolean

Retorna
boolean

Gera
DeviceNotAvailableException

getBootHistory

public  getBootHistory ()

Retorna

Gera
DeviceNotAvailableException

getbootHistorySince

public  getBootHistorySince (long utcEpochTime, 
                TimeUnit timeUnit)

Parâmetros
utcEpochTime long

timeUnit TimeUnit

Retorna

Gera
DeviceNotAvailableException

getBootloaderVersion

public String getBootloaderVersion ()

Retorna
String

Gera
DeviceNotAvailableException

getBugreport

public InputStreamSource getBugreport ()

Retorna
InputStreamSource

getBugreportz

public InputStreamSource getBugreportz ()

Retorna
InputStreamSource

getBuildAlias

public String getBuildAlias ()

Retorna
String

Gera
DeviceNotAvailableException

getBuildFlavor

public String getBuildFlavor ()

Retorna
String

Gera
DeviceNotAvailableException

getBuildId

public String getBuildId ()

Retorna
String

Gera
DeviceNotAvailableException

getBuildSigningKeys

public String getBuildSigningKeys ()

Retorna
String

Gera
DeviceNotAvailableException

getCachedDeviceDescriptor

public DeviceDescriptor getCachedDeviceDescriptor ()

Retorna
DeviceDescriptor

getChildren

public String[] getChildren (String path)

Parâmetros
path String

Retorna
String[]

Gera
DeviceNotAvailableException

getCurrentFoldableState

public DeviceFoldableState getCurrentFoldableState ()

Retorna
DeviceFoldableState

Gera
DeviceNotAvailableException

getCurrentUser

public int getCurrentUser ()

Retorna
int

Gera
DeviceNotAvailableException

getDeviceClass

public String getDeviceClass ()

Retorna
String

getDeviceDate

public long getDeviceDate ()

Retorna
long

Gera
DeviceNotAvailableException

getDeviceDescriptor

public DeviceDescriptor getDeviceDescriptor ()

Retorna
DeviceDescriptor

getDeviceState

public TestDeviceState getDeviceState ()

Retorna
TestDeviceState

getDeviceTimeShift

public long getDeviceTimeOffset (Date date)

Parâmetros
date Date

Retorna
long

Gera
DeviceNotAvailableException

getEmulatorOutput

public InputStreamSource getEmulatorOutput ()

Retorna
InputStreamSource

getEmulatorProcess

public Process getEmulatorProcess ()

Retorna
Process

getExecuteShellCommandLog

public final File getExecuteShellCommandLog ()

O registro que contém todos os registros executeShellCommand(String).

Retorna
File

getExternalStoreFreeSpace

public long getExternalStoreFreeSpace ()

Retorna
long

Gera
DeviceNotAvailableException

getFastbootPath

public String getFastbootPath ()

Retorna
String

getFastbootProductType

public String getFastbootProductType ()

Retorna
String

Gera
DeviceNotAvailableException

getFastbootProductVariant

public String getFastbootProductVariant ()

Retorna
String

Gera
DeviceNotAvailableException

getFastbootSerialNumber

public String getFastbootSerialNumber ()

Retorna
String

getFastbootVariable

public String getFastbootVariable (String variableName)

Parâmetros
variableName String

Retorna
String

Gera
DeviceNotAvailableException

getFastbootVersion

public String getFastbootVersion ()

Retorna
String

getFileEntry

public IFileEntry getFileEntry (String path)

Parâmetros
path String

Retorna
IFileEntry

Gera
DeviceNotAvailableException

getFileEntry

public IFileEntry getFileEntry (FileListingService.FileEntry entry)

Assistente não oficial para receber um FileEntry de um caminho não raiz. FIXME: refatore o sistema FileEntry para disponibilizá-lo em qualquer caminho. (mesmo sem raiz).

Parâmetros
entry FileListingService.FileEntry: um FileEntry não necessariamente raiz, conforme exigido pela Ddmlib.

Retorna
IFileEntry um FileEntryWrapper que representa a FileEntry.

Gera
DeviceNotAvailableException

getFoldableStates

public  getFoldableStates ()

Retorna

Gera
DeviceNotAvailableException

getIDevice

public IDevice getIDevice ()

Retorna
IDevice

getInstallPackageNames

public  getInstalledPackageNames ()

Retorna

Gera
DeviceNotAvailableException

getIntProperty

public long getIntProperty (String name, 
                long defaultValue)

Parâmetros
name String

defaultValue long

Retorna
long

Gera
DeviceNotAvailableException

getIpAddress

public String getIpAddress ()

Retorna
String

Gera
DeviceNotAvailableException

getKeyguardState

public KeyguardControllerState getKeyguardState ()

Retorna
KeyguardControllerState

Gera
DeviceNotAvailableException

getLastesperaRestartTimeMillis

public long getLastExpectedRebootTimeMillis ()

Retorna
long

getLaunchApiLevel

public int getLaunchApiLevel ()

Retorna
int

Gera
DeviceNotAvailableException

getLogcat

public InputStreamSource getLogcat ()

Retorna
InputStreamSource

getLogcat

public InputStreamSource getLogcat (int maxBytes)

Parâmetros
maxBytes int

Retorna
InputStreamSource

getLogcatDump

public InputStreamSource getLogcatDump ()

Retorna
InputStreamSource

getLogcatSince

public InputStreamSource getLogcatSince (long date)

Parâmetros
date long

Retorna
InputStreamSource

getMacAddress

public String getMacAddress ()

Retorna
String

getMainlineModuleInfo

public  getMainlineModuleInfo ()

Retorna

Gera
DeviceNotAvailableException

getMaxNumberOfRunningUsersAllowed

public int getMaxNumberOfRunningUsersSupported ()

Retorna
int

Gera
DeviceNotAvailableException

getMaxNumberOfUsersAllowed

public int getMaxNumberOfUsersSupported ()

Retorna
int

Gera
DeviceNotAvailableException

getMonitor

public IDeviceStateMonitor getMonitor ()

Retorna
IDeviceStateMonitor

getMountPoint

public String getMountPoint (String mountName)

Parâmetros
mountName String

Retorna
String

getMountPointInfo

public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)

Parâmetros
mountpoint String

Retorna
ITestDevice.MountPointInfo

Gera
DeviceNotAvailableException

getMountPointInfo

public  getMountPointInfo ()

Retorna

Gera
DeviceNotAvailableException

getOptions

public TestDeviceOptions getOptions ()

Retorna
TestDeviceOptions

getPartitionFreeSpace

public long getPartitionFreeSpace (String partition)

Parâmetros
partition String

Retorna
long

Gera
DeviceNotAvailableException

getPrimaryUserId

public Integer getPrimaryUserId ()

Retorna
Integer

Gera
DeviceNotAvailableException

getProcessByName

public ProcessInfo getProcessByName (String processName)

Parâmetros
processName String

Retorna
ProcessInfo

Gera
DeviceNotAvailableException

getProcessPid

public String getProcessPid (String process)

Parâmetros
process String

Retorna
String

Gera
DeviceNotAvailableException

getProductType

public String getProductType ()

Retorna
String

Gera
DeviceNotAvailableException

getProductVariant

public String getProductVariant ()

Retorna
String

Gera
DeviceNotAvailableException

getProperty

public String getProperty (String name)

Parâmetros
name String

Retorna
String

Gera
DeviceNotAvailableException

getRecoveryMode

public ITestDevice.RecoveryMode getRecoveryMode ()

Retorna
ITestDevice.RecoveryMode

getCaptura de tela

public InputStreamSource getScreenshot (String format)

Parâmetros
format String

Retorna
InputStreamSource

Gera
DeviceNotAvailableException

getCaptura de tela

public InputStreamSource getScreenshot (long displayId)

Parâmetros
displayId long

Retorna
InputStreamSource

Gera
DeviceNotAvailableException

getCaptura de tela

public InputStreamSource getScreenshot (String format, 
                boolean rescale)

Parâmetros
format String

rescale boolean

Retorna
InputStreamSource

Gera
DeviceNotAvailableException

getCaptura de tela

public InputStreamSource getScreenshot ()

Retorna
InputStreamSource

Gera
DeviceNotAvailableException

getSerialNumber

public String getSerialNumber ()

Retorna
String

getSetting

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

Parâmetros
userId int

namespace String

key String

Retorna
String

Gera
DeviceNotAvailableException

getSetting

public String getSetting (String namespace, 
                String key)

Parâmetros
namespace String

key String

Retorna
String

Gera
DeviceNotAvailableException

getSimOperator

public String getSimOperator ()

Retorna
String

getSimState

public String getSimState ()

Retorna
String

getTombstones

public  getTombstones ()

Retorna

Gera
DeviceNotAvailableException

getTotalMemory

public long getTotalMemory ()

Retorna
long

getUninstallablePackageNames

public  getUninstallablePackageNames ()

Retorna

Gera
DeviceNotAvailableException

getUseFastbootApagar

public boolean getUseFastbootErase ()

Retorna
boolean

getUserFlags

public int getUserFlags (int userId)

Parâmetros
userId int

Retorna
int

Gera
DeviceNotAvailableException

getUserInfos

public  getUserInfos ()

Retorna

Gera
DeviceNotAvailableException

getUserSerialNumber

public int getUserSerialNumber (int userId)

Parâmetros
userId int

Retorna
int

Gera
DeviceNotAvailableException

handleAllocationEvent

public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)

Processar o DeviceEvent, que pode ou não fazer a transição deste dispositivo para uma nova alocação estado.

Parâmetros
event DeviceEvent

Retorna
IManagedTestDevice.DeviceEventResponse

hasFeature

public boolean hasFeature (String feature)

Parâmetros
feature String

Retorna
boolean

Gera
DeviceNotAvailableException

installPackage

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

Parâmetros
packageFile File

reinstall boolean

extraArgs String

Retorna
String

Gera
DeviceNotAvailableException

installPackage

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

Parâmetros
packageFile File

reinstall boolean

grantPermissions boolean

extraArgs String

Retorna
String

Gera
DeviceNotAvailableException

installPackageForUser

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

Parâmetros
packageFile File

reinstall boolean

userId int

extraArgs String

Retorna
String

Gera
DeviceNotAvailableException

installPackageForUser

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

Parâmetros
packageFile File

reinstall boolean

grantPermissions boolean

userId int

extraArgs String

Retorna
String

Gera
DeviceNotAvailableException

AdbRoot

public boolean isAdbRoot ()

Retorna
boolean

Gera
DeviceNotAvailableException

isAdbTcp

public boolean isAdbTcp ()

Retorna
boolean

isAppEnumerationsupported

public boolean isAppEnumerationSupported ()

Retorna
boolean

Gera
DeviceNotAvailableException

IsDeviceEncrypted

public boolean isDeviceEncrypted ()

Retorna
boolean

Gera
DeviceNotAvailableException

Diretório isDirectory

public boolean isDirectory (String path)

Parâmetros
path String

Retorna
boolean

Gera
DeviceNotAvailableException

isEnableAdbRoot

public boolean isEnableAdbRoot ()

Retorna
boolean true se a raiz do adb precisar ser ativada no dispositivo.

isEncryptionsupported

public boolean isEncryptionSupported ()

Retorna
boolean

Gera
DeviceNotAvailableException

IsExecutável

public boolean isExecutable (String fullPath)

Parâmetros
fullPath String

Retorna
boolean

Gera
DeviceNotAvailableException

isFastbootEnabled

public boolean isFastbootEnabled ()

Retorna
boolean

isHeadless

public boolean isHeadless ()

Retorna
boolean

Gera
DeviceNotAvailableException

isMultiUsersupported

public boolean isMultiUserSupported ()

Retorna
boolean

Gera
DeviceNotAvailableException

isPackageInstall

public boolean isPackageInstalled (String packageName, 
                String userId)

Parâmetros
packageName String

userId String

Retorna
boolean

Gera
DeviceNotAvailableException

isPackageInstall

public boolean isPackageInstalled (String packageName)

Parâmetros
packageName String

Retorna
boolean

Gera
DeviceNotAvailableException

isRuntimePermissionAllowed

public boolean isRuntimePermissionSupported ()

Retorna
boolean

Gera
DeviceNotAvailableException

isStatebootloaderOrFastbootd

public boolean isStateBootloaderOrFastbootd ()

Retorna
boolean

isUserRunning

public boolean isUserRunning (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

Secundário do usuário

public boolean isUserSecondary (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

Compatível com Wi-Fi

public boolean isWifiEnabled ()

Retorna
boolean

Gera
DeviceNotAvailableException

listDisplayIds

public  listDisplayIds ()

Retorna

Gera
DeviceNotAvailableException

listUsers

public  listUsers ()

Retorna

Gera
DeviceNotAvailableException

relatório do bug

public boolean logBugreport (String dataName, 
                ITestLogger listener)

Parâmetros
dataName String

listener ITestLogger

Retorna
boolean

LogOnDevice

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

Parâmetros
tag String

level Log.LogLevel

format String

args Object

nonBlockingReiniciar

public void nonBlockingReboot ()

Gera
DeviceNotAvailableException

postAdbRootAction

public void postAdbRootAction ()

Modifique se o dispositivo precisar que algumas ações específicas sejam realizadas após o adb root e antes do dispositivo está on-line novamente. A implementação padrão não inclui ações de adição. Não há garantia de que a raiz do adb esteja ativada nesta etapa.

Gera
DeviceNotAvailableException

postAdbUnrootAction

public void postAdbUnrootAction ()

Substituir se o dispositivo precisar que algumas ações específicas sejam realizadas depois do adb unroot e antes o dispositivo ficará on-line novamente. A implementação padrão não inclui outras ações. Não há garantia de que a raiz do adb será desativada nesta etapa.

Gera
DeviceNotAvailableException

pós-inicialização

public void postBootSetup ()

Gera
DeviceNotAvailableException

postInvocationTearDown

public void postInvocationTearDown (Throwable exception)

Parâmetros
exception Throwable

Configuração preInvocation

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

Parâmetros
info IBuildInfo

attributes MultiMap

Gera
DeviceNotAvailableException
TargetSetupError

PullDir

public boolean pullDir (String deviceFilePath, 
                File localDir)

Parâmetros
deviceFilePath String

localDir File

Retorna
boolean

Gera
DeviceNotAvailableException

pullFile

public boolean pullFile (String remoteFilePath, 
                File localFile)

Parâmetros
remoteFilePath String

localFile File

Retorna
boolean

Gera
DeviceNotAvailableException

pullFile

public File pullFile (String remoteFilePath)

Parâmetros
remoteFilePath String

Retorna
File

Gera
DeviceNotAvailableException

pullFileContents

public String pullFileContents (String remoteFilePath)

Parâmetros
remoteFilePath String

Retorna
String

Gera
DeviceNotAvailableException

pullFileFromExternal

public File pullFileFromExternal (String remoteFilePath)

Parâmetros
remoteFilePath String

Retorna
File

Gera
DeviceNotAvailableException

pushDir

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

Parâmetros
localFileDir File

deviceFilePath String

excludedDirectories

Retorna
boolean

Gera
DeviceNotAvailableException

pushDir

public boolean pushDir (File localFileDir, 
                String deviceFilePath)

Parâmetros
localFileDir File

deviceFilePath String

Retorna
boolean

Gera
DeviceNotAvailableException

pushFile

public boolean pushFile (File localFile, 
                String remoteFilePath)

Parâmetros
localFile File

remoteFilePath String

Retorna
boolean

Gera
DeviceNotAvailableException

pushString

public boolean pushString (String contents, 
                String remoteFilePath)

Parâmetros
contents String

remoteFilePath String

Retorna
boolean

Gera
DeviceNotAvailableException

reiniciar

public void reboot (String reason)

Parâmetros
reason String

Gera
DeviceNotAvailableException

reiniciar

public void reboot ()

Gera
DeviceNotAvailableException

Reinicializar o carregador de inicialização

public void rebootIntoBootloader ()

Gera
DeviceNotAvailableException

reinicializarIntoFastbootd

public void rebootIntoFastbootd ()

Gera
DeviceNotAvailableException

reinicializarIntoRecovery

public void rebootIntoRecovery ()

Gera
DeviceNotAvailableException

reinicializarIntoSideload

public void rebootIntoSideload ()

Gera
DeviceNotAvailableException

reinicializarIntoSideload

public void rebootIntoSideload (boolean autoReboot)

Parâmetros
autoReboot boolean

Gera
DeviceNotAvailableException

reinicializarUntilOnline

public void rebootUntilOnline ()

Gera
DeviceNotAvailableException

reinicializarUntilOnline

public void rebootUntilOnline (String reason)

Parâmetros
reason String

Gera
DeviceNotAvailableException

Reinicializar espaço do usuário

public void rebootUserspace ()

Gera
DeviceNotAvailableException

reinicializarUserspaceUntilOnline

public void rebootUserspaceUntilOnline ()

Gera
DeviceNotAvailableException

recupereDispositivo

public void recoverDevice ()

Tenta recuperar a comunicação do dispositivo.

Gera
DeviceNotAvailableException se o dispositivo não estiver mais disponível

remountSystemWritable

public void remountSystemWritable ()

Gera
DeviceNotAvailableException

remountVendorWritable

public void remountVendorWritable ()

Gera
DeviceNotAvailableException

removeAdmin

public boolean removeAdmin (String componentName, 
                int userId)

Parâmetros
componentName String

userId int

Retorna
boolean

Gera
DeviceNotAvailableException

removeOwners

public void removeOwners ()

Gera
DeviceNotAvailableException

removeUser

public boolean removeUser (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

resetContentProviderConfigurar

public void resetContentProviderSetup ()

Redefina a flag de configuração do provedor de conteúdo para acioná-la novamente.

runInstrumentationTests

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

Parâmetros
runner IRemoteAndroidTestRunner

listeners ITestLifeCycleReceiver

Retorna
boolean

Gera
DeviceNotAvailableException

runInstrumentationTests

public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, 
                 listeners)

Parâmetros
runner IRemoteAndroidTestRunner

listeners

Retorna
boolean

Gera
DeviceNotAvailableException

runInstrumentationTestsAsUser

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

Parâmetros
runner IRemoteAndroidTestRunner

userId int

listeners ITestLifeCycleReceiver

Retorna
boolean

Gera
DeviceNotAvailableException

runInstrumentationTestsAsUser

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

Parâmetros
runner IRemoteAndroidTestRunner

userId int

listeners

Retorna
boolean

Gera
DeviceNotAvailableException

setConfiguration

public void setConfiguration (IConfiguration configuration)

Injeta o IConfiguration em uso.

Parâmetros
configuration IConfiguration

definirData

public void setDate (Date date)

Parâmetros
date Date

Gera
DeviceNotAvailableException

setDeviceOwner

public boolean setDeviceOwner (String componentName, 
                int userId)

Parâmetros
componentName String

userId int

Retorna
boolean

Gera
DeviceNotAvailableException

setDeviceState

public void setDeviceState (TestDeviceState deviceState)

Parâmetros
deviceState TestDeviceState

setEmulatorOutputStream

public void setEmulatorOutputStream (SizeLimitedOutputStream output)

Para o emulador, defina SizeLimitedOutputStream para registrar a saída

Parâmetros
output SizeLimitedOutputStream: para registrar a saída.

setEmulatorProcess

public void setEmulatorProcess (Process p)

Parâmetros
p Process

setFastbootEnabled

public void setFastbootEnabled (boolean fastbootEnabled)

Parâmetros
fastbootEnabled boolean

setFastbootPath

public void setFastbootPath (String fastbootPath)

Parâmetros
fastbootPath String

setIDevice

public void setIDevice (IDevice newDevice)

Parâmetros
newDevice IDevice

setOptions

public void setOptions (TestDeviceOptions options)

Parâmetros
options TestDeviceOptions

setProperty

public boolean setProperty (String propKey, 
                String propValue)

Parâmetros
propKey String

propValue String

Retorna
boolean

Gera
DeviceNotAvailableException

setRecovery

public void setRecovery (IDeviceRecovery recovery)

Parâmetros
recovery IDeviceRecovery

setRecoveryMode

public void setRecoveryMode (ITestDevice.RecoveryMode mode)

Parâmetros
mode ITestDevice.RecoveryMode

setSetting

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

Parâmetros
namespace String

key String

value String

Gera
DeviceNotAvailableException

setSetting

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

Parâmetros
userId int

namespace String

key String

value String

Gera
DeviceNotAvailableException

definirUsarFastbootLimpar

public void setUseFastbootErase (boolean useFastbootErase)

Parâmetros
useFastbootErase boolean

startLogcat

public void startLogcat ()

usuáriode inicialização

public boolean startUser (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

usuáriode inicialização

public boolean startUser (int userId, 
                boolean waitFlag)

Parâmetros
userId int

waitFlag boolean

Retorna
boolean

Gera
DeviceNotAvailableException

stopEmulatorOutput

public void stopEmulatorOutput ()

stopLogcat

public void stopLogcat ()

stopUser

public boolean stopUser (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

stopUser

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

Parâmetros
userId int

waitFlag boolean

forceFlag boolean

Retorna
boolean

Gera
DeviceNotAvailableException

switchToAdbTcp

public String switchToAdbTcp ()

Retorna
String

Gera
DeviceNotAvailableException

switchToAdbUsb

public boolean switchToAdbUsb ()

Retorna
boolean

Gera
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId)

Parâmetros
userId int

Retorna
boolean

Gera
DeviceNotAvailableException

switchUser

public boolean switchUser (int userId, 
                long timeout)

Parâmetros
userId int

timeout long

Retorna
boolean

Gera
DeviceNotAvailableException

syncFiles

public boolean syncFiles (File localFileDir, 
                String deviceFilePath)

Parâmetros
localFileDir File

deviceFilePath String

Retorna
boolean

Gera
DeviceNotAvailableException

Relatório TakeBug

public Bugreport takeBugreport ()

Retorna
Bugreport

UnencryptDevice

public boolean unencryptDevice ()

Retorna
boolean

Gera
DeviceNotAvailableException

desinstalarPackage

public String uninstallPackage (String packageName)

Parâmetros
packageName String

Retorna
String

Gera
DeviceNotAvailableException

desinstalarPackageForUser

public String uninstallPackageForUser (String packageName, 
                int userId)

Parâmetros
packageName String

userId int

Retorna
String

Gera
DeviceNotAvailableException

desbloquearDispositivo

public boolean unlockDevice ()

Retorna
boolean

Gera
DeviceNotAvailableException

"waitForBootComplete"

public boolean waitForBootComplete (long timeOut)

Parâmetros
timeOut long

Retorna
boolean

Gera
DeviceNotAvailableException

"waitForDeviceAvailable"

public void waitForDeviceAvailable ()

Gera
DeviceNotAvailableException

"waitForDeviceAvailable"

public void waitForDeviceAvailable (long waitTime)

Parâmetros
waitTime long

Gera
DeviceNotAvailableException

"waitForDeviceInRecovery"

public boolean waitForDeviceInRecovery (long waitTime)

Parâmetros
waitTime long

Retorna
boolean

"waitForDeviceInSideload"

public boolean waitForDeviceInSideload (long waitTime)

Parâmetros
waitTime long

Retorna
boolean

"waitForDeviceNotAvailable"

public boolean waitForDeviceNotAvailable (long waitTime)

Parâmetros
waitTime long

Retorna
boolean

"waitForDeviceOnline"

public void waitForDeviceOnline ()

Gera
DeviceNotAvailableException

"waitForDeviceOnline"

public void waitForDeviceOnline (long waitTime)

Parâmetros
waitTime long

Gera
DeviceNotAvailableException

"waitForDeviceShell"

public boolean waitForDeviceShell (long waitTime)

Parâmetros
waitTime long

Retorna
boolean

Métodos protegidos

checkApiLevelAgainst

protected void checkApiLevelAgainst (String feature, 
                int strictMinLevel)

Parâmetros
feature String

strictMinLevel int

createReiniciarDeviceAction

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

Crie um RebootDeviceAction para ser usado ao executar uma ação de reinicialização.

Parâmetros
rebootMode NativeDevice.RebootMode: um modo da reinicialização.

reason String: para esta reinicialização.

Retorna
NativeDevice.RebootDeviceAction o RebootDeviceAction criado.

doAdbReiniciar

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

Execute uma reinicialização do adb.

Parâmetros
rebootMode NativeDevice.RebootMode: um modo da reinicialização.

reason String: para esta reinicialização.

Gera
DeviceNotAvailableException

certifiqueRuntimePermissionAllowed

protected void ensureRuntimePermissionSupported ()

método auxiliar para gerar uma exceção se a permissão de tempo de execução não for compatível

Gera
DeviceNotAvailableException

getBugreportInternal

protected InputStreamSource getBugreportInternal ()

Retorna
InputStreamSource

getBugreportzInternal

protected File getBugreportzInternal ()

Método auxiliar interno para receber o arquivo ZIP do bugreportz como um ERROR(/File).

Retorna
File

getRunUtil

protected IRunUtil getRunUtil ()

Consiga a instância RunUtil a ser usada.

Retorna
IRunUtil

internalGetProperty

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

Busca uma propriedade do dispositivo no cache ddmlib por padrão e volta para o adb shell getprop` ou `fastboot getvar`, dependendo se o dispositivo está ou não em fastboot.

Parâmetros
propName String: o nome da propriedade do dispositivo conforme retornado por "adb shell getprop".

fastbootVar String: o nome da variável fastboot equivalente a ser consultada. se for null, a consulta fastboot não será tentada

description String: uma descrição simples da variável. A primeira letra deve estar em maiúscula.

Retorna
String Uma string, possivelmente null ou vazia, contendo o valor da propriedade especificada

Gera
DeviceNotAvailableException

IsNewer

protected boolean isNewer (File localFile, 
                IFileEntry entry)

Retorne true se o arquivo local for mais recente que o arquivo remoto. IFileEntry sendo o minuto, no caso de horários iguais, o arquivo será considerado mais recente.

Parâmetros
localFile File

entry IFileEntry

Retorna
boolean

performDeviceAction

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

Executa uma ação neste dispositivo. Tentativas de recuperar o dispositivo e, opcionalmente, repetir o comando se a ação falhar.

Parâmetros
actionDescription String: uma breve descrição da ação a ser realizada. Usado para geração de registros para fins específicos.

action com.android.tradefed.device.NativeDevice.DeviceAction: a ação a ser realizada.

retryAttempts int: a nova tentativa tenta realizar a ação se falhar, mas a recuperação é bem-sucedida

Retorna
boolean true se a ação tiver sido realizada

Gera
DeviceNotAvailableException se a tentativa de recuperação falhar ou se o número máximo de tentativas for atingido sem sucesso

pós-reinicialização do Adb

protected void postAdbReboot ()

Possíveis ações extras que podem ser realizadas após uma reinicialização.

Gera
DeviceNotAvailableException

Configuração PrePostBoot

protected void prePostBootSetup ()

Permite que cada tipo de dispositivo (AndroidNativeDevice, TestDevice) modifique esse método para configuração específica pós-inicialização.

Gera
DeviceNotAvailableException

definir relógio

protected void setClock (Clock clock)

Define a instância do Relógio a ser usada.

Parâmetros
clock Clock

setLogStartDelay

protected void setLogStartDelay (int delay)

Define o tempo em ms de espera antes de iniciar a captura do logcat para um dispositivo on-line.

Parâmetros
delay int: o atraso em ms

"waitForDeviceNotAvailable"

protected void waitForDeviceNotAvailable (String operationDesc, 
                long time)

Parâmetros
operationDesc String

time long