Вложенные классы |
---|
class | NativeDevice.AdbAction DeviceAction для запуска команды OS «ADB ....». |
class | NativeDevice.AdbShellAction |
class | NativeDevice.RebootDeviceAction DeviceAction для перезагрузки устройства. |
enum | NativeDevice.RebootMode Режим перезагрузки. |
Публичные методы |
---|
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 () Журнал , который содержит все executeShellCommand(String) журналы. |
long | getExternalStoreFreeSpace () |
String | getFastbootPath () |
String | getFastbootProductType () |
String | getFastbootProductVariant () |
String | getFastbootSerialNumber () |
String | getFastbootVariable (String variableName) |
String | getFastbootVersion () |
IFileEntry | getFileEntry (String path) |
IFileEntry | getFileEntry (FileListingService.FileEntry entry) Неофициальный помощник , чтобы получить FileEntry от некорневого пути. |
| 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) Обработайте событие DeviceEvent, которое может или не может перевести это устройство в новое состояние распределения. |
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 () Переопределите, если устройству необходимо выполнить какие-то определенные действия после adb root и до того, как устройство снова подключится к сети. |
void | postAdbUnrootAction () Переопределите, если устройству необходимо выполнить определенные действия после удаления root с помощью adb и до того, как устройство снова будет в сети. |
void | postBootSetup () |
void | postInvocationTearDown (Throwable exception) |
void | preInvocationSetup (IBuildInfo info, MultiMap<String, String> attributes) |
boolean | pullDir (String deviceFilePath, File localDir) |
boolean | pullFile (String remoteFilePath, File localFile) |
File | pullFile (String remoteFilePath) |
String | pullFileContents (String remoteFilePath) |
File | pullFileFromExternal (String remoteFilePath) |
boolean | pushDir (File localFileDir, String deviceFilePath, excludedDirectories) pushDir (File localFileDir, String deviceFilePath, excludedDirectories) |
boolean | pushDir (File localFileDir, String deviceFilePath) |
boolean | pushFile (File localFile, String remoteFilePath) |
boolean | pushString (String contents, String remoteFilePath) |
void | reboot (String reason) |
void | reboot () |
void | rebootIntoBootloader () |
void | rebootIntoFastbootd () |
void | rebootIntoRecovery () |
void | rebootIntoSideload () |
void | rebootIntoSideload (boolean autoReboot) |
void | rebootUntilOnline () |
void | rebootUntilOnline (String reason) |
void | rebootUserspace () |
void | rebootUserspaceUntilOnline () |
void | recoverDevice () Попытки восстановить связь с устройством. |
void | remountSystemWritable () |
void | remountVendorWritable () |
boolean | removeAdmin (String componentName, int userId) |
void | removeOwners () |
boolean | removeUser (int userId) |
void | resetContentProviderSetup () Сбросьте флаг для настройки поставщика контента, чтобы активировать его снова. |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) runInstrumentationTests (IRemoteAndroidTestRunner runner, listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, ITestLifeCycleReceiver... listeners) |
boolean | runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner, int userId, listeners) |
void | setConfiguration ( IConfiguration configuration) Впрыскивает IConfiguration в использовании. |
void | setDate (Date date) |
boolean | setDeviceOwner (String componentName, int userId) |
void | setDeviceState (TestDeviceState deviceState) |
void | setEmulatorOutputStream ( SizeLimitedOutputStream output) Для эмулятора установить SizeLimitedOutputStream войти выход |
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) |
Защищенные методы |
---|
void | checkApiLevelAgainst (String feature, int strictMinLevel) |
NativeDevice.RebootDeviceAction | createRebootDeviceAction ( NativeDevice.RebootMode rebootMode, String reason) Создание RebootDeviceAction , который будет использоваться при выполнении действия перезагрузки. |
void | doAdbReboot ( NativeDevice.RebootMode rebootMode, String reason) Выполните перезагрузку по adb. |
void | ensureRuntimePermissionSupported () вспомогательный метод для создания исключения, если разрешение на выполнение не поддерживается |
InputStreamSource | getBugreportInternal () |
File | getBugreportzInternal () Метод внутреннего Helper , чтобы получить bugreportz почтовый файл как ERROR(/File) . |
IRunUtil | getRunUtil () Получить RunUtil экземпляр для использования. |
String | internalGetProperty (String propName, String fastbootVar, String description) Получить свойство устройства из кеша ddmlib по умолчанию и вернуться к `adb shell getprop` или` fastboot getvar` в зависимости от того, находится ли устройство в Fastboot или нет. |
boolean | isNewer (File localFile, IFileEntry entry) Возвращение true , если локальный файл новее , чем удаленный файл. |
boolean | performDeviceAction (String actionDescription, com.android.tradefed.device.NativeDevice.DeviceAction action, int retryAttempts) Выполняет действие на этом устройстве. |
void | postAdbReboot () Возможные дополнительные действия, которые можно предпринять после перезагрузки. |
void | prePostBootSetup () Позволяет каждому типу устройства (AndroidNativeDevice, TestDevice) переопределять этот метод для конкретной настройки после загрузки. |
void | setClock (Clock clock) Задайте экземпляр Clock для использования. |
void | setLogStartDelay (int delay) Устанавливает время ожидания в мс перед запуском записи logcat для онлайн-устройства. |
void | waitForDeviceNotAvailable (String operationDesc, long time) |
Константы
INVALID_USER_ID
public static final int INVALID_USER_ID
Возвращаемое значение для любого недопустимого / не найденного идентификатора пользователя: UserHandle определил значение -10000
Постоянное значение: -10000 (0xffffd8f0)
MAX_HOST_DEVICE_TIME_OFFSET
protected static final long MAX_HOST_DEVICE_TIME_OFFSET
Постоянное значение: 5000 (0x0000000000001388)
MAX_RETRY_ATTEMPTS
protected static final int MAX_RETRY_ATTEMPTS
количество повторных попыток выполнения команды по умолчанию
Постоянное значение: 2 (0x00000002)
Поля
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
Общественные конструкторы
NativeDevice
public NativeDevice (IDevice device,
IDeviceStateMonitor stateMonitor,
IDeviceMonitor allocationMonitor)
Создает TestDevice
.
Параметры |
---|
device | IDevice - IDevice IDevice : ассоциированное IDevice - IDevice |
stateMonitor | IDeviceStateMonitor : IDeviceStateMonitor механизм использования |
allocationMonitor | IDeviceMonitor : IDeviceMonitor информировать об изменениях состояния распределения. Может быть нулевым |
Публичные методы
checkApiLevelAgainstNextRelease
public boolean checkApiLevelAgainstNextRelease (int strictMinLevel)
Параметры |
---|
strictMinLevel | int |
Броски |
---|
DeviceNotAvailableException | |
checkConnectivity
public boolean checkConnectivity ()
Броски |
---|
DeviceNotAvailableException | |
clearErrorDialogs
public boolean clearErrorDialogs ()
Броски |
---|
DeviceNotAvailableException | |
clearLastConnectedWifiNetwork
public void clearLastConnectedWifiNetwork ()
clearLogcat
public void clearLogcat ()
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
Броски |
---|
DeviceNotAvailableException | |
connectToWifiNetwork
public boolean connectToWifiNetwork (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Броски |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk,
boolean scanSsid)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
scanSsid | boolean |
Броски |
---|
DeviceNotAvailableException | |
connectToWifiNetworkIfNeeded
public boolean connectToWifiNetworkIfNeeded (String wifiSsid,
String wifiPsk)
Параметры |
---|
wifiSsid | String |
wifiPsk | String |
Броски |
---|
DeviceNotAvailableException | |
Создать пользователя
public int createUser (String name,
boolean guest,
boolean ephemeral)
Параметры |
---|
name | String |
guest | boolean |
ephemeral | boolean |
Броски |
---|
DeviceNotAvailableException | |
Создать пользователя
public int createUser (String name)
Броски |
---|
DeviceNotAvailableException | |
createUserNoThrow
public int createUserNoThrow (String name)
Броски |
---|
DeviceNotAvailableException | |
удалить файл
public void deleteFile (String deviceFilePath)
Параметры |
---|
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
deviceSoftRestarted
public boolean deviceSoftRestarted (ProcessInfo prevSystemServerProcess)
Параметры |
---|
prevSystemServerProcess | ProcessInfo |
Броски |
---|
DeviceNotAvailableException | |
deviceSoftRestartedSince
public boolean deviceSoftRestartedSince (long utcEpochTime,
TimeUnit timeUnit)
Параметры |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
disableAdbRoot
public boolean disableAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
disableKeyguard
public void disableKeyguard ()
Броски |
---|
DeviceNotAvailableException | |
disableNetworkMonitor
public boolean disableNetworkMonitor ()
Броски |
---|
DeviceNotAvailableException | |
отключить от Wi-Fi
public boolean disconnectFromWifi ()
Броски |
---|
DeviceNotAvailableException | |
doesFileExist
public boolean doesFileExist (String deviceFilePath)
Параметры |
---|
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
свалка
public File dumpHeap (String process,
String devicePath)
Параметры |
---|
process | String |
devicePath | String |
Броски |
---|
DeviceNotAvailableException | |
enableAdbRoot
public boolean enableAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
enableNetworkMonitor
public boolean enableNetworkMonitor ()
Броски |
---|
DeviceNotAvailableException | |
encryptDevice
public boolean encryptDevice (boolean inplace)
Параметры |
---|
inplace | boolean |
Броски |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (long timeout,
String... cmdArgs)
Параметры |
---|
timeout | long |
cmdArgs | String |
Броски |
---|
DeviceNotAvailableException | |
executeAdbCommand
public String executeAdbCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
executeFastbootCommand
public CommandResult executeFastbootCommand (long timeout,
String... cmdArgs)
Параметры |
---|
timeout | long |
cmdArgs | String |
Броски |
---|
DeviceNotAvailableException | |
executeLongFastbootCommand
public CommandResult executeLongFastbootCommand (String... cmdArgs)
Броски |
---|
DeviceNotAvailableException | |
executeShellCommand
public String executeShellCommand (String command)
Броски |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver,
long maxTimeoutForCommand,
long maxTimeToOutputShellResponse,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
maxTimeoutForCommand | long |
maxTimeToOutputShellResponse | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
executeShellCommand
public void executeShellCommand (String command,
IShellOutputReceiver receiver)
Параметры |
---|
command | String |
receiver | IShellOutputReceiver |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd)
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
OutputStream pipeToOutput)
Параметры |
---|
cmd | String |
pipeToOutput | OutputStream |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput)
Параметры |
---|
cmd | String |
pipeAsInput | File |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
long maxTimeoutForCommand,
TimeUnit timeUnit)
Параметры |
---|
cmd | String |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
executeShellV2Command
public CommandResult executeShellV2Command (String cmd,
File pipeAsInput,
OutputStream pipeToOutput,
OutputStream pipeToError,
long maxTimeoutForCommand,
TimeUnit timeUnit,
int retryAttempts)
Параметры |
---|
cmd | String |
pipeAsInput | File |
pipeToOutput | OutputStream |
pipeToError | OutputStream |
maxTimeoutForCommand | long |
timeUnit | TimeUnit |
retryAttempts | int |
Броски |
---|
DeviceNotAvailableException | |
fastbootWipePartition
public CommandResult fastbootWipePartition (String partition)
Параметры |
---|
partition | String |
Броски |
---|
DeviceNotAvailableException | |
getActiveApexes
public getActiveApexes ()
Броски |
---|
DeviceNotAvailableException | |
getAllSettings
public getAllSettings (String namespace)
Параметры |
---|
namespace | String |
Броски |
---|
DeviceNotAvailableException | |
getAllocationState
public DeviceAllocationState getAllocationState ()
Возврат |
---|
DeviceAllocationState | |
getAndroidId
public String getAndroidId (int userId)
Броски |
---|
DeviceNotAvailableException | |
getAndroidIds
public getAndroidIds ()
Броски |
---|
DeviceNotAvailableException | |
getApiLevel
public int getApiLevel ()
Броски |
---|
DeviceNotAvailableException | |
getAppPackageInfo
public PackageInfo getAppPackageInfo (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
getAppPackageInfos
public getAppPackageInfos ()
Броски |
---|
DeviceNotAvailableException | |
getBasebandVersion
public String getBasebandVersion ()
Броски |
---|
DeviceNotAvailableException | |
getBattery
public Integer getBattery ()
getBooleanProperty
public boolean getBooleanProperty (String name,
boolean defaultValue)
Параметры |
---|
name | String |
defaultValue | boolean |
Броски |
---|
DeviceNotAvailableException | |
getBootHistory
public getBootHistory ()
Броски |
---|
DeviceNotAvailableException | |
getBootHistorySince
public getBootHistorySince (long utcEpochTime,
TimeUnit timeUnit)
Параметры |
---|
utcEpochTime | long |
timeUnit | TimeUnit |
Броски |
---|
DeviceNotAvailableException | |
getBootloaderVersion
public String getBootloaderVersion ()
Броски |
---|
DeviceNotAvailableException | |
getBugreport
public InputStreamSource getBugreport ()
Возврат |
---|
InputStreamSource | |
getBugreportz
public InputStreamSource getBugreportz ()
Возврат |
---|
InputStreamSource | |
getBuildAlias
public String getBuildAlias ()
Броски |
---|
DeviceNotAvailableException | |
getBuildFlavor
public String getBuildFlavor ()
Броски |
---|
DeviceNotAvailableException | |
getBuildId
public String getBuildId ()
Броски |
---|
DeviceNotAvailableException | |
getBuildSigningKeys
public String getBuildSigningKeys ()
Броски |
---|
DeviceNotAvailableException | |
getCachedDeviceDescriptor
public DeviceDescriptor getCachedDeviceDescriptor ()
getChildren
public String[] getChildren (String path)
Броски |
---|
DeviceNotAvailableException | |
getCurrentFoldableState
public DeviceFoldableState getCurrentFoldableState ()
Возврат |
---|
DeviceFoldableState | |
Броски |
---|
DeviceNotAvailableException | |
getCurrentUser
public int getCurrentUser ()
Броски |
---|
DeviceNotAvailableException | |
getDeviceClass
public String getDeviceClass ()
getDeviceDate
public long getDeviceDate ()
Броски |
---|
DeviceNotAvailableException | |
getDeviceDescriptor
public DeviceDescriptor getDeviceDescriptor ()
getDeviceState
public TestDeviceState getDeviceState ()
getDeviceTimeOffset
public long getDeviceTimeOffset (Date date)
Броски |
---|
DeviceNotAvailableException | |
getEmulatorOutput
public InputStreamSource getEmulatorOutput ()
Возврат |
---|
InputStreamSource | |
getEmulatorProcess
public Process getEmulatorProcess ()
getExecuteShellCommandLog
public final File getExecuteShellCommandLog ()
Журнал , который содержит все executeShellCommand(String)
журналы.
getExternalStoreFreeSpace
public long getExternalStoreFreeSpace ()
Броски |
---|
DeviceNotAvailableException | |
getFastbootPath
public String getFastbootPath ()
getFastbootProductType
public String getFastbootProductType ()
Броски |
---|
DeviceNotAvailableException | |
getFastbootProductVariant
public String getFastbootProductVariant ()
Броски |
---|
DeviceNotAvailableException | |
getFastbootSerialNumber
public String getFastbootSerialNumber ()
getFastbootVariable
public String getFastbootVariable (String variableName)
Параметры |
---|
variableName | String |
Броски |
---|
DeviceNotAvailableException | |
getFastbootVersion
public String getFastbootVersion ()
getFileEntry
public IFileEntry getFileEntry (String path)
Броски |
---|
DeviceNotAvailableException | |
getFileEntry
public IFileEntry getFileEntry (FileListingService.FileEntry entry)
Неофициальный помощник , чтобы получить FileEntry
от некорневого пути. FIXME: Реорганизуйте систему FileEntry, чтобы она была доступна по любому пути. (даже без root).
Параметры |
---|
entry | FileListingService.FileEntry : а FileEntry не обязательно корень , как требует Ddmlib. |
Броски |
---|
DeviceNotAvailableException | |
getFoldableStates
public getFoldableStates ()
Броски |
---|
DeviceNotAvailableException | |
getIDevice
public IDevice getIDevice ()
getInstalledPackageNames
public getInstalledPackageNames ()
Броски |
---|
DeviceNotAvailableException | |
getIntProperty
public long getIntProperty (String name,
long defaultValue)
Параметры |
---|
name | String |
defaultValue | long |
Броски |
---|
DeviceNotAvailableException | |
getIpAddress
public String getIpAddress ()
Броски |
---|
DeviceNotAvailableException | |
getKeyguardState
public KeyguardControllerState getKeyguardState ()
Возврат |
---|
KeyguardControllerState | |
Броски |
---|
DeviceNotAvailableException | |
getLastExpectedRebootTimeMillis
public long getLastExpectedRebootTimeMillis ()
getLaunchApiLevel
public int getLaunchApiLevel ()
Броски |
---|
DeviceNotAvailableException | |
getLogcat
public InputStreamSource getLogcat ()
Возврат |
---|
InputStreamSource | |
getLogcat
public InputStreamSource getLogcat (int maxBytes)
Возврат |
---|
InputStreamSource | |
getLogcatDump
public InputStreamSource getLogcatDump ()
Возврат |
---|
InputStreamSource | |
getLogcatSince
public InputStreamSource getLogcatSince (long date)
Возврат |
---|
InputStreamSource | |
getMacAddress
public String getMacAddress ()
getMainlineModuleInfo
public getMainlineModuleInfo ()
Броски |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfRunningUsersSupported ()
Броски |
---|
DeviceNotAvailableException | |
public int getMaxNumberOfUsersSupported ()
Броски |
---|
DeviceNotAvailableException | |
getMonitor
public IDeviceStateMonitor getMonitor ()
Возврат |
---|
IDeviceStateMonitor | |
getMountPoint
public String getMountPoint (String mountName)
Параметры |
---|
mountName | String |
getMountPointInfo
public ITestDevice.MountPointInfo getMountPointInfo (String mountpoint)
Параметры |
---|
mountpoint | String |
Возврат |
---|
ITestDevice.MountPointInfo | |
Броски |
---|
DeviceNotAvailableException | |
getMountPointInfo
public getMountPointInfo ()
Броски |
---|
DeviceNotAvailableException | |
getOptions
public TestDeviceOptions getOptions ()
Возврат |
---|
TestDeviceOptions | |
getPartitionFreeSpace
public long getPartitionFreeSpace (String partition)
Параметры |
---|
partition | String |
Броски |
---|
DeviceNotAvailableException | |
getPrimaryUserId
public Integer getPrimaryUserId ()
Броски |
---|
DeviceNotAvailableException | |
getProcessByName
public ProcessInfo getProcessByName (String processName)
Параметры |
---|
processName | String |
Броски |
---|
DeviceNotAvailableException | |
getProcessPid
public String getProcessPid (String process)
Броски |
---|
DeviceNotAvailableException | |
getProductType
public String getProductType ()
Броски |
---|
DeviceNotAvailableException | |
getProductVariant
public String getProductVariant ()
Броски |
---|
DeviceNotAvailableException | |
getProperty
public String getProperty (String name)
Броски |
---|
DeviceNotAvailableException | |
getRecoveryMode
public ITestDevice.RecoveryMode getRecoveryMode ()
Возврат |
---|
ITestDevice.RecoveryMode | |
getScreenshot
public InputStreamSource getScreenshot (String format)
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (long displayId)
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot (String format,
boolean rescale)
Параметры |
---|
format | String |
rescale | boolean |
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getScreenshot
public InputStreamSource getScreenshot ()
Возврат |
---|
InputStreamSource | |
Броски |
---|
DeviceNotAvailableException | |
getSerialNumber
public String getSerialNumber ()
getSetting
public String getSetting (int userId,
String namespace,
String key)
Параметры |
---|
userId | int |
namespace | String |
key | String |
Броски |
---|
DeviceNotAvailableException | |
getSetting
public String getSetting (String namespace,
String key)
Параметры |
---|
namespace | String |
key | String |
Броски |
---|
DeviceNotAvailableException | |
getSimOperator
public String getSimOperator ()
getSimState
public String getSimState ()
getTombstones
public getTombstones ()
Броски |
---|
DeviceNotAvailableException | |
getTotalMemory
public long getTotalMemory ()
getUninstallablePackageNames
public getUninstallablePackageNames ()
Броски |
---|
DeviceNotAvailableException | |
getUseFastbootErase
public boolean getUseFastbootErase ()
getUserFlags
public int getUserFlags (int userId)
Броски |
---|
DeviceNotAvailableException | |
getUserInfos
public getUserInfos ()
Броски |
---|
DeviceNotAvailableException | |
getUserSerialNumber
public int getUserSerialNumber (int userId)
Броски |
---|
DeviceNotAvailableException | |
handleAllocationEvent
public IManagedTestDevice.DeviceEventResponse handleAllocationEvent (DeviceEvent event)
Обработайте событие DeviceEvent, которое может или не может перевести это устройство в новое состояние распределения.
Параметры |
---|
event | DeviceEvent |
Возврат |
---|
IManagedTestDevice.DeviceEventResponse | |
hasFeature
public boolean hasFeature (String feature)
Броски |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
boolean reinstall,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
installPackage
public String installPackage (File packageFile,
boolean reinstall,
boolean grantPermissions,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
int userId,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
userId | int |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
installPackageForUser
public String installPackageForUser (File packageFile,
boolean reinstall,
boolean grantPermissions,
int userId,
String... extraArgs)
Параметры |
---|
packageFile | File |
reinstall | boolean |
grantPermissions | boolean |
userId | int |
extraArgs | String |
Броски |
---|
DeviceNotAvailableException | |
isAdbRoot
public boolean isAdbRoot ()
Броски |
---|
DeviceNotAvailableException | |
isAdbTcp
public boolean isAdbTcp ()
isAppEnumerationSupported
public boolean isAppEnumerationSupported ()
Броски |
---|
DeviceNotAvailableException | |
isDeviceEncrypted
public boolean isDeviceEncrypted ()
Броски |
---|
DeviceNotAvailableException | |
isDirectory
public boolean isDirectory (String path)
Броски |
---|
DeviceNotAvailableException | |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Возврат |
---|
boolean | true , если ADB корень должен быть включен на устройстве |
isEncryptionSupported
public boolean isEncryptionSupported ()
Броски |
---|
DeviceNotAvailableException | |
isExecutable
public boolean isExecutable (String fullPath)
Параметры |
---|
fullPath | String |
Броски |
---|
DeviceNotAvailableException | |
isFastbootEnabled
public boolean isFastbootEnabled ()
безголовый
public boolean isHeadless ()
Броски |
---|
DeviceNotAvailableException | |
isMultiUserSupported
public boolean isMultiUserSupported ()
Броски |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName,
String userId)
Параметры |
---|
packageName | String |
userId | String |
Броски |
---|
DeviceNotAvailableException | |
isPackageInstalled
public boolean isPackageInstalled (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
isRuntimePermissionSupported
public boolean isRuntimePermissionSupported ()
Броски |
---|
DeviceNotAvailableException | |
isStateBootloaderOrFastbootd
public boolean isStateBootloaderOrFastbootd ()
isUserRunning
public boolean isUserRunning (int userId)
Броски |
---|
DeviceNotAvailableException | |
isUserSecondary
public boolean isUserSecondary (int userId)
Броски |
---|
DeviceNotAvailableException | |
isWifiEnabled
public boolean isWifiEnabled ()
Броски |
---|
DeviceNotAvailableException | |
listDisplayIds
public listDisplayIds ()
Броски |
---|
DeviceNotAvailableException | |
listUsers
public listUsers ()
Броски |
---|
DeviceNotAvailableException | |
logBugreport
public boolean logBugreport (String dataName,
ITestLogger listener)
Параметры |
---|
dataName | String |
listener | ITestLogger |
logOnDevice
public void logOnDevice (String tag,
Log.LogLevel level,
String format,
Object... args)
Параметры |
---|
tag | String |
level | Log.LogLevel |
format | String |
args | Object |
nonBlockingReboot
public void nonBlockingReboot ()
Броски |
---|
DeviceNotAvailableException | |
postAdbRootAction
public void postAdbRootAction ()
Переопределите, если устройству необходимо выполнить какие-то определенные действия после adb root и до того, как устройство снова подключится к сети. Реализация по умолчанию не включает никаких дополнительных действий. Не гарантируется, что adb root будет включен на этом этапе.
Броски |
---|
DeviceNotAvailableException | |
postAdbUnrootAction
public void postAdbUnrootAction ()
Переопределите, если устройству необходимо выполнить определенные действия после удаления root с помощью adb и до того, как устройство снова будет в сети. Реализация по умолчанию не включает никаких дополнительных действий. На данном этапе отключение adb root не гарантируется.
Броски |
---|
DeviceNotAvailableException | |
postBootSetup
public void postBootSetup ()
Броски |
---|
DeviceNotAvailableException | |
postInvocationTearDown
public void postInvocationTearDown (Throwable exception)
Параметры |
---|
exception | Throwable |
preInvocationSetup
public void preInvocationSetup (IBuildInfo info,
MultiMap<String, String> attributes)
Параметры |
---|
info | IBuildInfo |
attributes | MultiMap |
Броски |
---|
DeviceNotAvailableException | |
TargetSetupError | |
pullDir
public boolean pullDir (String deviceFilePath,
File localDir)
Параметры |
---|
deviceFilePath | String |
localDir | File |
Броски |
---|
DeviceNotAvailableException | |
pullFile
public boolean pullFile (String remoteFilePath,
File localFile)
Параметры |
---|
remoteFilePath | String |
localFile | File |
Броски |
---|
DeviceNotAvailableException | |
pullFile
public File pullFile (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pullFileContents
public String pullFileContents (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pullFileFromExternal
public File pullFileFromExternal (String remoteFilePath)
Параметры |
---|
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath,
excludedDirectories)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
excludedDirectories | |
Броски |
---|
DeviceNotAvailableException | |
pushDir
public boolean pushDir (File localFileDir,
String deviceFilePath)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushFile
public boolean pushFile (File localFile,
String remoteFilePath)
Параметры |
---|
localFile | File |
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
pushString
public boolean pushString (String contents,
String remoteFilePath)
Параметры |
---|
contents | String |
remoteFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
перезагружать
public void reboot (String reason)
Броски |
---|
DeviceNotAvailableException | |
перезагружать
public void reboot ()
Броски |
---|
DeviceNotAvailableException | |
rebootIntoBootloader
public void rebootIntoBootloader ()
Броски |
---|
DeviceNotAvailableException | |
rebootIntoFastbootd
public void rebootIntoFastbootd ()
Броски |
---|
DeviceNotAvailableException | |
rebootIntoRecovery
public void rebootIntoRecovery ()
Броски |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload ()
Броски |
---|
DeviceNotAvailableException | |
rebootIntoSideload
public void rebootIntoSideload (boolean autoReboot)
Параметры |
---|
autoReboot | boolean |
Броски |
---|
DeviceNotAvailableException | |
rebootUntilOnline
public void rebootUntilOnline ()
Броски |
---|
DeviceNotAvailableException | |
rebootUntilOnline
public void rebootUntilOnline (String reason)
Броски |
---|
DeviceNotAvailableException | |
rebootUserspace
public void rebootUserspace ()
Броски |
---|
DeviceNotAvailableException | |
rebootUserspaceUntilOnline
public void rebootUserspaceUntilOnline ()
Броски |
---|
DeviceNotAvailableException | |
RecoveryDevice
public void recoverDevice ()
Попытки восстановить связь с устройством.
Броски |
---|
DeviceNotAvailableException | если устройство больше не доступно |
remountSystemWritable
public void remountSystemWritable ()
Броски |
---|
DeviceNotAvailableException | |
remountVendorWritable
public void remountVendorWritable ()
Броски |
---|
DeviceNotAvailableException | |
removeAdmin
public boolean removeAdmin (String componentName,
int userId)
Параметры |
---|
componentName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
removeOwners
public void removeOwners ()
Броски |
---|
DeviceNotAvailableException | |
removeUser
public boolean removeUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
resetContentProviderSetup
public void resetContentProviderSetup ()
Сбросьте флаг для настройки поставщика контента, чтобы активировать его снова.
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
ITestLifeCycleReceiver... listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
listeners | ITestLifeCycleReceiver |
Броски |
---|
DeviceNotAvailableException | |
runInstrumentationTests
public boolean runInstrumentationTests (IRemoteAndroidTestRunner runner,
listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
listeners | |
Броски |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
ITestLifeCycleReceiver... listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | ITestLifeCycleReceiver |
Броски |
---|
DeviceNotAvailableException | |
runInstrumentationTestsAsUser
public boolean runInstrumentationTestsAsUser (IRemoteAndroidTestRunner runner,
int userId,
listeners)
Параметры |
---|
runner | IRemoteAndroidTestRunner |
userId | int |
listeners | |
Броски |
---|
DeviceNotAvailableException | |
setConfiguration
public void setConfiguration (IConfiguration configuration)
Впрыскивает IConfiguration
в использовании.
Параметры |
---|
configuration | IConfiguration |
setDate
public void setDate (Date date)
Броски |
---|
DeviceNotAvailableException | |
setDeviceOwner
public boolean setDeviceOwner (String componentName,
int userId)
Параметры |
---|
componentName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
setDeviceState
public void setDeviceState (TestDeviceState deviceState)
Параметры |
---|
deviceState | TestDeviceState |
setEmulatorProcess
public void setEmulatorProcess (Process p)
setFastbootEnabled
public void setFastbootEnabled (boolean fastbootEnabled)
Параметры |
---|
fastbootEnabled | boolean |
setFastbootPath
public void setFastbootPath (String fastbootPath)
Параметры |
---|
fastbootPath | String |
setIDevice
public void setIDevice (IDevice newDevice)
Параметры |
---|
newDevice | IDevice |
setOptions
public void setOptions (TestDeviceOptions options)
Параметры |
---|
options | TestDeviceOptions |
setProperty
public boolean setProperty (String propKey,
String propValue)
Параметры |
---|
propKey | String |
propValue | String |
Броски |
---|
DeviceNotAvailableException | |
setRecovery
public void setRecovery (IDeviceRecovery recovery)
Параметры |
---|
recovery | IDeviceRecovery |
setRecoveryMode
public void setRecoveryMode (ITestDevice.RecoveryMode mode)
Параметры |
---|
mode | ITestDevice.RecoveryMode |
setSetting
public void setSetting (String namespace,
String key,
String value)
Параметры |
---|
namespace | String |
key | String |
value | String |
Броски |
---|
DeviceNotAvailableException | |
setSetting
public void setSetting (int userId,
String namespace,
String key,
String value)
Параметры |
---|
userId | int |
namespace | String |
key | String |
value | String |
Броски |
---|
DeviceNotAvailableException | |
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Параметры |
---|
useFastbootErase | boolean |
startLogcat
public void startLogcat ()
startUser
public boolean startUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
startUser
public boolean startUser (int userId,
boolean waitFlag)
Параметры |
---|
userId | int |
waitFlag | boolean |
Броски |
---|
DeviceNotAvailableException | |
stopEmulatorOutput
public void stopEmulatorOutput ()
stopLogcat
public void stopLogcat ()
stopUser
public boolean stopUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
stopUser
public boolean stopUser (int userId,
boolean waitFlag,
boolean forceFlag)
Параметры |
---|
userId | int |
waitFlag | boolean |
forceFlag | boolean |
Броски |
---|
DeviceNotAvailableException | |
switchToAdbTcp
public String switchToAdbTcp ()
Броски |
---|
DeviceNotAvailableException | |
switchToAdbUsb
public boolean switchToAdbUsb ()
Броски |
---|
DeviceNotAvailableException | |
поменять пользователя
public boolean switchUser (int userId)
Броски |
---|
DeviceNotAvailableException | |
поменять пользователя
public boolean switchUser (int userId,
long timeout)
Параметры |
---|
userId | int |
timeout | long |
Броски |
---|
DeviceNotAvailableException | |
syncFiles
public boolean syncFiles (File localFileDir,
String deviceFilePath)
Параметры |
---|
localFileDir | File |
deviceFilePath | String |
Броски |
---|
DeviceNotAvailableException | |
takeBugreport
public Bugreport takeBugreport ()
unencryptDevice
public boolean unencryptDevice ()
Броски |
---|
DeviceNotAvailableException | |
uninstallPackage
public String uninstallPackage (String packageName)
Параметры |
---|
packageName | String |
Броски |
---|
DeviceNotAvailableException | |
uninstallPackageForUser
public String uninstallPackageForUser (String packageName,
int userId)
Параметры |
---|
packageName | String |
userId | int |
Броски |
---|
DeviceNotAvailableException | |
разблокировать устройство
public boolean unlockDevice ()
Броски |
---|
DeviceNotAvailableException | |
waitForBootComplete
public boolean waitForBootComplete (long timeOut)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable ()
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceAvailable
public void waitForDeviceAvailable (long waitTime)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceInRecovery
public boolean waitForDeviceInRecovery (long waitTime)
waitForDeviceInSideload
public boolean waitForDeviceInSideload (long waitTime)
waitForDeviceNotAvailable
public boolean waitForDeviceNotAvailable (long waitTime)
waitForDeviceOnline
public void waitForDeviceOnline ()
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceOnline
public void waitForDeviceOnline (long waitTime)
Броски |
---|
DeviceNotAvailableException | |
waitForDeviceShell
public boolean waitForDeviceShell (long waitTime)
Защищенные методы
checkApiLevelAgainst
protected void checkApiLevelAgainst (String feature,
int strictMinLevel)
Параметры |
---|
feature | String |
strictMinLevel | int |
doAdbReboot
protected void doAdbReboot (NativeDevice.RebootMode rebootMode,
String reason)
Выполните перезагрузку по adb.
Параметры |
---|
rebootMode | NativeDevice.RebootMode : режим этой перезагрузки. |
reason | String : для этой перезагрузки. |
Броски |
---|
DeviceNotAvailableException | |
sureRuntimePermissionSupported
protected void ensureRuntimePermissionSupported ()
вспомогательный метод для создания исключения, если разрешение на выполнение не поддерживается
Броски |
---|
DeviceNotAvailableException | |
getBugreportInternal
protected InputStreamSource getBugreportInternal ()
Возврат |
---|
InputStreamSource | |
getBugreportzInternal
protected File getBugreportzInternal ()
Метод внутреннего Helper , чтобы получить bugreportz почтовый файл как ERROR(/File)
.
getRunUtil
protected IRunUtil getRunUtil ()
Получить RunUtil
экземпляр для использования.
internalGetProperty
protected String internalGetProperty (String propName,
String fastbootVar,
String description)
Получить свойство устройства из кеша ddmlib по умолчанию и вернуться к `adb shell getprop` или` fastboot getvar` в зависимости от того, находится ли устройство в Fastboot или нет.
Параметры |
---|
propName | String : Имя свойства устройства, возвращаемый `ADB getprop` оболочки |
fastbootVar | String : Имя эквивалентной переменной FastBoot для запроса. если null , запрос не быстрой загрузки будет предпринята попытка |
description | String : Простое описание переменной. Первая буква должна быть заглавной. |
Возврат |
---|
String | Строка, возможно , null или пустые, содержащее значение данного свойства |
Броски |
---|
DeviceNotAvailableException | |
isNewer
protected boolean isNewer (File localFile,
IFileEntry entry)
Возвращение true
, если локальный файл новее , чем удаленный файл. IFileEntry
быть с точностью до минуты, в случае равных промежутков времени, то файл будет считаться новее.
Параметры |
---|
localFile | File |
entry | IFileEntry |
protected boolean performDeviceAction (String actionDescription,
com.android.tradefed.device.NativeDevice.DeviceAction action,
int retryAttempts)
Выполняет действие на этом устройстве. Пытается восстановить устройство и, при необходимости, повторить команду, если действие не удалось.
Параметры |
---|
actionDescription | String : краткое описание действий , которые будут выполнены. Используется только для целей регистрации. |
action | com.android.tradefed.device.NativeDevice.DeviceAction : действие , которое будет выполняться |
retryAttempts | int : попытки повтора , чтобы действовать , если это не удается , но восстановление успешно |
Возврат |
---|
boolean | true , если действие было выполнено успешно |
Броски |
---|
DeviceNotAvailableException | если попытка восстановления не удалась или максимальное количество попыток выполнено безуспешно |
postAdbReboot
protected void postAdbReboot ()
Возможные дополнительные действия, которые можно предпринять после перезагрузки.
Броски |
---|
DeviceNotAvailableException | |
prePostBootSetup
protected void prePostBootSetup ()
Позволяет каждому типу устройства (AndroidNativeDevice, TestDevice) переопределять этот метод для конкретной настройки после загрузки.
Броски |
---|
DeviceNotAvailableException | |
setClock
protected void setClock (Clock clock)
Задайте экземпляр Clock для использования.
setLogStartDelay
protected void setLogStartDelay (int delay)
Устанавливает время ожидания в мс перед запуском записи logcat для онлайн-устройства.
Параметры |
---|
delay | int : задержки в мс |
waitForDeviceNotAvailable
protected void waitForDeviceNotAvailable (String operationDesc,
long time)
Параметры |
---|
operationDesc | String |
time | long |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[]
[]