AbstractConnection
public
abstract
class
AbstractConnection
extends Object
java.lang.Object | |
↳ | com.android.tradefed.device.connection.AbstractConnection |
Abstract connection representation.
Summary
Public constructors | |
---|---|
AbstractConnection()
|
Public methods | |
---|---|
void
|
initializeConnection()
Initialize the connection of the device. |
void
|
notifyAdbRebootCalled()
Notify when doAdbReboot is called. |
void
|
reconnect(String serial)
Reconnect the connection to the device. |
void
|
reconnectForRecovery(String serial)
Reconnect the connection to the device for the recovery routine. |
void
|
recoverVirtualDevice(ITestDevice device, String snapshotId, DeviceNotAvailableException dnae)
Recover the given device with device reset. |
void
|
snapshotDevice(ITestDevice device, String snapshotId)
Snapshot the given device |
void
|
tearDownConnection()
Clean up the connection. |
Public constructors
AbstractConnection
public AbstractConnection ()
Public methods
initializeConnection
public void initializeConnection ()
Initialize the connection of the device.
Throws | |
---|---|
|
com.android.tradefed.targetprep.TargetSetupError |
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
|
TargetSetupError |
notifyAdbRebootCalled
public void notifyAdbRebootCalled ()
Notify when doAdbReboot is called.
reconnect
public void reconnect (String serial)
Reconnect the connection to the device.
Parameters | |
---|---|
serial |
String : The device serial number. |
Throws | |
---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
reconnectForRecovery
public void reconnectForRecovery (String serial)
Reconnect the connection to the device for the recovery routine.
Parameters | |
---|---|
serial |
String : The device serial number. |
Throws | |
---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
DeviceNotAvailableException |
recoverVirtualDevice
public void recoverVirtualDevice (ITestDevice device, String snapshotId, DeviceNotAvailableException dnae)
Recover the given device with device reset.
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice is used for device reset handler. |
snapshotId |
String : the snapshotId is used for fetching the correct snapshot to restore. |
dnae |
DeviceNotAvailableException : the DeviceNotAvailableException is existing device not available
exception. |
Throws | |
---|---|
DeviceNotAvailableException |
if fail on device recovery. |
snapshotDevice
public void snapshotDevice (ITestDevice device, String snapshotId)
Snapshot the given device
Parameters | |
---|---|
device |
ITestDevice : the ITestDevice is used for device snapshot handler. |
snapshotId |
String : the snapshotId is the name of the snapshot that will be saved. |
Throws | |
---|---|
DeviceNotAvailableException |
if fail on device recovery. |
tearDownConnection
public void tearDownConnection ()
Clean up the connection.