NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.device.NativeDevice |
Implementazione predefinita di un ITestDevice dispositivo 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 qualsiasi 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 nuovo esecuzione del comando da eseguire |
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 |
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 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)
Elabora l'evento DeviceEvent, che può o meno passare questo dispositivo a un nuovo stato di allocazione. |
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()
Sostituisci se il dispositivo richiede alcune azioni specifiche dopo il root tramite adb e prima che il dispositivo sia di nuovo online. |
void
|
postAdbUnrootAction()
Sostituisci se il dispositivo richiede alcune azioni specifiche da eseguire dopo adb unroot e prima che il dispositivo sia 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 con il 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 riattivarlo. |
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)
Invia il |
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 di assistenza per lanciare un'eccezione se l'autorizzazione di runtime non è supportata |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Metodo di helper interno per ottenere il file ZIP del report di bug 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 passa a "adb shell getprop" o "fastboot getvar" a seconda che il dispositivo sia in Fastboot o meno. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Restituisce |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Esegue un'azione su questo dispositivo. |
void
|
postAdbReboot()
Possibili azioni aggiuntive che possono essere intraprese dopo un riavvio. |
void
|
prePostBootSetup()
Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di eseguire l'override di questo metodo per una configurazione post-boot specifica. |
void
|
setClock(Clock clock)
Imposta l'istanza di Orologio da utilizzare. |
void
|
setLogStartDelay(int delay)
Imposta il tempo in ms da attendere prima di avviare l'acquisizione di logcat per un dispositivo online. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Costanti
INVALID_USER_ID
public static final int INVALID_USER_ID
Valore restituito per qualsiasi ID utente non valido/non trovato: UserHandle ha definito il valore -10000
Valore costante: -10000 (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 nuovo esecuzione del comando da eseguire
Valore costante: 2 (0x00000002)
Campi
SD_CARD
protected static final String SD_CARD
STORAGE_EMULATED
protected static final String STORAGE_EMULATED
mOptions
protected TestDeviceOptions mOptions
mStateMonitor
protected final IDeviceStateMonitor mStateMonitor
Costruttori pubblici
NativeDevice
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)Crea un TestDevice.
| Parametri | |
|---|---|
device |
IDevice: il IDevice associato |
stateMonitor |
IDeviceStateMonitor: il meccanismo IDeviceStateMonitor da utilizzare |
allocationMonitor |
IDeviceMonitor: il IDeviceMonitor per informare delle modifiche dello stato dell'allocazione.
Può essere null
|
Metodi pubblici
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
| Parametri | |
|---|---|
strictMinLevel |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
checkConnectivity
public boolean checkConnectivity ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
clearErrorDialogs
public boolean clearErrorDialogs ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
| Parametri | |
|---|---|
wifiSsid |
String |
wifiPsk |
String |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
| Parametri | |
|---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
| Parametri | |
|---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
| Parametri | |
|---|---|
wifiSsid |
String |
wifiPsk |
String |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
createUser
public int createUser (String name,
boolean guest,
boolean ephemeral)
| Parametri | |
|---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
| Ritorni | |
|---|---|
int |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
createUser
public int createUser (String name)
| Parametri | |
|---|---|
name |
String |
| Ritorni | |
|---|---|
int |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
createUserNoThrow
public int createUserNoThrow (String name)
| Parametri | |
|---|---|
name |
String |
| Ritorni | |
|---|---|
int |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
deleteFile
public void deleteFile (String deviceFilePath)
| Parametri | |
|---|---|
deviceFilePath |
String |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
| Parametri | |
|---|---|
prevSystemServerProcess |
ProcessInfo |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
| Parametri | |
|---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
disableAdbRoot
public boolean disableAdbRoot ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
disableKeyguard
public void disableKeyguard ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
disableNetworkMonitor
public boolean disableNetworkMonitor ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
disconnectFromWifi
public boolean disconnectFromWifi ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
doesFileExist
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 |
|
enableAdbRoot
public boolean enableAdbRoot ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
enableNetworkMonitor
public boolean enableNetworkMonitor ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
encryptDevice
public boolean encryptDevice (boolean inplace)
| Parametri | |
|---|---|
inplace |
boolean |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
| Parametri | |
|---|---|
timeout |
long |
cmdArgs |
String |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
| Parametri | |
|---|---|
cmdArgs |
String |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
| Parametri | |
|---|---|
cmdArgs |
String |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
| Parametri | |
|---|---|
timeout |
long |
cmdArgs |
String |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
| Parametri | |
|---|---|
cmdArgs |
String |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellCommand
public String executeShellCommand (String command)
| Parametri | |
|---|---|
command |
String |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellCommand
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 |
|
executeShellCommand
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 |
|
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
| Parametri | |
|---|---|
command |
String |
receiver |
IShellOutputReceiver |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
| Parametri | |
|---|---|
cmd |
String |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
| Parametri | |
|---|---|
cmd |
String |
pipeToOutput |
OutputStream |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
| Parametri | |
|---|---|
cmd |
String |
pipeAsInput |
File |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
| Parametri | |
|---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
| Parametri | |
|---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
| Ritorni | |
|---|---|
CommandResult |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
executeShellV2Command
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 |
|
executeShellV2Command
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 |
|
getAndroidIds
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 |
|
getBattery
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 |
|
getBootHistorySince
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 |
|
getBuildSigningKeys
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 |
|
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Il log che contiene tutti i log 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 |
|
getFastbootVariable
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)
Assistente non ufficiale per ottenere un FileEntry da un percorso non principale. DA FARE: ristrutturare il sistema FileEntry in modo che sia disponibile da qualsiasi percorso. (anche non root).
| Parametri | |
|---|---|
entry |
FileListingService.FileEntry: un FileEntry non necessariamente radice come richiesto da Ddmlib. |
| Ritorni | |
|---|---|
IFileEntry |
un FileEntryWrapper che rappresenta l'elemento FileEntry. |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getFoldableStates
publicgetFoldableStates ()
| Ritorni | |
|---|---|
|
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getIDevice
public IDevice getIDevice ()
| Ritorni | |
|---|---|
IDevice |
|
getInstalledPackageNames
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 |
|
getLastExpectedRebootTimeMillis
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 |
|
getLogcatSince
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 |
|
getOptions
public TestDeviceOptions getOptions ()
| Ritorni | |
|---|---|
TestDeviceOptions |
|
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
| Parametri | |
|---|---|
partition |
String |
| Ritorni | |
|---|---|
long |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getPrimaryUserId
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 |
|
getSetting
public String getSetting (int userId,
String namespace,
String key)
| Parametri | |
|---|---|
userId |
int |
namespace |
String |
key |
String |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getSetting
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 |
|
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
| Ritorni | |
|---|---|
|
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getUseFastbootErase
public boolean getUseFastbootErase ()
| Ritorni | |
|---|---|
boolean |
|
getUserFlags
public int getUserFlags (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
int |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getUserInfos
publicgetUserInfos ()
| Ritorni | |
|---|---|
|
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getUserSerialNumber
public int getUserSerialNumber (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
int |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Elabora l'evento DeviceEvent, che può o meno passare questo dispositivo a un nuovo stato di allocazione.
| 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 |
|
isEnableAdbRoot
public boolean isEnableAdbRoot ()
| Ritorni | |
|---|---|
boolean |
true se è necessario attivare il privilegio di accesso come amministratore adb sul dispositivo
|
isEncryptionSupported
public boolean isEncryptionSupported ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
isExecutable
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 |
|
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
| Parametri | |
|---|---|
packageName |
String |
userId |
String |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
isPackageInstalled
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 |
|
isUserRunning
public boolean isUserRunning (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
isUserSecondary
public boolean isUserSecondary (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
isWifiEnabled
public boolean isWifiEnabled ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
listDisplayIds
publiclistDisplayIds ()
| Ritorni | |
|---|---|
|
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
listUsers
publiclistUsers ()
| Ritorni | |
|---|---|
|
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
| Parametri | |
|---|---|
dataName |
String |
listener |
ITestLogger |
| Ritorni | |
|---|---|
boolean |
|
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
| Parametri | |
|---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockingReboot
public void nonBlockingReboot ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
postAdbRootAction
public void postAdbRootAction ()
Sostituisci se il dispositivo richiede alcune azioni specifiche dopo il root tramite adb e prima che il dispositivo sia di nuovo online. L'implementazione predefinita non include azioni di aggiunta. Non è garantito che adb root sia abilitato in questa fase.
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
postAdbUnrootAction
public void postAdbUnrootAction ()
Sostituisci se il dispositivo richiede alcune azioni specifiche da eseguire dopo adb unroot e prima che il dispositivo sia di nuovo online. L'implementazione predefinita non include azioni aggiuntive. Non è garantito che adb root sia disabilitato in questa fase.
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
postBootSetup
public void postBootSetup ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
| Parametri | |
|---|---|
exception |
Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
| Parametri | |
|---|---|
info |
IBuildInfo |
attributes |
MultiMap |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
pullDir
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 |
|
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
| Parametri | |
|---|---|
remoteFilePath |
String |
| Ritorni | |
|---|---|
File |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
| Parametri | |
|---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
| Parametri | |
|---|---|
localFileDir |
File |
deviceFilePath |
String |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
| Parametri | |
|---|---|
localFile |
File |
remoteFilePath |
String |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
pushString
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 |
|
rebootIntoBootloader
public void rebootIntoBootloader ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootIntoFastbootd
public void rebootIntoFastbootd ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootIntoRecovery
public void rebootIntoRecovery ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootIntoSideload
public void rebootIntoSideload ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
| Parametri | |
|---|---|
autoReboot |
boolean |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootUntilOnline
public void rebootUntilOnline ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootUntilOnline
public void rebootUntilOnline (String reason)
| Parametri | |
|---|---|
reason |
String |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootUserspace
public void rebootUserspace ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
recoverDevice
public void recoverDevice ()
Tenta di recuperare la comunicazione con il dispositivo.
| Lanci | |
|---|---|
DeviceNotAvailableException |
Se il dispositivo non è più disponibile |
remountSystemWritable
public void remountSystemWritable ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
remountVendorWritable
public void remountVendorWritable ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
removeAdmin
public boolean removeAdmin (String componentName,
int userId)
| Parametri | |
|---|---|
componentName |
String |
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
removeOwners
public void removeOwners ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
removeUser
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 riattivarlo.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
| Parametri | |
|---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
| Parametri | |
|---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
| Parametri | |
|---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
| Parametri | |
|---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
setConfiguration
public void setConfiguration (IConfiguration configuration)
Invia il IConfiguration in uso.
| Parametri | |
|---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
| Parametri | |
|---|---|
date |
Date |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
setDeviceOwner
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 per registrare l'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 |
setIDevice
public void setIDevice (IDevice newDevice)
| Parametri | |
|---|---|
newDevice |
IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
| Parametri | |
|---|---|
options |
TestDeviceOptions |
setProperty
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 |
setSetting
public void setSetting (String namespace,
String key,
String value)
| Parametri | |
|---|---|
namespace |
String |
key |
String |
value |
String |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
| Parametri | |
|---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
| Parametri | |
|---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
startUser
public boolean startUser (int userId,
boolean waitFlag)
| Parametri | |
|---|---|
userId |
int |
waitFlag |
boolean |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
stopUser
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 |
|
switchUser
public boolean switchUser (int userId)
| Parametri | |
|---|---|
userId |
int |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
switchUser
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 |
|
takeBugreport
public Bugreport takeBugreport ()
| Ritorni | |
|---|---|
Bugreport |
|
unencryptDevice
public boolean unencryptDevice ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
uninstallPackage
public String uninstallPackage (String packageName)
| Parametri | |
|---|---|
packageName |
String |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
| Parametri | |
|---|---|
packageName |
String |
userId |
int |
| Ritorni | |
|---|---|
String |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
unlockDevice
public boolean unlockDevice ()
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
| Parametri | |
|---|---|
timeOut |
long |
| Ritorni | |
|---|---|
boolean |
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
waitForDeviceAvailable
public void waitForDeviceAvailable ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
| Parametri | |
|---|---|
waitTime |
long |
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
| Parametri | |
|---|---|
waitTime |
long |
| Ritorni | |
|---|---|
boolean |
|
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
| Parametri | |
|---|---|
waitTime |
long |
| Ritorni | |
|---|---|
boolean |
|
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
| Parametri | |
|---|---|
waitTime |
long |
| Ritorni | |
|---|---|
boolean |
|
waitForDeviceOnline
public void waitForDeviceOnline ()
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
waitForDeviceOnline
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 |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Crea un RebootDeviceAction da utilizzare quando esegui un'azione di riavvio.
| Parametri | |
|---|---|
rebootMode |
NativeDevice.RebootMode: una modalità di questo riavvio. |
reason |
String: per questo riavvio. |
| Ritorni | |
|---|---|
NativeDevice.RebootDeviceAction |
RebootDeviceAction creato.
|
doAdbReboot
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 |
|
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
metodo di assistenza per lanciare un'eccezione se l'autorizzazione di runtime non è supportata
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
| Ritorni | |
|---|---|
InputStreamSource |
|
getBugreportzInternal
protected File getBugreportzInternal ()
Metodo di helper interno per ottenere il file ZIP del report di bug 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 passa a "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,
la query fastboot non verrà tentata |
description |
String: una descrizione semplice della variabile. La prima lettera deve essere in maiuscolo. |
| Ritorni | |
|---|---|
String |
Una stringa, eventualmente null o vuota, contenente il valore della proprietà specificata
|
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
isNewer
protected boolean isNewer (File localFile,
IFileEntry entry)Restituisce true se il file locale è più recente del file remoto. IFileEntry è accurata al minuto, in caso di ore uguali, il file verrà 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. Tenta di recuperare il dispositivo e, facoltativamente, riprova il comando se l'azione non va a buon fine.
| Parametri | |
|---|---|
actionDescription |
String: una breve descrizione dell'azione da eseguire. Utilizzata solo per scopi di registrazione. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction: l'azione da eseguire |
retryAttempts |
int: il nuovo tentativo di esecuzione dell'azione se non riesce, ma il recupero riesce |
| Ritorni | |
|---|---|
boolean |
true se l'azione è stata eseguita correttamente |
| Lanci | |
|---|---|
DeviceNotAvailableException |
if recovery attempt fails or max attempts done without success |
postAdbReboot
protected void postAdbReboot ()
Possibili azioni aggiuntive che possono essere intraprese dopo un riavvio.
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
prePostBootSetup
protected void prePostBootSetup ()
Consente a ogni tipo di dispositivo (AndroidNativeDevice, TestDevice) di eseguire l'override di questo metodo per una configurazione post-boot specifica.
| Lanci | |
|---|---|
DeviceNotAvailableException |
|
setClock
protected void setClock (Clock clock)
Imposta l'istanza di Orologio da utilizzare.
| Parametri | |
|---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Imposta il tempo in ms da attendere prima di avviare l'acquisizione di logcat per un dispositivo online.
| Parametri | |
|---|---|
delay |
int: il ritardo in ms
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)| Parametri | |
|---|---|
operationDesc |
String |
time |
long |