Dispositivo nativo
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
🎞 | com.android.tradefed.device.NativeDevice |
Implementazione predefinita di ITestDevice
dispositivi Android non full stack.
Riepilogo
Classi nidificate | |
---|---|
class |
NativeDevice.AdbAction
Un |
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Una modalità di riavvio. |
Costanti | |
---|---|
int |
INVALID_USER_ID
Valore restituito per un ID utente non valido/non trovato: UserHandle ha definito il valore -10000 |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
il numero predefinito di tentativi di esecuzione dei nuovi comandi |
Campi | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Costruttori pubblici | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crea un |
Metodi pubblici | |
---|---|
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()
Il log che contiene tutti i log di |
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)
Supporto non ufficiale per ottenere un |
|
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)
Elaborare DeviceEvent, che può o meno trasferire questo dispositivo a una nuova allocazione stato. |
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()
Esegui l'override se il dispositivo ha bisogno di determinate azioni dopo la root adb e prima del comando il dispositivo è di nuovo online. |
void
|
postAdbUnrootAction()
Esegui l'override se il dispositivo richiede l'esecuzione di determinate azioni dopo l'unroot dell'adb e prima il dispositivo è di nuovo 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,
|
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 di recuperare la comunicazione del dispositivo. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Reimposta il flag per la configurazione del fornitore di contenuti per attivarlo di nuovo. |
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTests(IRemoteAndroidTestRunner runner,
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
|
boolean
|
runInstrumentationTestsAsUser(IRemoteAndroidTestRunner runner, int userId,
|
void
|
setConfiguration(IConfiguration configuration)
Inserisce |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Per l'emulatore imposta |
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)
|
Metodi protetti | |
---|---|
void
|
checkApiLevelAgainst(String feature, int strictMinLevel)
|
NativeDevice.RebootDeviceAction
|
createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)
Crea un |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Esegui un riavvio ADB. |
void
|
ensureRuntimePermissionSupported()
metodo helper per generare un'eccezione se l'autorizzazione di runtime non è supportata |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Metodo di helper interno per ottenere il file ZIP bugreportz come |
IRunUtil
|
getRunUtil()
Ottieni l'istanza |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Recupera una proprietà del dispositivo dalla cache di ddmlib per impostazione predefinita e utilizza sia "adb" shell getprop" o "fastboot getvar" a seconda che il dispositivo sia in Fastboot o meno. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Restituisci |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Esegue un'azione su questo dispositivo. |
void
|
postAdbReboot()
Eventuali azioni aggiuntive che è possibile eseguire dopo un riavvio. |
void
|
prePostBootSetup()
Consente a ogni tipo di dispositivo (Android NativeDevice, TestDevice) di eseguire l'override di questo metodo per una specifica configurazione post-avvio. |
void
|
setClock(Clock clock)
Imposta l'istanza di orologio da utilizzare. |
void
|
setLogStartDelay(int delay)
Imposta il tempo di attesa in ms prima di avviare l'acquisizione di logcat per un dispositivo online. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Costanti
ID_UTENTE_NON_VALIDO
public static final int INVALID_USER_ID
Valore restituito per un ID utente non valido/non trovato: UserHandle ha definito il valore -10000
Valore costante: -10.000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valore costante: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
il numero predefinito di tentativi di esecuzione dei nuovi comandi
Valore costante: 2 (0x00000002)
Campi
SCHEDA_SD
protected static final String SD_CARD
SPAZIO DI ARCHIVIAZIONE_EMULATED
protected static final String STORAGE_EMULATED
Opzioni m
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Costruttori pubblici
Dispositivo nativo
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crea un TestDevice
.
Parametri | |
---|---|
device |
IDevice : il valore IDevice associato |
stateMonitor |
IDeviceStateMonitor : il meccanismo IDeviceStateMonitor da utilizzare |
allocationMonitor |
IDeviceMonitor : il IDeviceMonitor per informare le modifiche dello stato di allocazione.
Può essere nullo
|
Metodi pubblici
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Parametri | |
---|---|
strictMinLevel |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
Finestra di dialogo di errore
public boolean clearErrorDialogs ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
cancellaUltimaReteWifiConnessa
public void clearLastConnectedWifiNetwork ()
cancella
public void clearLogcat ()
connettitiaallareteWifi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Parametri | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
connettitiaallareteWifi
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Parametri | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
connettitiallareteWifiIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Parametri | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
connettitiallareteWifiIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Parametri | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
CreaUtente
public int createUser (String name, boolean guest, boolean ephemeral)
Parametri | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
CreaUtente
public int createUser (String name)
Parametri | |
---|---|
name |
String |
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
CreaUtenteNoThrow
public int createUserNoThrow (String name)
Parametri | |
---|---|
name |
String |
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
deleteFile
public void deleteFile (String deviceFilePath)
Parametri | |
---|---|
deviceFilePath |
String |
Lanci | |
---|---|
DeviceNotAvailableException |
dispositivoRiavvio avviato
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Parametri | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
dispositivoSoftRiavviatoDal
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Parametri | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
disattivareAdbRoot
public boolean disableAdbRoot ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
disattiva KeyGuard
public void disableKeyguard ()
Lanci | |
---|---|
DeviceNotAvailableException |
disattivareNetworkMonitor
public boolean disableNetworkMonitor ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
disconnetti daWifi
public boolean disconnectFromWifi ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
fileExist
public boolean doesFileExist (String deviceFilePath)
Parametri | |
---|---|
deviceFilePath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
Parametri | |
---|---|
process |
String |
devicePath |
String |
Ritorni | |
---|---|
File |
Lanci | |
---|---|
DeviceNotAvailableException |
attivaAdbRoot
public boolean enableAdbRoot ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
abilitaNetworkMonitor
public boolean enableNetworkMonitor ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
criptareDispositivo
public boolean encryptDevice (boolean inplace)
Parametri | |
---|---|
inplace |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Parametri | |
---|---|
timeout |
long |
cmdArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireAdbCommand
public String executeAdbCommand (String... cmdArgs)
Parametri | |
---|---|
cmdArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Parametri | |
---|---|
cmdArgs |
String |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Parametri | |
---|---|
timeout |
long |
cmdArgs |
String |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Parametri | |
---|---|
cmdArgs |
String |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellCommand
public String executeShellCommand (String command)
Parametri | |
---|---|
command |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Parametri | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Parametri | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeoutForCommand |
long |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Parametri | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd)
Parametri | |
---|---|
cmd |
String |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Parametri | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Parametri | |
---|---|
cmd |
String |
pipeAsInput |
File |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parametri | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Parametri | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parametri | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguireShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Parametri | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
pipeToError |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Parametri | |
---|---|
partition |
String |
Ritorni | |
---|---|
CommandResult |
Lanci | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Parametri | |
---|---|
namespace |
String |
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Ritorni | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getAndroidId
publicgetAndroidIds ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Parametri | |
---|---|
packageName |
String |
Ritorni | |
---|---|
PackageInfo |
Lanci | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getBatteria
public Integer getBattery ()
Ritorni | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Parametri | |
---|---|
name |
String |
defaultValue |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getBootHistoryDa
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Parametri | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Ritorni | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Ritorni | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getBuildSigningKey
public String getBuildSigningKeys ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Ritorni | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Parametri | |
---|---|
path |
String |
Ritorni | |
---|---|
String[] |
Lanci | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Ritorni | |
---|---|
DeviceFoldableState |
Lanci | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Ritorni | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Ritorni | |
---|---|
long |
Lanci | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Ritorni | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Ritorni | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Parametri | |
---|---|
date |
Date |
Ritorni | |
---|---|
long |
Lanci | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Ritorni | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Ritorni | |
---|---|
Process |
getEseguiShellCommandLog
public final File getExecuteShellCommandLog ()
Il log che contiene tutti i log di executeShellCommand(String)
.
Ritorni | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Ritorni | |
---|---|
long |
Lanci | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Ritorni | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Ritorni | |
---|---|
String |
getFastbootVariabile
public String getFastbootVariable (String variableName)
Parametri | |
---|---|
variableName |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Ritorni | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Parametri | |
---|---|
path |
String |
Ritorni | |
---|---|
IFileEntry |
Lanci | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Aiutante non ufficiale per ottenere un FileEntry
da un percorso non principale. CORREZIONE: esegui il refactoring del
FileEntry System per renderlo disponibile da qualsiasi percorso. (anche non root).
Parametri | |
---|---|
entry |
FileListingService.FileEntry : un valore FileEntry non necessariamente root come richiesto da Ddmlib. |
Ritorni | |
---|---|
IFileEntry |
un FileEntryWrapper che rappresenta FileEntry. |
Lanci | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Ritorni | |
---|---|
IDevice |
getInstallaPackageNames
publicgetInstalledPackageNames ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Parametri | |
---|---|
name |
String |
defaultValue |
long |
Ritorni | |
---|---|
long |
Lanci | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Ritorni | |
---|---|
KeyguardControllerState |
Lanci | |
---|---|
DeviceNotAvailableException |
getLastAspettaRiavvioMillis
public long getLastExpectedRebootTimeMillis ()
Ritorni | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Ritorni | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Parametri | |
---|---|
maxBytes |
int |
Ritorni | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Ritorni | |
---|---|
InputStreamSource |
getLogcatDal
public InputStreamSource getLogcatSince (long date)
Parametri | |
---|---|
date |
long |
Ritorni | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Ritorni | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Ritorni | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Parametri | |
---|---|
mountName |
String |
Ritorni | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Parametri | |
---|---|
mountpoint |
String |
Ritorni | |
---|---|
ITestDevice.MountPointInfo |
Lanci | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getOpzioni
public TestDeviceOptions getOptions ()
Ritorni | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Parametri | |
---|---|
partition |
String |
Ritorni | |
---|---|
long |
Lanci | |
---|---|
DeviceNotAvailableException |
IDUtentePrincipale
public Integer getPrimaryUserId ()
Ritorni | |
---|---|
Integer |
Lanci | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Parametri | |
---|---|
processName |
String |
Ritorni | |
---|---|
ProcessInfo |
Lanci | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Parametri | |
---|---|
process |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Parametri | |
---|---|
name |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Ritorni | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Parametri | |
---|---|
format |
String |
Ritorni | |
---|---|
InputStreamSource |
Lanci | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Parametri | |
---|---|
displayId |
long |
Ritorni | |
---|---|
InputStreamSource |
Lanci | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Parametri | |
---|---|
format |
String |
rescale |
boolean |
Ritorni | |
---|---|
InputStreamSource |
Lanci | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Ritorni | |
---|---|
InputStreamSource |
Lanci | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Ritorni | |
---|---|
String |
getImpostazione
public String getSetting (int userId, String namespace, String key)
Parametri | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getImpostazione
public String getSetting (String namespace, String key)
Parametri | |
---|---|
namespace |
String |
key |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Ritorni | |
---|---|
String |
getSimState
public String getSimState ()
Ritorni | |
---|---|
String |
getTombstones
publicgetTombstones ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Ritorni | |
---|---|
long |
getDisinstallaablePackageNames
publicgetUninstallablePackageNames ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getUseFastbootReset
public boolean getUseFastbootErase ()
Ritorni | |
---|---|
boolean |
Flag User
public int getUserFlags (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
OttieniInfoUtente
publicgetUserInfos ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
int |
Lanci | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Elaborare DeviceEvent, che può o meno trasferire questo dispositivo a una nuova allocazione stato.
Parametri | |
---|---|
event |
DeviceEvent |
Ritorni | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Parametri | |
---|---|
feature |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Parametri | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Parametri | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Parametri | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Parametri | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
isAdbRoot
public boolean isAdbRoot ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Ritorni | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Parametri | |
---|---|
path |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isAbilitaAdbRoot
public boolean isEnableAdbRoot ()
Ritorni | |
---|---|
boolean |
true se ADB root deve essere attivato sul dispositivo
|
CrittografiaSupportato
public boolean isEncryptionSupported ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
èeseguibile
public boolean isExecutable (String fullPath)
Parametri | |
---|---|
fullPath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Ritorni | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
èPacchettoInstallato
public boolean isPackageInstalled (String packageName, String userId)
Parametri | |
---|---|
packageName |
String |
userId |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
èPacchettoInstallato
public boolean isPackageInstalled (String packageName)
Parametri | |
---|---|
packageName |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Ritorni | |
---|---|
boolean |
èIn esecuzioneUtente
public boolean isUserRunning (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
èUtenteSecondario
public boolean isUserSecondary (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
listDisplayId
publiclistDisplayIds ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
elencoUtenti
publiclistUsers ()
Ritorni | |
---|---|
|
Lanci | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Parametri | |
---|---|
dataName |
String |
listener |
ITestLogger |
Ritorni | |
---|---|
boolean |
Dispositivo di accesso
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Parametri | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockRiavvia
public void nonBlockingReboot ()
Lanci | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Esegui l'override se il dispositivo ha bisogno di determinate azioni dopo la root adb e prima del comando il dispositivo è di nuovo online. L'implementazione predefinita non include azioni aggiuntive. Non è garantita l'attivazione di adb root in questa fase.
Lanci | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Esegui l'override se il dispositivo richiede l'esecuzione di determinate azioni dopo l'unroot dell'adb e prima il dispositivo è di nuovo online. L'implementazione predefinita non include azioni aggiuntive. Non è garantita la disattivazione della directory principale adb in questa fase.
Lanci | |
---|---|
DeviceNotAvailableException |
configurazione postBoot
public void postBootSetup ()
Lanci | |
---|---|
DeviceNotAvailableException |
postInvocationTeardown
public void postInvocationTearDown (Throwable exception)
Parametri | |
---|---|
exception |
Throwable |
impostazione preInvocation
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Parametri | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Lanci | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
Dir pull
public boolean pullDir (String deviceFilePath, File localDir)
Parametri | |
---|---|
deviceFilePath |
String |
localDir |
File |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
PullFile
public boolean pullFile (String remoteFilePath, File localFile)
Parametri | |
---|---|
remoteFilePath |
String |
localFile |
File |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
PullFile
public File pullFile (String remoteFilePath)
Parametri | |
---|---|
remoteFilePath |
String |
Ritorni | |
---|---|
File |
Lanci | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Parametri | |
---|---|
remoteFilePath |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
pullFileDaEsterno
public File pullFileFromExternal (String remoteFilePath)
Parametri | |
---|---|
remoteFilePath |
String |
Ritorni | |
---|---|
File |
Lanci | |
---|---|
DeviceNotAvailableException |
Dir push
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Parametri | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
Dir push
public boolean pushDir (File localFileDir, String deviceFilePath)
Parametri | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
File push
public boolean pushFile (File localFile, String remoteFilePath)
Parametri | |
---|---|
localFile |
File |
remoteFilePath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
Stringaspinta
public boolean pushString (String contents, String remoteFilePath)
Parametri | |
---|---|
contents |
String |
remoteFilePath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
fai ripartire
public void reboot (String reason)
Parametri | |
---|---|
reason |
String |
Lanci | |
---|---|
DeviceNotAvailableException |
fai ripartire
public void reboot ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioIntoBootloader
public void rebootIntoBootloader ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioIntoFastbootd
public void rebootIntoFastbootd ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioIntoRecovery
public void rebootIntoRecovery ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioIntoSideload
public void rebootIntoSideload ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Parametri | |
---|---|
autoReboot |
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
esegui riavvioUntilOnline
public void rebootUntilOnline ()
Lanci | |
---|---|
DeviceNotAvailableException |
esegui riavvioUntilOnline
public void rebootUntilOnline (String reason)
Parametri | |
---|---|
reason |
String |
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioSpazioutente
public void rebootUserspace ()
Lanci | |
---|---|
DeviceNotAvailableException |
riavvioSpazioUtenteUntilOnline
public void rebootUserspaceUntilOnline ()
Lanci | |
---|---|
DeviceNotAvailableException |
ripristinoDispositivo
public void recoverDevice ()
Tenta di recuperare la comunicazione del dispositivo.
Lanci | |
---|---|
DeviceNotAvailableException |
se il dispositivo non è più disponibile |
rimonta SystemWritable
public void remountSystemWritable ()
Lanci | |
---|---|
DeviceNotAvailableException |
rimontareVendorWritable
public void remountVendorWritable ()
Lanci | |
---|---|
DeviceNotAvailableException |
rimuovereAmministratore
public boolean removeAdmin (String componentName, int userId)
Parametri | |
---|---|
componentName |
String |
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
rimuoviProprietari
public void removeOwners ()
Lanci | |
---|---|
DeviceNotAvailableException |
rimuovereUtente
public boolean removeUser (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Reimposta il flag per la configurazione del fornitore di contenuti per attivarlo di nuovo.
runInstrumentationTest
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Parametri | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
runInstrumentationTest
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Parametri | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguiTestInstrumentationAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Parametri | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
eseguiTestInstrumentationAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Parametri | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Inserisce IConfiguration
in uso.
Parametri | |
---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
Parametri | |
---|---|
date |
Date |
Lanci | |
---|---|
DeviceNotAvailableException |
impostaProprietarioDispositivo
public boolean setDeviceOwner (String componentName, int userId)
Parametri | |
---|---|
componentName |
String |
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Parametri | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Per l'emulatore imposta SizeLimitedOutputStream
su log output
Parametri | |
---|---|
output |
SizeLimitedOutputStream : per registrare l'output
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Parametri | |
---|---|
p |
Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Parametri | |
---|---|
fastbootEnabled |
boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Parametri | |
---|---|
fastbootPath |
String |
impostaIDispositivo
public void setIDevice (IDevice newDevice)
Parametri | |
---|---|
newDevice |
IDevice |
impostaOpzioni
public void setOptions (TestDeviceOptions options)
Parametri | |
---|---|
options |
TestDeviceOptions |
setProprietà
public boolean setProperty (String propKey, String propValue)
Parametri | |
---|---|
propKey |
String |
propValue |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Parametri | |
---|---|
recovery |
IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Parametri | |
---|---|
mode |
ITestDevice.RecoveryMode |
impostazioniImpostazione
public void setSetting (String namespace, String key, String value)
Parametri | |
---|---|
namespace |
String |
key |
String |
value |
String |
Lanci | |
---|---|
DeviceNotAvailableException |
impostazioniImpostazione
public void setSetting (int userId, String namespace, String key, String value)
Parametri | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Lanci | |
---|---|
DeviceNotAvailableException |
ImpostaUsaFastbootReset
public void setUseFastbootErase (boolean useFastbootErase)
Parametri | |
---|---|
useFastbootErase |
boolean |
StartLogcat
public void startLogcat ()
UtenteInizio
public boolean startUser (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
UtenteInizio
public boolean startUser (int userId, boolean waitFlag)
Parametri | |
---|---|
userId |
int |
waitFlag |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
Utente bloccato
public boolean stopUser (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
Utente bloccato
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Parametri | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
cambiautente
public boolean switchUser (int userId)
Parametri | |
---|---|
userId |
int |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
cambiautente
public boolean switchUser (int userId, long timeout)
Parametri | |
---|---|
userId |
int |
timeout |
long |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
SyncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Parametri | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
prendereBugreport
public Bugreport takeBugreport ()
Ritorni | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
disinstalla il pacchetto
public String uninstallPackage (String packageName)
Parametri | |
---|---|
packageName |
String |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
disinstallaPacchettoPerUtente
public String uninstallPackageForUser (String packageName, int userId)
Parametri | |
---|---|
packageName |
String |
userId |
int |
Ritorni | |
---|---|
String |
Lanci | |
---|---|
DeviceNotAvailableException |
sbloccaDispositivo
public boolean unlockDevice ()
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Parametri | |
---|---|
timeOut |
long |
Ritorni | |
---|---|
boolean |
Lanci | |
---|---|
DeviceNotAvailableException |
attesaPerDispositivoDisponibile
public void waitForDeviceAvailable ()
Lanci | |
---|---|
DeviceNotAvailableException |
attesaPerDispositivoDisponibile
public void waitForDeviceAvailable (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Lanci | |
---|---|
DeviceNotAvailableException |
attesaPerDispositivoInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Ritorni | |
---|---|
boolean |
attesaPerDispositivoInSideload
public boolean waitForDeviceInSideload (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Ritorni | |
---|---|
boolean |
attesaPerDispositivoNonDisponibile
public boolean waitForDeviceNotAvailable (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Ritorni | |
---|---|
boolean |
attesaPerDispositivoOnline
public void waitForDeviceOnline ()
Lanci | |
---|---|
DeviceNotAvailableException |
attesaPerDispositivoOnline
public void waitForDeviceOnline (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Lanci | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Parametri | |
---|---|
waitTime |
long |
Ritorni | |
---|---|
boolean |
Metodi protetti
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Parametri | |
---|---|
feature |
String |
strictMinLevel |
int |
creaRiavviaDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Crea un RebootDeviceAction
da utilizzare quando si esegue un'azione di riavvio.
Parametri | |
---|---|
rebootMode |
NativeDevice.RebootMode : una modalità di questo riavvio. |
reason |
String : per questo riavvio. |
Ritorni | |
---|---|
NativeDevice.RebootDeviceAction |
l'elemento RebootDeviceAction creato.
|
doAdbRiavvia
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Esegui un riavvio ADB.
Parametri | |
---|---|
rebootMode |
NativeDevice.RebootMode : una modalità di questo riavvio. |
reason |
String : per questo riavvio. |
Lanci | |
---|---|
DeviceNotAvailableException |
garantireRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
metodo helper per generare un'eccezione se l'autorizzazione di runtime non è supportata
Lanci | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Ritorni | |
---|---|
InputStreamSource |
getBugreportzInterno
protected File getBugreportzInternal ()
Metodo di helper interno per ottenere il file ZIP bugreportz come ERROR(/File)
.
Ritorni | |
---|---|
File |
getRunUtil
protected IRunUtil getRunUtil ()
Ottieni l'istanza RunUtil
da utilizzare.
Ritorni | |
---|---|
IRunUtil |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Recupera una proprietà del dispositivo dalla cache di ddmlib per impostazione predefinita e utilizza sia "adb" shell getprop" o "fastboot getvar" a seconda che il dispositivo sia in Fastboot o meno.
Parametri | |
---|---|
propName |
String : il nome della proprietà del dispositivo restituito da "adb shell getprop" |
fastbootVar |
String : il nome della variabile fastboot equivalente su cui eseguire la query. se null ,
non verrà eseguito alcun tentativo di query fastboot |
description |
String : una semplice descrizione della variabile. La prima lettera deve essere maiuscola. |
Ritorni | |
---|---|
String |
Una stringa, probabilmente null o vuota, contenente il valore della proprietà specificata
|
Lanci | |
---|---|
DeviceNotAvailableException |
èPiù recente
protected boolean isNewer (File localFile, IFileEntry entry)
Restituisci true
se il file locale è più recente del file remoto. IFileEntry
in corso
al minuto, in caso di numero uguale, il file sarà considerato più recente.
Parametri | |
---|---|
localFile |
File |
entry |
IFileEntry |
Ritorni | |
---|---|
boolean |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Esegue un'azione su questo dispositivo. Tentativi di recuperare il dispositivo e, facoltativamente, riprova se l'azione non riesce.
Parametri | |
---|---|
actionDescription |
String : una breve descrizione dell'azione da eseguire. Utilizzato per il logging
ai soli scopi. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : l'azione da eseguire |
retryAttempts |
int : il nuovo tentativo di eseguire l'azione se non riesce, ma
recupero riuscito |
Ritorni | |
---|---|
boolean |
true se l'azione è stata eseguita correttamente |
Lanci | |
---|---|
DeviceNotAvailableException |
se il tentativo di recupero non va a buon fine o il numero massimo di tentativi effettuati senza operazione riuscita |
postAdbRiavvia
protected void postAdbReboot ()
Eventuali azioni aggiuntive che è possibile eseguire dopo un riavvio.
Lanci | |
---|---|
DeviceNotAvailableException |
Configurazione prePostBoot
protected void prePostBootSetup ()
Consente a ogni tipo di dispositivo (Android NativeDevice, TestDevice) di eseguire l'override di questo metodo per una specifica configurazione post-avvio.
Lanci | |
---|---|
DeviceNotAvailableException |
impostaOrologio
protected void setClock (Clock clock)
Imposta l'istanza di orologio da utilizzare.
Parametri | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Imposta il tempo di attesa in ms prima di avviare l'acquisizione di logcat per un dispositivo online.
Parametri | |
---|---|
delay |
int : il ritardo in ms
|
attesaPerDispositivoNonDisponibile
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Parametri | |
---|---|
operationDesc |
String |
time |
long |