StubDevice

public class StubDevice
extends Object implements IDevice

java.lang.Object
   ↳ com.android.tradefed.device.StubDevice


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, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, String... extraArgs)

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

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, InstallReceiver receiver, String... extraArgs)

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

void installRemotePackage(String remoteFilePath, boolean reinstall, InstallReceiver receiver, long maxTimeout, long maxTimeToOutputResponse, TimeUnit maxTimeUnits, 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

public StubDevice (String serial)

Parameters
serial String

StubDevice

public StubDevice (String serial, 
                boolean isEmulator)

Parameters
serial String

isEmulator boolean

Public methods

arePropertiesSet

public boolean arePropertiesSet ()

Returns
boolean

createForward

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

Parameters
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Throws
TimeoutException
AdbCommandRejectedException
IOException

createForward

public void createForward (int localPort, 
                int remotePort)

Parameters
localPort int

remotePort int

Throws
TimeoutException
AdbCommandRejectedException
IOException

executeShellCommand

public void executeShellCommand (String command, 
                IShellOutputReceiver receiver)

Parameters
command String

receiver IShellOutputReceiver

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

executeShellCommand

public 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

public 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

public 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

public List<String> getAbis ()

Returns
List<String>

getAvdName

public String getAvdName ()

Returns
String

getBattery

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

Parameters
freshnessTime long

timeUnit TimeUnit

Returns
Future<Integer>

getBattery

public Future<Integer> getBattery ()

Returns
Future<Integer>

getBatteryLevel

public Integer getBatteryLevel (long freshnessMs)

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

Parameters
freshnessMs long

Returns
Integer

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

getBatteryLevel

public Integer getBatteryLevel ()

This method is deprecated.
use getBattery() instead.

Returns
Integer

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

getClient

public Client getClient (String applicationName)

Parameters
applicationName String

Returns
Client

getClientName

public String getClientName (int pid)

Parameters
pid int

Returns
String

getClients

public Client[] getClients ()

Returns
Client[]

getDensity

public int getDensity ()

Returns
int

getFileListingService

public FileListingService getFileListingService ()

Returns
FileListingService

getLanguage

public String getLanguage ()

Returns
String

getMountPoint

public String getMountPoint (String name)

Parameters
name String

Returns
String

getName

public String getName ()

Returns
String

getProperties

public Map<String, String> getProperties ()

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

Returns
Map<String, String>

getProperty

public String getProperty (String name)

Parameters
name String

Returns
String

getPropertyCacheOrSync

public String getPropertyCacheOrSync (String name)

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

Parameters
name String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

getPropertyCount

public int getPropertyCount ()

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

Returns
int

getPropertySync

public String getPropertySync (String name)

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

Parameters
name String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
ShellCommandUnresponsiveException
IOException

getRegion

public String getRegion ()

Returns
String

getScreenshot

public RawImage getScreenshot ()

Returns
RawImage

Throws
TimeoutException
AdbCommandRejectedException
IOException

getScreenshot

public RawImage getScreenshot (long timeout, 
                TimeUnit unit)

Parameters
timeout long

unit TimeUnit

Returns
RawImage

Throws
TimeoutException
AdbCommandRejectedException
IOException

getSerialNumber

public String getSerialNumber ()

Returns
String

getState

public IDevice.DeviceState getState ()

Returns
IDevice.DeviceState

getSyncService

public SyncService getSyncService ()

Returns
SyncService

Throws
TimeoutException
AdbCommandRejectedException
IOException

getSystemProperty

public Future<String> getSystemProperty (String name)

Parameters
name String

Returns
Future<String>

getVersion

public AndroidVersion getVersion ()

Returns
AndroidVersion

hasClients

public boolean hasClients ()

Returns
boolean

installPackage

public void installPackage (String packageFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits, 
                String... extraArgs)

Parameters
packageFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

Throws
InstallException

installPackage

public void installPackage (String packageFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                String... extraArgs)

Parameters
packageFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

Throws
InstallException

installPackage

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

Parameters
packageFilePath String

reinstall boolean

extraArgs String

Throws
InstallException

installPackages

public 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

public void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                String... extraArgs)

Parameters
remoteFilePath String

reinstall boolean

receiver InstallReceiver

extraArgs String

Throws
InstallException

installRemotePackage

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

Parameters
remoteFilePath String

reinstall boolean

extraArgs String

Throws
InstallException

installRemotePackage

public void installRemotePackage (String remoteFilePath, 
                boolean reinstall, 
                InstallReceiver receiver, 
                long maxTimeout, 
                long maxTimeToOutputResponse, 
                TimeUnit maxTimeUnits, 
                String... extraArgs)

Parameters
remoteFilePath String

reinstall boolean

receiver InstallReceiver

maxTimeout long

maxTimeToOutputResponse long

maxTimeUnits TimeUnit

extraArgs String

Throws
InstallException

isBootLoader

public boolean isBootLoader ()

Returns
boolean

isEmulator

public boolean isEmulator ()

Returns
boolean

isOffline

public boolean isOffline ()

Returns
boolean

isOnline

public boolean isOnline ()

Returns
boolean

isRoot

public boolean isRoot ()

Returns
boolean

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

pullFile

public void pullFile (String remote, 
                String local)

Parameters
remote String

local String

Throws
IOException
AdbCommandRejectedException
TimeoutException
SyncException

pushFile

public void pushFile (String local, 
                String remote)

Parameters
local String

remote String

Throws
IOException
AdbCommandRejectedException
TimeoutException
SyncException

reboot

public void reboot (String into)

Parameters
into String

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeForward

public void removeForward (int localPort, 
                int remotePort)

Parameters
localPort int

remotePort int

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeForward

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

Parameters
localPort int

remoteSocketName String

namespace IDevice.DeviceUnixSocketNamespace

Throws
TimeoutException
AdbCommandRejectedException
IOException

removeRemotePackage

public void removeRemotePackage (String remoteFilePath)

Parameters
remoteFilePath String

Throws
InstallException

root

public boolean root ()

Returns
boolean

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

runEventLogService

public void runEventLogService (LogReceiver receiver)

Parameters
receiver LogReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException

runLogService

public void runLogService (String logname, 
                LogReceiver receiver)

Parameters
logname String

receiver LogReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException

setSerial

public void setSerial (String serial)

Parameters
serial String

startScreenRecorder

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

Parameters
remoteFilePath String

options ScreenRecorderOptions

receiver IShellOutputReceiver

Throws
TimeoutException
AdbCommandRejectedException
IOException
ShellCommandUnresponsiveException

supportsFeature

public boolean supportsFeature (IDevice.HardwareFeature arg0)

Parameters
arg0 IDevice.HardwareFeature

Returns
boolean

supportsFeature

public boolean supportsFeature (IDevice.Feature feature)

Parameters
feature IDevice.Feature

Returns
boolean

syncPackageToDevice

public String syncPackageToDevice (String localFilePath)

Parameters
localFilePath String

Returns
String

Throws
TimeoutException
AdbCommandRejectedException
IOException
SyncException

uninstallPackage

public String uninstallPackage (String packageName)

Parameters
packageName String

Returns
String

Throws
InstallException