TestDeviceOptions
public
class
TestDeviceOptions
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.TestDeviceOptions |
Container for ITestDevice
Option
s
Summary
Nested classes | |
---|---|
enum |
TestDeviceOptions.InstanceType
|
Constants | |
---|---|
int |
DEFAULT_ADB_PORT
|
Fields | |
---|---|
public
static
final
String |
INSTANCE_TYPE_OPTION
|
Public constructors | |
---|---|
TestDeviceOptions()
|
Public methods | |
---|---|
int
|
getAdbRecoveryTimeout()
|
long
|
getAvailableTimeout()
|
File
|
getAvdConfigFile()
Return the Gce Avd config file to start the instance. |
String
|
getAvdConfigTestResourceName()
Return the Gce Avd config test resource name to start the instance. |
File
|
getAvdDriverBinary()
Return the path to the binary to start the Gce Avd instance. |
String
|
getBaseImage()
Returns the base image name to be used for the current instance |
String
|
getConnCheckUrl()
|
static
String
|
getCreateCommandByInstanceType(TestDeviceOptions.InstanceType type)
|
Integer
|
getCutoffBattery()
|
static
|
getExtraParamsByInstanceType(TestDeviceOptions.InstanceType type, String baseImage)
|
int
|
getFastbootTimeout()
|
String
|
getGceAccount()
Return the gce email account to use with the driver |
long
|
getGceCmdTimeout()
Return the Gce Avd timeout for the instance to come online. |
String
|
getGceDriverBuildIdParam()
Return the GCE driver parameter that should be paired with the build id from build info |
Log.LogLevel
|
getGceDriverLogLevel()
Return the log level of the Gce Avd driver. |
|
getGceDriverParams()
Return the additional GCE driver parameters provided via option |
int
|
getGceMaxAttempt()
Return the max number of attempts to start a gce device |
TestDeviceOptions.InstanceType
|
getInstanceType()
Returns the instance type of virtual device that should be created |
String
|
getInstanceUser()
Returns the instance type of GCE virtual device that should be created |
String
|
getLogcatOptions()
|
long
|
getMaxLogcatDataSize()
Get the approximate maximum size of a tmp logcat data to retain, in bytes. |
long
|
getMaxWifiConnectTime()
|
long
|
getOnlineTimeout()
|
|
getPostBootCommands()
|
int
|
getRebootTimeout()
|
int
|
getRemoteAdbPort()
Returns the remote port in instance that the adb server listens to |
|
getRemoteFetchFilePattern()
Returns the list of pattern to attempt to fetch via scp. |
File
|
getSerivceAccountJsonKeyFile()
|
File
|
getSshPrivateKeyPath()
Return the path of the ssh key to use for operations with the Gce Avd instance. |
int
|
getUnencryptRebootTimeout()
|
boolean
|
getUseFastbootErase()
|
int
|
getWifiAttempts()
|
int
|
getWifiRetryWaitTime()
|
String
|
getWifiUtilAPKPath()
|
boolean
|
isDisableKeyguard()
Check whether or not we should attempt to disable the keyguard once boot has completed |
boolean
|
isEnableAdbRoot()
Check whether adb root should be enabled on boot for this device |
boolean
|
isLogcatCaptureEnabled()
|
boolean
|
isWifiExpoRetryEnabled()
|
void
|
setAdbRecoveryTimeout(int adbRecoveryTimeout)
|
void
|
setAvdConfigFile(File avdConfigFile)
Set the Gce Avd config file to start the instance. |
void
|
setAvdDriverBinary(File avdDriverBinary)
Set the path to the binary to start the Gce Avd instance. |
void
|
setConnCheckUrl(String url)
|
void
|
setCutoffBattery(int cutoffBattery)
set the minimum battery level to continue the invocation. |
void
|
setDisableKeyguard(boolean disableKeyguard)
Set whether or not we should attempt to disable the keyguard once boot has completed |
void
|
setFastbootTimeout(int fastbootTimeout)
|
void
|
setGceCmdTimeout(long gceCmdTimeout)
Set the Gce Avd timeout for the instance to come online. |
void
|
setGceDriverBuildIdParam(String gceDriverBuildIdParam)
Set the GCE driver parameter that should be paired with the build id from build info |
void
|
setGceDriverLogLevel(Log.LogLevel mGceDriverLogLevel)
Set the log level of the Gce Avd driver. |
void
|
setGceMaxAttempt(int gceMaxAttempt)
Set the max number of attempts to start a gce device |
void
|
setLogcatOptions(String logcatOptions)
Set the options to be passed down to logcat |
void
|
setMaxLogcatDataSize(long maxLogcatDataSize)
Set the approximate maximum size of a tmp logcat to retain, in bytes |
void
|
setOnlineTimeout(long onlineTimeout)
|
void
|
setRebootTimeout(int rebootTimeout)
|
void
|
setServiceAccountJsonKeyFile(File jsonKeyFile)
Set the service account json key file. |
void
|
setSshPrivateKeyPath(File sshPrivateKeyPath)
Set the path of the ssh key to use for operations with the Gce Avd instance. |
void
|
setUnencryptRebootTimeout(int unencryptRebootTimeout)
|
void
|
setUseFastbootErase(boolean useFastbootErase)
|
void
|
setWifiAttempts(int wifiAttempts)
|
boolean
|
shouldDisableReboot()
|
boolean
|
shouldSkipTearDown()
Returns true if GCE tear down should be skipped. |
boolean
|
shouldUseContentProvider()
Returns whether or not the Tradefed content provider can be used to push/pull files. |
boolean
|
waitForGceTearDown()
Returns true if we should block on GCE tear down completion before proceeding. |
Constants
DEFAULT_ADB_PORT
public static final int DEFAULT_ADB_PORT
Constant Value: 5555 (0x000015b3)
Fields
INSTANCE_TYPE_OPTION
public static final String INSTANCE_TYPE_OPTION
Public constructors
TestDeviceOptions
public TestDeviceOptions ()
Public methods
getAdbRecoveryTimeout
public int getAdbRecoveryTimeout ()
Returns | |
---|---|
int |
the timeout in msecs to boot into recovery mode. |
getAvailableTimeout
public long getAvailableTimeout ()
Returns | |
---|---|
long |
the default time in ms to to wait for a device to be available. |
getAvdConfigFile
public File getAvdConfigFile ()
Return the Gce Avd config file to start the instance.
Returns | |
---|---|
File |
getAvdConfigTestResourceName
public String getAvdConfigTestResourceName ()
Return the Gce Avd config test resource name to start the instance.
Returns | |
---|---|
String |
getAvdDriverBinary
public File getAvdDriverBinary ()
Return the path to the binary to start the Gce Avd instance.
Returns | |
---|---|
File |
getBaseImage
public String getBaseImage ()
Returns the base image name to be used for the current instance
Returns | |
---|---|
String |
getConnCheckUrl
public String getConnCheckUrl ()
Returns | |
---|---|
String |
the default URL to be used for connectivity tests. |
getCreateCommandByInstanceType
public static String getCreateCommandByInstanceType (TestDeviceOptions.InstanceType type)
Parameters | |
---|---|
type |
TestDeviceOptions.InstanceType |
Returns | |
---|---|
String |
getCutoffBattery
public Integer getCutoffBattery ()
Returns | |
---|---|
Integer |
the minimum battery level to continue the invocation. |
getExtraParamsByInstanceType
public staticgetExtraParamsByInstanceType (TestDeviceOptions.InstanceType type, String baseImage)
Parameters | |
---|---|
type |
TestDeviceOptions.InstanceType |
baseImage |
String |
Returns | |
---|---|
|
getFastbootTimeout
public int getFastbootTimeout ()
Returns | |
---|---|
int |
the timeout to boot into fastboot mode in msecs. |
getGceAccount
public String getGceAccount ()
Return the gce email account to use with the driver
Returns | |
---|---|
String |
getGceCmdTimeout
public long getGceCmdTimeout ()
Return the Gce Avd timeout for the instance to come online.
Returns | |
---|---|
long |
getGceDriverBuildIdParam
public String getGceDriverBuildIdParam ()
Return the GCE driver parameter that should be paired with the build id from build info
Returns | |
---|---|
String |
getGceDriverLogLevel
public Log.LogLevel getGceDriverLogLevel ()
Return the log level of the Gce Avd driver.
Returns | |
---|---|
Log.LogLevel |
getGceDriverParams
publicgetGceDriverParams ()
Return the additional GCE driver parameters provided via option
Returns | |
---|---|
|
getGceMaxAttempt
public int getGceMaxAttempt ()
Return the max number of attempts to start a gce device
Returns | |
---|---|
int |
getInstanceType
public TestDeviceOptions.InstanceType getInstanceType ()
Returns the instance type of virtual device that should be created
Returns | |
---|---|
TestDeviceOptions.InstanceType |
getInstanceUser
public String getInstanceUser ()
Returns the instance type of GCE virtual device that should be created
Returns | |
---|---|
String |
getLogcatOptions
public String getLogcatOptions ()
Returns | |
---|---|
String |
the configured logcat options |
getMaxLogcatDataSize
public long getMaxLogcatDataSize ()
Get the approximate maximum size of a tmp logcat data to retain, in bytes.
Returns | |
---|---|
long |
getMaxWifiConnectTime
public long getMaxWifiConnectTime ()
Returns | |
---|---|
long |
the maximum time to attempt to connect to wifi. |
getOnlineTimeout
public long getOnlineTimeout ()
Returns | |
---|---|
long |
the default time in ms to to wait for a device to be online. |
getPostBootCommands
publicgetPostBootCommands ()
Returns | |
---|---|
|
a list of shell commands to run after reboots. |
getRebootTimeout
public int getRebootTimeout ()
Returns | |
---|---|
int |
the timeout in msecs for the full system boot. |
getRemoteAdbPort
public int getRemoteAdbPort ()
Returns the remote port in instance that the adb server listens to
Returns | |
---|---|
int |
getRemoteFetchFilePattern
publicgetRemoteFetchFilePattern ()
Returns the list of pattern to attempt to fetch via scp.
Returns | |
---|---|
|
getSerivceAccountJsonKeyFile
public File getSerivceAccountJsonKeyFile ()
Returns | |
---|---|
File |
the service account json key file. |
getSshPrivateKeyPath
public File getSshPrivateKeyPath ()
Return the path of the ssh key to use for operations with the Gce Avd instance.
Returns | |
---|---|
File |
getUnencryptRebootTimeout
public int getUnencryptRebootTimeout ()
Returns | |
---|---|
int |
the timeout in msecs for the filesystem to be formatted and the device to reboot after unencryption. |
getUseFastbootErase
public boolean getUseFastbootErase ()
Returns | |
---|---|
boolean |
whether to use fastboot erase instead of fastboot format to wipe partitions. |
getWifiAttempts
public int getWifiAttempts ()
Returns | |
---|---|
int |
the default number of attempts to connect to wifi network. |
getWifiRetryWaitTime
public int getWifiRetryWaitTime ()
Returns | |
---|---|
int |
the base wait time between wifi connect retries. |
getWifiUtilAPKPath
public String getWifiUtilAPKPath ()
Returns | |
---|---|
String |
the wifiutil apk path |
isDisableKeyguard
public boolean isDisableKeyguard ()
Check whether or not we should attempt to disable the keyguard once boot has completed
Returns | |
---|---|
boolean |
isEnableAdbRoot
public boolean isEnableAdbRoot ()
Check whether adb root should be enabled on boot for this device
Returns | |
---|---|
boolean |
isLogcatCaptureEnabled
public boolean isLogcatCaptureEnabled ()
Returns | |
---|---|
boolean |
true if background logcat capture is enabled |
isWifiExpoRetryEnabled
public boolean isWifiExpoRetryEnabled ()
Returns | |
---|---|
boolean |
if the exponential retry strategy should be used. |
setAdbRecoveryTimeout
public void setAdbRecoveryTimeout (int adbRecoveryTimeout)
Parameters | |
---|---|
adbRecoveryTimeout |
int : the timeout in msecs to boot into recovery mode.
|
setAvdConfigFile
public void setAvdConfigFile (File avdConfigFile)
Set the Gce Avd config file to start the instance.
Parameters | |
---|---|
avdConfigFile |
File |
setAvdDriverBinary
public void setAvdDriverBinary (File avdDriverBinary)
Set the path to the binary to start the Gce Avd instance.
Parameters | |
---|---|
avdDriverBinary |
File |
setConnCheckUrl
public void setConnCheckUrl (String url)
Parameters | |
---|---|
url |
String |
setCutoffBattery
public void setCutoffBattery (int cutoffBattery)
set the minimum battery level to continue the invocation.
Parameters | |
---|---|
cutoffBattery |
int |
setDisableKeyguard
public void setDisableKeyguard (boolean disableKeyguard)
Set whether or not we should attempt to disable the keyguard once boot has completed
Parameters | |
---|---|
disableKeyguard |
boolean |
setFastbootTimeout
public void setFastbootTimeout (int fastbootTimeout)
Parameters | |
---|---|
fastbootTimeout |
int : the timout in msecs to boot into fastboot mode.
|
setGceCmdTimeout
public void setGceCmdTimeout (long gceCmdTimeout)
Set the Gce Avd timeout for the instance to come online.
Parameters | |
---|---|
gceCmdTimeout |
long |
setGceDriverBuildIdParam
public void setGceDriverBuildIdParam (String gceDriverBuildIdParam)
Set the GCE driver parameter that should be paired with the build id from build info
Parameters | |
---|---|
gceDriverBuildIdParam |
String |
setGceDriverLogLevel
public void setGceDriverLogLevel (Log.LogLevel mGceDriverLogLevel)
Set the log level of the Gce Avd driver.
Parameters | |
---|---|
mGceDriverLogLevel |
Log.LogLevel |
setGceMaxAttempt
public void setGceMaxAttempt (int gceMaxAttempt)
Set the max number of attempts to start a gce device
Parameters | |
---|---|
gceMaxAttempt |
int |
setLogcatOptions
public void setLogcatOptions (String logcatOptions)
Set the options to be passed down to logcat
Parameters | |
---|---|
logcatOptions |
String |
setMaxLogcatDataSize
public void setMaxLogcatDataSize (long maxLogcatDataSize)
Set the approximate maximum size of a tmp logcat to retain, in bytes
Parameters | |
---|---|
maxLogcatDataSize |
long |
setOnlineTimeout
public void setOnlineTimeout (long onlineTimeout)
Parameters | |
---|---|
onlineTimeout |
long |
setRebootTimeout
public void setRebootTimeout (int rebootTimeout)
Parameters | |
---|---|
rebootTimeout |
int : the timeout in msecs for the system to fully boot.
|
setServiceAccountJsonKeyFile
public void setServiceAccountJsonKeyFile (File jsonKeyFile)
Set the service account json key file.
Parameters | |
---|---|
jsonKeyFile |
File : the key file.
|
setSshPrivateKeyPath
public void setSshPrivateKeyPath (File sshPrivateKeyPath)
Set the path of the ssh key to use for operations with the Gce Avd instance.
Parameters | |
---|---|
sshPrivateKeyPath |
File |
setUnencryptRebootTimeout
public void setUnencryptRebootTimeout (int unencryptRebootTimeout)
Parameters | |
---|---|
unencryptRebootTimeout |
int : the timeout in msecs for the filesystem to be formatted and
the device to reboot after unencryption.
|
setUseFastbootErase
public void setUseFastbootErase (boolean useFastbootErase)
Parameters | |
---|---|
useFastbootErase |
boolean : whether to use fastboot erase instead of fastboot format to wipe
partitions.
|
setWifiAttempts
public void setWifiAttempts (int wifiAttempts)
Parameters | |
---|---|
wifiAttempts |
int |
shouldDisableReboot
public boolean shouldDisableReboot ()
Returns | |
---|---|
boolean |
if device reboot should be disabled |
shouldSkipTearDown
public boolean shouldSkipTearDown ()
Returns true if GCE tear down should be skipped. False otherwise.
Returns | |
---|---|
boolean |
shouldUseContentProvider
public boolean shouldUseContentProvider ()
Returns whether or not the Tradefed content provider can be used to push/pull files.
Returns | |
---|---|
boolean |
waitForGceTearDown
public boolean waitForGceTearDown ()
Returns true if we should block on GCE tear down completion before proceeding.
Returns | |
---|---|
boolean |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-10-02 UTC.