StubDevice

public class StubDevice
extends Object implements IDevice

java.lang.Object
   ↳ com.android.tradefed.device.StubDevice
Known Direct Subclasses


Stub placeholder implementation of a IDevice.

Summary

Public constructors

StubDevice(String serial)
StubDevice(String serial, boolean isEmulator)

Public methods

boolean arePropertiesSet()

void createForward(int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)

void createForward(int localPort, int remotePort)

void executeShellCommand(String command, IShellOutputReceiver receiver)

void executeShellCommand(String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse)

This method is deprecated. use executeShellCommand(String, IShellOutputReceiver, long, TimeUnit).

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

void executeShellCommand(String command, IShellOutputReceiver receiver, long maxTimeToOutputResponse, TimeUnit maxTimeUnits)

List<String> getAbis()

String getAvdName()

Future<Integer> getBattery(long freshnessTime, TimeUnit timeUnit)

Future<Integer> getBattery()

Integer getBatteryLevel(long freshnessMs)

This method is deprecated. use getBattery(long, TimeUnit) instead.

Integer getBatteryLevel()

This method is deprecated. use getBattery() instead.

Client getClient(String applicationName)

String getClientName(int pid)

Client[] getClients()

int getDensity()

FileListingService getFileListingService()

String getLanguage()

String getMountPoint(String name)

String getName()

Map<String, String> getProperties()

This method is deprecated. use getSystemProperty(String) instead.

String getProperty(String name)

String getPropertyCacheOrSync(String name)

This method is deprecated. use getProperty(String) instead.

int getPropertyCount()

This method is deprecated. deprecated in ddmlib with "implementation detail" as reason.

String getPropertySync(String name)

This method is deprecated. use getProperty(String) instead.

String getRegion()

RawImage getScreenshot()

RawImage getScreenshot(long timeout, TimeUnit unit)
String getSerialNumber()

IDevice.DeviceState getState()

SyncService getSyncService()

Future<String> getSystemProperty(String name)

AndroidVersion getVersion()

boolean hasClients()

void installPackage(String packageFilePath, boolean reinstall, String... extraArgs)

void installPackages(List<File> apkFilePaths, boolean reinstall, List<String> extraArgs, long timeOutInMs, TimeUnit timeunit)

void installRemotePackage(String remoteFilePath, boolean reinstall, String... extraArgs)

boolean isBootLoader()

boolean isEmulator()

boolean isOffline()

boolean isOnline()

boolean isRoot()

void pullFile(String remote, String local)

void pushFile(String local, String remote)

void reboot(String into)

void removeForward(int localPort, int remotePort)

void removeForward(int localPort, String remoteSocketName, IDevice.DeviceUnixSocketNamespace namespace)

void removeRemotePackage(String remoteFilePath)

boolean root()

void runEventLogService(LogReceiver receiver)

void runLogService(String logname, LogReceiver receiver)

void setSerial(String serial)
void startScreenRecorder(String remoteFilePath, ScreenRecorderOptions options, IShellOutputReceiver receiver)

boolean supportsFeature(IDevice.HardwareFeature arg0)
boolean supportsFeature(IDevice.Feature feature)

String syncPackageToDevice(String localFilePath)

String uninstallPackage(String packageName)

Public constructors

StubDevice

StubDevice (String serial)

Parameters
serial String

StubDevice

StubDevice (String serial, 
                boolean isEmulator)

Parameters
serial String

isEmulator boolean

Public methods

arePropertiesSet

boolean arePropertiesSet ()

Returns
boolean

createForward

void createForward (int localPort, 
                String remoteSocketName, 
                IDevice.DeviceUnixSocketNamespace namespace)

Parameters
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Throws
TimeoutException
AdbCommandRejectedException
IOException

createForward

void createForward (int localPort, 
                int remotePort)

Parameters
localPort int

remotePort int

Throws
TimeoutException
AdbCommandRejectedException
IOException

executeShellCommand

void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Parameters
command String

receiver IShellOutputReceiver

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

executeShellCommand

void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                int maxTimeToOutputResponse)

This method is deprecated.
use executeShellCommand(String, IShellOutputReceiver, long, TimeUnit).

Parameters
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse int

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

executeShellCommand

void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

Parameters
command String

receiver IShellOutputReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

executeShellCommand

void executeShellCommand (String command, 
                IShellOutputReceiver receiver, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits)

Parameters
command String

receiver IShellOutputReceiver

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

getAbis

List<String> getAbis ()

Returns
List<String>

getAvdName

String getAvdName ()

Returns
String

getBattery

Future<Integer> getBattery (long freshnessTime, 
                TimeUnit timeUnit)

Parameters
freshnessTime long

timeUnit TimeUnit

Returns
Future<Integer>

getBattery

Future<Integer> getBattery ()

Returns
Future<Integer>

getBatteryLevel

Integer getBatteryLevel (long freshnessMs)

This method is deprecated.
use getBattery(long, TimeUnit) instead.

Parameters
freshnessMs long

Returns
Integer

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

getBatteryLevel

Integer getBatteryLevel ()

This method is deprecated.
use getBattery() instead.

Returns
Integer

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

getClient

Client getClient (String applicationName)

Parameters
applicationName String

Returns
Client

getClientName

String getClientName (int pid)

Parameters
pid int

Returns
String

getClients

Client[] getClients ()

Returns
Client[]

getDensity

int getDensity ()

Returns
int

getFileListingService

FileListingService getFileListingService ()

Returns
FileListingService

getLanguage

String getLanguage ()

Returns
String

getMountPoint

String getMountPoint (String name)

Parameters
name String

Returns
String

getName

String getName ()

Returns
String

getProperties

Map<String, String> getProperties ()

This method is deprecated.
use getSystemProperty(String) instead.

Returns
Map<String, String>

getProperty

String getProperty (String name)

Parameters
name String

Returns
String

getPropertyCacheOrSync

String getPropertyCacheOrSync (String name)

This method is deprecated.
use getProperty(String) instead.

Parameters
name String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

getPropertyCount

int getPropertyCount ()

This method is deprecated.
deprecated in ddmlib with "implementation detail" as reason.

Returns
int

getPropertySync

String getPropertySync (String name)

This method is deprecated.
use getProperty(String) instead.

Parameters
name String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

getRegion

String getRegion ()

Returns
String

getScreenshot

RawImage getScreenshot ()

Returns
RawImage

Throws
TimeoutException
AdbCommandRejectedException
IOException

getScreenshot

RawImage getScreenshot (long timeout, 
                TimeUnit unit)

Parameters
timeout long

unit TimeUnit

Returns
RawImage

Throws
TimeoutException
AdbCommandRejectedException
IOException

getSerialNumber

String getSerialNumber ()

Returns
String

getState

IDevice.DeviceState getState ()

Returns
IDevice.DeviceState

getSyncService

SyncService getSyncService ()

Returns
SyncService

Throws
TimeoutException
AdbCommandRejectedException
IOException

getSystemProperty

Future<String> getSystemProperty (String name)

Parameters
name String

Returns
Future<String>

getVersion

AndroidVersion getVersion ()

Returns
AndroidVersion

hasClients

boolean hasClients ()

Returns
boolean

installPackage

void installPackage (String packageFilePath, 
                boolean reinstall, 
                String... extraArgs)

Parameters
packageFilePath String

reinstall boolean

extraArgs String

Throws
InstallException

installPackages

void installPackages (List<File> apkFilePaths, 
                boolean reinstall, 
                List<String> extraArgs, 
                long timeOutInMs, 
                TimeUnit timeunit)

Parameters
apkFilePaths List

reinstall boolean

extraArgs List

timeOutInMs long

timeunit TimeUnit

Throws
InstallException

installRemotePackage

void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                String... extraArgs)

Parameters
remoteFilePath String

reinstall boolean

extraArgs String

Throws
InstallException

isBootLoader

boolean isBootLoader ()

Returns
boolean

isEmulator

boolean isEmulator ()

Returns
boolean

isOffline

boolean isOffline ()

Returns
boolean

isOnline

boolean isOnline ()

Returns
boolean

isRoot

boolean isRoot ()

Returns
boolean

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

pullFile

void pullFile (String remote, 
                String local)

Parameters
remote String

local String

Throws
IOException
AdbCommandRejectedException
TimeoutException
SyncException

pushFile

void pushFile (String local, 
                String remote)

Parameters
local String

remote String

Throws
IOException
AdbCommandRejectedException
TimeoutException
SyncException

reboot

void reboot (String into)

Parameters
into String

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeForward

void removeForward (int localPort, 
                int remotePort)

Parameters
localPort int

remotePort int

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeForward

void removeForward (int localPort, 
                String remoteSocketName, 
                IDevice.DeviceUnixSocketNamespace namespace)

Parameters
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeRemotePackage

void removeRemotePackage (String remoteFilePath)

Parameters
remoteFilePath String

Throws
InstallException

root

boolean root ()

Returns
boolean

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

runEventLogService

void runEventLogService (LogReceiver receiver)

Parameters
receiver LogReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException

runLogService

void runLogService (String logname, 
                LogReceiver receiver)

Parameters
logname String

receiver LogReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException

setSerial

void setSerial (String serial)

Parameters
serial String

startScreenRecorder

void startScreenRecorder (String remoteFilePath, 
                ScreenRecorderOptions options, 
                IShellOutputReceiver receiver)

Parameters
remoteFilePath String

options ScreenRecorderOptions

receiver IShellOutputReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

supportsFeature

boolean supportsFeature (IDevice.HardwareFeature arg0)

Parameters
arg0 IDevice.HardwareFeature

Returns
boolean

supportsFeature

boolean supportsFeature (IDevice.Feature feature)

Parameters
feature IDevice.Feature

Returns
boolean

syncPackageToDevice

String syncPackageToDevice (String localFilePath)

Parameters
localFilePath String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
IOException
SyncException

uninstallPackage

String uninstallPackage (String packageName)

Parameters
packageName String

Returns
String

Throws
InstallException