NativeDevice
public
class
NativeDevice
extends Object
implements
IManagedTestDevice,
IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.device.NativeDevice |
Implémentation par défaut d'une ITestDevice
pour les appareils Android non complets.
Résumé
Classes imbriquées | |
---|---|
class |
NativeDevice.AdbAction
|
class |
NativeDevice.AdbShellAction
|
class |
NativeDevice.RebootDeviceAction
|
enum |
NativeDevice.RebootMode
Mode de redémarrage. |
Constantes | |
---|---|
int |
INVALID_USER_ID
Valeur renvoyée pour tout ID utilisateur non valide ou introuvable: UserHandle a défini la valeur -10000 |
long |
MAX_HOST_DEVICE_TIME_OFFSET
|
int |
MAX_RETRY_ATTEMPTS
Nombre par défaut de tentatives de nouvelle exécution de la commande |
Champs | |
---|---|
protected
static
final
String |
SD_CARD
|
protected
static
final
String |
STORAGE_EMULATED
|
protected
TestDeviceOptions |
mOptions
|
protected
final
IDeviceStateMonitor |
mStateMonitor
|
Constructeurs publics | |
---|---|
NativeDevice(IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crée un objet |
Méthodes publiques | |
---|---|
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()
Journal contenant tous les journaux |
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)
Assistant non officiel permettant d'obtenir 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)
Traitez l'événement DeviceEvent, qui peut ou non faire passer cet appareil à un nouvel état d'allocation. |
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()
Forcer si l'appareil nécessite des actions spécifiques après la racine adb et avant que l'appareil ne soit de nouveau en ligne. |
void
|
postAdbUnrootAction()
Forcer si l'appareil doit effectuer des actions spécifiques après la suppression de l'accès root par adb et avant que l'appareil ne soit de nouveau en ligne. |
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()
Tentative de récupération de la communication de l'appareil. |
void
|
remountSystemWritable()
|
void
|
remountVendorWritable()
|
boolean
|
removeAdmin(String componentName, int userId)
|
void
|
removeOwners()
|
boolean
|
removeUser(int userId)
|
void
|
resetContentProviderSetup()
Réinitialisez l'indicateur de configuration du fournisseur de contenu pour le déclencher à nouveau. |
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)
Injecte le |
void
|
setDate(Date date)
|
boolean
|
setDeviceOwner(String componentName, int userId)
|
void
|
setDeviceState(TestDeviceState deviceState)
|
void
|
setEmulatorOutputStream(SizeLimitedOutputStream output)
Pour l'émulateur, définissez |
void
|
setEmulatorProcess(Process p)
|
void
|
setFastbootEnabled(boolean fastbootEnabled)
|
void
|
setFastbootPath(String fastbootPath)
|
void
|
setIDevice(IDevice newDevice)
|
void
|
setOptions(TestDeviceOptions options)
|
boolean
|
setProperty(String propKey, String propValue)
|
void
|
setRecovery(IDeviceRecovery recovery)
|
void
|
setRecoveryMode(ITestDevice.RecoveryMode mode)
|
void
|
setSetting(String namespace, String key, String value)
|
void
|
setSetting(int userId, String namespace, String key, String value)
|
void
|
setUseFastbootErase(boolean useFastbootErase)
|
void
|
startLogcat()
|
boolean
|
startUser(int userId)
|
boolean
|
startUser(int userId, boolean waitFlag)
|
void
|
stopEmulatorOutput()
|
void
|
stopLogcat()
|
boolean
|
stopUser(int userId)
|
boolean
|
stopUser(int userId, boolean waitFlag, boolean forceFlag)
|
String
|
switchToAdbTcp()
|
boolean
|
switchToAdbUsb()
|
boolean
|
switchUser(int userId)
|
boolean
|
switchUser(int userId, long timeout)
|
boolean
|
syncFiles(File localFileDir, String deviceFilePath)
|
Bugreport
|
takeBugreport()
|
boolean
|
unencryptDevice()
|
String
|
uninstallPackage(String packageName)
|
String
|
uninstallPackageForUser(String packageName, int userId)
|
boolean
|
unlockDevice()
|
boolean
|
waitForBootComplete(long timeOut)
|
void
|
waitForDeviceAvailable()
|
void
|
waitForDeviceAvailable(long waitTime)
|
boolean
|
waitForDeviceInRecovery(long waitTime)
|
boolean
|
waitForDeviceInSideload(long waitTime)
|
boolean
|
waitForDeviceNotAvailable(long waitTime)
|
void
|
waitForDeviceOnline()
|
void
|
waitForDeviceOnline(long waitTime)
|
boolean
|
waitForDeviceShell(long waitTime)
|
Méthodes protégées | |
---|---|
void
|
checkApiLevelAgainst(String feature, int strictMinLevel)
|
NativeDevice.RebootDeviceAction
|
createRebootDeviceAction(NativeDevice.RebootMode rebootMode, String reason)
Créez un |
void
|
doAdbReboot(NativeDevice.RebootMode rebootMode, String reason)
Effectuez un redémarrage ADB. |
void
|
ensureRuntimePermissionSupported()
Méthode d'assistance permettant de générer une exception si l'autorisation d'exécution n'est pas prise en charge |
InputStreamSource
|
getBugreportInternal()
|
File
|
getBugreportzInternal()
Méthode d'assistance interne permettant d'obtenir le fichier ZIP bugreportz en tant que |
IRunUtil
|
getRunUtil()
Obtenez l'instance |
String
|
internalGetProperty(String propName, String fastbootVar, String description)
Récupère une propriété de l'appareil à partir du cache ddmlib par défaut, et utilise "adb shell getprop" ou "fastboot getvar" selon que l'appareil est en mode Fastboot ou non. |
boolean
|
isNewer(File localFile, IFileEntry entry)
Renvoie |
boolean
|
performDeviceAction(String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Effectue une action sur cet appareil. |
void
|
postAdbReboot()
Actions supplémentaires possibles après un redémarrage. |
void
|
prePostBootSetup()
Permet à chaque type d'appareil (AndroidNativeDevice, TestDevice) de remplacer cette méthode pour une configuration spécifique après le démarrage. |
void
|
setClock(Clock clock)
Définissez l'instance Clock à utiliser. |
void
|
setLogStartDelay(int delay)
Définit le délai d'attente (en millisecondes) avant de commencer la capture Logcat pour un appareil en ligne. |
void
|
waitForDeviceNotAvailable(String operationDesc, long time)
|
Constantes
INVALID_USER_ID
public static final int INVALID_USER_ID
Valeur renvoyée pour tout ID utilisateur non valide ou introuvable: UserHandle a défini la valeur -10000
Valeur constante : -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Valeur constante : 5 000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
Nombre par défaut de tentatives de nouvelle exécution de la commande
Valeur constante : 2 (0x00000002)
Champs
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
Constructeurs publics
NativeDevice
public NativeDevice (IDevice device, IDeviceStateMonitor stateMonitor, IDeviceMonitor allocationMonitor)
Crée un objet TestDevice
.
Paramètres | |
---|---|
device |
IDevice : IDevice associé |
stateMonitor |
IDeviceStateMonitor : mécanisme IDeviceStateMonitor à utiliser |
allocationMonitor |
IDeviceMonitor : IDeviceMonitor pour informer des changements d'état d'allocation.
Peut être nul
|
Méthodes publiques
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Paramètres | |
---|---|
strictMinLevel |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
checkConnectivity
public boolean checkConnectivity ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
clearErrorDialogs
public boolean clearErrorDialogs ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid, String wifiPsk, boolean scanSsid)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk, boolean scanSsid)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
scanSsid |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid, String wifiPsk)
Paramètres | |
---|---|
wifiSsid |
String |
wifiPsk |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name, boolean guest, boolean ephemeral)
Paramètres | |
---|---|
name |
String |
guest |
boolean |
ephemeral |
boolean |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
createUser
public int createUser (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
createUserNoThrow
public int createUserNoThrow (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
deleteFile
public void deleteFile (String deviceFilePath)
Paramètres | |
---|---|
deviceFilePath |
String |
Génère | |
---|---|
DeviceNotAvailableException |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Paramètres | |
---|---|
prevSystemServerProcess |
ProcessInfo |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime, TimeUnit timeUnit)
Paramètres | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
disableAdbRoot
public boolean disableAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
disableKeyguard
public void disableKeyguard ()
Génère | |
---|---|
DeviceNotAvailableException |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
disconnectFromWifi
public boolean disconnectFromWifi ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Paramètres | |
---|---|
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
dumpHeap
public File dumpHeap (String process, String devicePath)
Paramètres | |
---|---|
process |
String |
devicePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
enableAdbRoot
public boolean enableAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
encryptDevice
public boolean encryptDevice (boolean inplace)
Paramètres | |
---|---|
inplace |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (long timeout, String... cmdArgs)
Paramètres | |
---|---|
timeout |
long |
cmdArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout, String... cmdArgs)
Paramètres | |
---|---|
timeout |
long |
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Paramètres | |
---|---|
cmdArgs |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public String executeShellCommand (String command)
Paramètres | |
---|---|
command |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver, long maxTimeoutForCommand, long maxTimeToOutputShellResponse, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
maxTimeoutForCommand |
long |
maxTimeToOutputShellResponse |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellCommand
public void executeShellCommand (String command, IShellOutputReceiver receiver)
Paramètres | |
---|---|
command |
String |
receiver |
IShellOutputReceiver |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Paramètres | |
---|---|
cmd |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, OutputStream pipeToOutput)
Paramètres | |
---|---|
cmd |
String |
pipeToOutput |
OutputStream |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, long maxTimeoutForCommand, TimeUnit timeUnit)
Paramètres | |
---|---|
cmd |
String |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd, File pipeAsInput, OutputStream pipeToOutput, OutputStream pipeToError, long maxTimeoutForCommand, TimeUnit timeUnit, int retryAttempts)
Paramètres | |
---|---|
cmd |
String |
pipeAsInput |
File |
pipeToOutput |
OutputStream |
pipeToError |
OutputStream |
maxTimeoutForCommand |
long |
timeUnit |
TimeUnit |
retryAttempts |
int |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Paramètres | |
---|---|
partition |
String |
Renvoie | |
---|---|
CommandResult |
Génère | |
---|---|
DeviceNotAvailableException |
getActiveApexes
publicgetActiveApexes ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getAllSettings
publicgetAllSettings (String namespace)
Paramètres | |
---|---|
namespace |
String |
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getAllocationState
public DeviceAllocationState getAllocationState ()
Renvoie | |
---|---|
DeviceAllocationState |
getAndroidId
public String getAndroidId (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getAndroidIds
publicgetAndroidIds ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getApiLevel
public int getApiLevel ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
PackageInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getAppPackageInfos
publicgetAppPackageInfos ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBasebandVersion
public String getBasebandVersion ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBattery
public Integer getBattery ()
Renvoie | |
---|---|
Integer |
getBooleanProperty
public boolean getBooleanProperty (String name, boolean defaultValue)
Paramètres | |
---|---|
name |
String |
defaultValue |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
getBootHistory
publicgetBootHistory ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBootHistorySince
publicgetBootHistorySince (long utcEpochTime, TimeUnit timeUnit)
Paramètres | |
---|---|
utcEpochTime |
long |
timeUnit |
TimeUnit |
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getBootloaderVersion
public String getBootloaderVersion ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBugreport
public InputStreamSource getBugreport ()
Renvoie | |
---|---|
InputStreamSource |
getBugreportz
public InputStreamSource getBugreportz ()
Renvoie | |
---|---|
InputStreamSource |
getBuildAlias
public String getBuildAlias ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildFlavor
public String getBuildFlavor ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildId
public String getBuildId ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getBuildSigningKeys
public String getBuildSigningKeys ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
Renvoie | |
---|---|
DeviceDescriptor |
getChildren
public String[] getChildren (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
String[] |
Génère | |
---|---|
DeviceNotAvailableException |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Renvoie | |
---|---|
DeviceFoldableState |
Génère | |
---|---|
DeviceNotAvailableException |
getCurrentUser
public int getCurrentUser ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getDeviceClass
public String getDeviceClass ()
Renvoie | |
---|---|
String |
getDeviceDate
public long getDeviceDate ()
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
Renvoie | |
---|---|
DeviceDescriptor |
getDeviceState
public TestDeviceState getDeviceState ()
Renvoie | |
---|---|
TestDeviceState |
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Paramètres | |
---|---|
date |
Date |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Renvoie | |
---|---|
InputStreamSource |
getEmulatorProcess
public Process getEmulatorProcess ()
Renvoie | |
---|---|
Process |
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Journal contenant tous les journaux executeShellCommand(String)
.
Renvoie | |
---|---|
File |
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootPath
public String getFastbootPath ()
Renvoie | |
---|---|
String |
getFastbootProductType
public String getFastbootProductType ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootProductVariant
public String getFastbootProductVariant ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
Renvoie | |
---|---|
String |
getFastbootVariable
public String getFastbootVariable (String variableName)
Paramètres | |
---|---|
variableName |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getFastbootVersion
public String getFastbootVersion ()
Renvoie | |
---|---|
String |
getFileEntry
public IFileEntry getFileEntry (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
IFileEntry |
Génère | |
---|---|
DeviceNotAvailableException |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Assistant non officiel permettant d'obtenir un FileEntry
à partir d'un chemin racine. FIXME: refactorisez le système FileEntry pour qu'il soit disponible à partir de n'importe quel chemin d'accès. (même si vous n'êtes pas root).
Paramètres | |
---|---|
entry |
FileListingService.FileEntry : un FileEntry qui n'est pas nécessairement racine, comme l'exige Ddmlib. |
Renvoie | |
---|---|
IFileEntry |
un FileEntryWrapper représentant le FileEntry. |
Génère | |
---|---|
DeviceNotAvailableException |
getFoldableStates
publicgetFoldableStates ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getIDevice
public IDevice getIDevice ()
Renvoie | |
---|---|
IDevice |
getInstalledPackageNames
publicgetInstalledPackageNames ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getIntProperty
public long getIntProperty (String name, long defaultValue)
Paramètres | |
---|---|
name |
String |
defaultValue |
long |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getIpAddress
public String getIpAddress ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Renvoie | |
---|---|
KeyguardControllerState |
Génère | |
---|---|
DeviceNotAvailableException |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
Renvoie | |
---|---|
long |
getLaunchApiLevel
public int getLaunchApiLevel ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getLogcat
public InputStreamSource getLogcat ()
Renvoie | |
---|---|
InputStreamSource |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Paramètres | |
---|---|
maxBytes |
int |
Renvoie | |
---|---|
InputStreamSource |
getLogcatDump
public InputStreamSource getLogcatDump ()
Renvoie | |
---|---|
InputStreamSource |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Paramètres | |
---|---|
date |
long |
Renvoie | |
---|---|
InputStreamSource |
getMacAddress
public String getMacAddress ()
Renvoie | |
---|---|
String |
getMainlineModuleInfo
publicgetMainlineModuleInfo ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfRunningUsersSupported
public int getMaxNumberOfRunningUsersSupported ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getMaxNumberOfUsersSupported
public int getMaxNumberOfUsersSupported ()
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getMonitor
public IDeviceStateMonitor getMonitor ()
Renvoie | |
---|---|
IDeviceStateMonitor |
getMountPoint
public String getMountPoint (String mountName)
Paramètres | |
---|---|
mountName |
String |
Renvoie | |
---|---|
String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Paramètres | |
---|---|
mountpoint |
String |
Renvoie | |
---|---|
ITestDevice.MountPointInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getMountPointInfo
publicgetMountPointInfo ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getOptions
public TestDeviceOptions getOptions ()
Renvoie | |
---|---|
TestDeviceOptions |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Paramètres | |
---|---|
partition |
String |
Renvoie | |
---|---|
long |
Génère | |
---|---|
DeviceNotAvailableException |
getPrimaryUserId
public Integer getPrimaryUserId ()
Renvoie | |
---|---|
Integer |
Génère | |
---|---|
DeviceNotAvailableException |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Paramètres | |
---|---|
processName |
String |
Renvoie | |
---|---|
ProcessInfo |
Génère | |
---|---|
DeviceNotAvailableException |
getProcessPid
public String getProcessPid (String process)
Paramètres | |
---|---|
process |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProductType
public String getProductType ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProductVariant
public String getProductVariant ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getProperty
public String getProperty (String name)
Paramètres | |
---|---|
name |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Renvoie | |
---|---|
ITestDevice.RecoveryMode |
getScreenshot
public InputStreamSource getScreenshot (String format)
Paramètres | |
---|---|
format |
String |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Paramètres | |
---|---|
displayId |
long |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot (String format, boolean rescale)
Paramètres | |
---|---|
format |
String |
rescale |
boolean |
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getScreenshot
public InputStreamSource getScreenshot ()
Renvoie | |
---|---|
InputStreamSource |
Génère | |
---|---|
DeviceNotAvailableException |
getSerialNumber
public String getSerialNumber ()
Renvoie | |
---|---|
String |
getSetting
public String getSetting (int userId, String namespace, String key)
Paramètres | |
---|---|
userId |
int |
namespace |
String |
key |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getSetting
public String getSetting (String namespace, String key)
Paramètres | |
---|---|
namespace |
String |
key |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
getSimOperator
public String getSimOperator ()
Renvoie | |
---|---|
String |
getSimState
public String getSimState ()
Renvoie | |
---|---|
String |
getTombstones
publicgetTombstones ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getTotalMemory
public long getTotalMemory ()
Renvoie | |
---|---|
long |
getUninstallablePackageNames
publicgetUninstallablePackageNames ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getUseFastbootErase
public boolean getUseFastbootErase ()
Renvoie | |
---|---|
boolean |
getUserFlags
public int getUserFlags (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
getUserInfos
publicgetUserInfos ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
int |
Génère | |
---|---|
DeviceNotAvailableException |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Traitez l'événement DeviceEvent, qui peut ou non faire passer cet appareil à un nouvel état d'allocation.
Paramètres | |
---|---|
event |
DeviceEvent |
Renvoie | |
---|---|
IManagedTestDevice.DeviceEventResponse |
hasFeature
public boolean hasFeature (String feature)
Paramètres | |
---|---|
feature |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
installPackage
public String installPackage (File packageFile, boolean reinstall, boolean grantPermissions, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, int userId, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
userId |
int |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
installPackageForUser
public String installPackageForUser (File packageFile, boolean reinstall, boolean grantPermissions, int userId, String... extraArgs)
Paramètres | |
---|---|
packageFile |
File |
reinstall |
boolean |
grantPermissions |
boolean |
userId |
int |
extraArgs |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
isAdbRoot
public boolean isAdbRoot ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isAdbTcp
public boolean isAdbTcp ()
Renvoie | |
---|---|
boolean |
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isDirectory
public boolean isDirectory (String path)
Paramètres | |
---|---|
path |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Renvoie | |
---|---|
boolean |
true si l'accès root adb doit être activé sur l'appareil
|
isEncryptionSupported
public boolean isEncryptionSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isExecutable
public boolean isExecutable (String fullPath)
Paramètres | |
---|---|
fullPath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isFastbootEnabled
public boolean isFastbootEnabled ()
Renvoie | |
---|---|
boolean |
isHeadless
public boolean isHeadless ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isMultiUserSupported
public boolean isMultiUserSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName, String userId)
Paramètres | |
---|---|
packageName |
String |
userId |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
Renvoie | |
---|---|
boolean |
isUserRunning
public boolean isUserRunning (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isUserSecondary
public boolean isUserSecondary (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
isWifiEnabled
public boolean isWifiEnabled ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
listDisplayIds
publiclistDisplayIds ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
listUsers
publiclistUsers ()
Renvoie | |
---|---|
|
Génère | |
---|---|
DeviceNotAvailableException |
logBugreport
public boolean logBugreport (String dataName, ITestLogger listener)
Paramètres | |
---|---|
dataName |
String |
listener |
ITestLogger |
Renvoie | |
---|---|
boolean |
logOnDevice
public void logOnDevice (String tag, Log.LogLevel level, String format, Object... args)
Paramètres | |
---|---|
tag |
String |
level |
Log.LogLevel |
format |
String |
args |
Object |
nonBlockingReboot
public void nonBlockingReboot ()
Génère | |
---|---|
DeviceNotAvailableException |
postAdbRootAction
public void postAdbRootAction ()
Forcer si l'appareil nécessite des actions spécifiques après la racine adb et avant que l'appareil ne soit de nouveau en ligne. L'implémentation par défaut n'inclut aucune action supplémentaire. Il n'est pas garanti que l'accès root adb soit activé à ce stade.
Génère | |
---|---|
DeviceNotAvailableException |
postAdbUnrootAction
public void postAdbUnrootAction ()
Forcer si l'appareil doit effectuer des actions spécifiques après la suppression de l'accès root par adb et avant que l'appareil ne soit de nouveau en ligne. L'implémentation par défaut n'inclut aucune action supplémentaire. Il n'est pas garanti que l'accès root adb soit désactivé à ce stade.
Génère | |
---|---|
DeviceNotAvailableException |
postBootSetup
public void postBootSetup ()
Génère | |
---|---|
DeviceNotAvailableException |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Paramètres | |
---|---|
exception |
Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes)
Paramètres | |
---|---|
info |
IBuildInfo |
attributes |
MultiMap |
Génère | |
---|---|
DeviceNotAvailableException |
|
TargetSetupError |
pullDir
public boolean pullDir (String deviceFilePath, File localDir)
Paramètres | |
---|---|
deviceFilePath |
String |
localDir |
File |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pullFile
public boolean pullFile (String remoteFilePath, File localFile)
Paramètres | |
---|---|
remoteFilePath |
String |
localFile |
File |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pullFile
public File pullFile (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
pullFileContents
public String pullFileContents (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Paramètres | |
---|---|
remoteFilePath |
String |
Renvoie | |
---|---|
File |
Génère | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath,excludedDirectories)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
excludedDirectories |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pushDir
public boolean pushDir (File localFileDir, String deviceFilePath)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pushFile
public boolean pushFile (File localFile, String remoteFilePath)
Paramètres | |
---|---|
localFile |
File |
remoteFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
pushString
public boolean pushString (String contents, String remoteFilePath)
Paramètres | |
---|---|
contents |
String |
remoteFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer
public void reboot (String reason)
Paramètres | |
---|---|
reason |
String |
Génère | |
---|---|
DeviceNotAvailableException |
redémarrer
public void reboot ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootIntoBootloader
public void rebootIntoBootloader ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootIntoRecovery
public void rebootIntoRecovery ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Paramètres | |
---|---|
autoReboot |
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Paramètres | |
---|---|
reason |
String |
Génère | |
---|---|
DeviceNotAvailableException |
rebootUserspace
public void rebootUserspace ()
Génère | |
---|---|
DeviceNotAvailableException |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
recoverDevice
public void recoverDevice ()
Tentative de récupération de la communication de l'appareil.
Génère | |
---|---|
DeviceNotAvailableException |
si l'appareil n'est plus disponible |
remountSystemWritable
public void remountSystemWritable ()
Génère | |
---|---|
DeviceNotAvailableException |
remountVendorWritable
public void remountVendorWritable ()
Génère | |
---|---|
DeviceNotAvailableException |
removeAdmin
public boolean removeAdmin (String componentName, int userId)
Paramètres | |
---|---|
componentName |
String |
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
removeOwners
public void removeOwners ()
Génère | |
---|---|
DeviceNotAvailableException |
removeUser
public boolean removeUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
resetContentProviderSetup
public void resetContentProviderSetup ()
Réinitialisez l'indicateur de configuration du fournisseur de contenu pour le déclencher à nouveau.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
ITestLifeCycleReceiver |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
listeners |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
ITestLifeCycleReceiver |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId,listeners)
Paramètres | |
---|---|
runner |
IRemoteAndroidTestRunner |
userId |
int |
listeners |
|
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Injecte le IConfiguration
utilisé.
Paramètres | |
---|---|
configuration |
IConfiguration |
setDate
public void setDate (Date date)
Paramètres | |
---|---|
date |
Date |
Génère | |
---|---|
DeviceNotAvailableException |
setDeviceOwner
public boolean setDeviceOwner (String componentName, int userId)
Paramètres | |
---|---|
componentName |
String |
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Paramètres | |
---|---|
deviceState |
TestDeviceState |
setEmulatorOutputStream
public void setEmulatorOutputStream (SizeLimitedOutputStream output)
Pour l'émulateur, définissez SizeLimitedOutputStream
sur la sortie du journal
Paramètres | |
---|---|
output |
SizeLimitedOutputStream : pour consigner la sortie
|
setEmulatorProcess
public void setEmulatorProcess (Process p)
Paramètres | |
---|---|
p |
Process |
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Paramètres | |
---|---|
fastbootEnabled |
boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Paramètres | |
---|---|
fastbootPath |
String |
setIDevice
public void setIDevice (IDevice newDevice)
Paramètres | |
---|---|
newDevice |
IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Paramètres | |
---|---|
options |
TestDeviceOptions |
setProperty
public boolean setProperty (String propKey, String propValue)
Paramètres | |
---|---|
propKey |
String |
propValue |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Paramètres | |
---|---|
recovery |
IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Paramètres | |
---|---|
mode |
ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace, String key, String value)
Paramètres | |
---|---|
namespace |
String |
key |
String |
value |
String |
Génère | |
---|---|
DeviceNotAvailableException |
setSetting
public void setSetting (int userId, String namespace, String key, String value)
Paramètres | |
---|---|
userId |
int |
namespace |
String |
key |
String |
value |
String |
Génère | |
---|---|
DeviceNotAvailableException |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Paramètres | |
---|---|
useFastbootErase |
boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
startUser
public boolean startUser (int userId, boolean waitFlag)
Paramètres | |
---|---|
userId |
int |
waitFlag |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
stopUser
public boolean stopUser (int userId, boolean waitFlag, boolean forceFlag)
Paramètres | |
---|---|
userId |
int |
waitFlag |
boolean |
forceFlag |
boolean |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
switchToAdbTcp
public String switchToAdbTcp ()
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
switchToAdbUsb
public boolean switchToAdbUsb ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId)
Paramètres | |
---|---|
userId |
int |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
switchUser
public boolean switchUser (int userId, long timeout)
Paramètres | |
---|---|
userId |
int |
timeout |
long |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
syncFiles
public boolean syncFiles (File localFileDir, String deviceFilePath)
Paramètres | |
---|---|
localFileDir |
File |
deviceFilePath |
String |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
takeBugreport
public Bugreport takeBugreport ()
Renvoie | |
---|---|
Bugreport |
unencryptDevice
public boolean unencryptDevice ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
uninstallPackage
public String uninstallPackage (String packageName)
Paramètres | |
---|---|
packageName |
String |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName, int userId)
Paramètres | |
---|---|
packageName |
String |
userId |
int |
Renvoie | |
---|---|
String |
Génère | |
---|---|
DeviceNotAvailableException |
unlockDevice
public boolean unlockDevice ()
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Paramètres | |
---|---|
timeOut |
long |
Renvoie | |
---|---|
boolean |
Génère | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Génère | |
---|---|
DeviceNotAvailableException |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Génère | |
---|---|
DeviceNotAvailableException |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
waitForDeviceOnline
public void waitForDeviceOnline ()
Génère | |
---|---|
DeviceNotAvailableException |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Génère | |
---|---|
DeviceNotAvailableException |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Paramètres | |
---|---|
waitTime |
long |
Renvoie | |
---|---|
boolean |
Méthodes protégées
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature, int strictMinLevel)
Paramètres | |
---|---|
feature |
String |
strictMinLevel |
int |
createRebootDeviceAction
protected NativeDevice.RebootDeviceAction createRebootDeviceAction (NativeDevice.RebootMode rebootMode, String reason)
Créez un RebootDeviceAction
à utiliser lors d'une action de redémarrage.
Paramètres | |
---|---|
rebootMode |
NativeDevice.RebootMode : mode de ce redémarrage. |
reason |
String : pour ce redémarrage. |
Renvoie | |
---|---|
NativeDevice.RebootDeviceAction |
le RebootDeviceAction créé.
|
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode, String reason)
Effectuez un redémarrage ADB.
Paramètres | |
---|---|
rebootMode |
NativeDevice.RebootMode : mode de ce redémarrage. |
reason |
String : pour ce redémarrage. |
Génère | |
---|---|
DeviceNotAvailableException |
ensureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
Méthode d'assistance permettant de générer une exception si l'autorisation d'exécution n'est pas prise en charge
Génère | |
---|---|
DeviceNotAvailableException |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Renvoie | |
---|---|
InputStreamSource |
getBugreportzInternal
protected File getBugreportzInternal ()
Méthode d'assistance interne permettant d'obtenir le fichier ZIP bugreportz en tant que ERROR(/File)
.
Renvoie | |
---|---|
File |
internalGetProperty
protected String internalGetProperty (String propName, String fastbootVar, String description)
Récupère une propriété de l'appareil à partir du cache ddmlib par défaut, et utilise "adb shell getprop" ou "fastboot getvar" selon que l'appareil est en mode Fastboot ou non.
Paramètres | |
---|---|
propName |
String : nom de la propriété de l'appareil renvoyé par "adb shell getprop" |
fastbootVar |
String : nom de la variable fastboot équivalente à interroger. Si la valeur est null , la requête fastboot ne sera pas tentée. |
description |
String : description simple de la variable. La première lettre doit être en majuscule. |
Renvoie | |
---|---|
String |
Chaîne, éventuellement null ou vide, contenant la valeur de la propriété donnée
|
Génère | |
---|---|
DeviceNotAvailableException |
isNewer
protected boolean isNewer (File localFile, IFileEntry entry)
Renvoie true
si le fichier local est plus récent que le fichier distant. IFileEntry
étant précis à la minute, en cas d'heures égales, le fichier sera considéré comme plus récent.
Paramètres | |
---|---|
localFile |
File |
entry |
IFileEntry |
Renvoie | |
---|---|
boolean |
performDeviceAction
protected boolean performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts)
Effectue une action sur cet appareil. Tentative de récupération de l'appareil et, éventuellement, de nouvelle tentative de commande si l'action échoue.
Paramètres | |
---|---|
actionDescription |
String : brève description de l'action à effectuer. Utilisé uniquement à des fins de journalisation. |
action |
com.android.tradefed.device.NativeDevice.DeviceAction : action à effectuer |
retryAttempts |
int : la nouvelle tentative d'action est effectuée en cas d'échec, mais la récupération aboutit. |
Renvoie | |
---|---|
boolean |
true si l'action a réussi |
Génère | |
---|---|
DeviceNotAvailableException |
si la tentative de récupération échoue ou si le nombre maximal de tentatives est atteint sans succès |
postAdbReboot
protected void postAdbReboot ()
Actions supplémentaires possibles après un redémarrage.
Génère | |
---|---|
DeviceNotAvailableException |
prePostBootSetup
protected void prePostBootSetup ()
Permet à chaque type d'appareil (AndroidNativeDevice, TestDevice) de remplacer cette méthode pour une configuration spécifique après le démarrage.
Génère | |
---|---|
DeviceNotAvailableException |
setClock
protected void setClock (Clock clock)
Définissez l'instance Clock à utiliser.
Paramètres | |
---|---|
clock |
Clock |
setLogStartDelay
protected void setLogStartDelay (int delay)
Définit le délai d'attente (en millisecondes) avant de commencer la capture Logcat pour un appareil en ligne.
Paramètres | |
---|---|
delay |
int : délai en ms
|
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc, long time)
Paramètres | |
---|---|
operationDesc |
String |
time |
long |