BluetoothHciSnoopLogCollector
public
class
BluetoothHciSnoopLogCollector
extends FilePullerDeviceMetricCollector
java.lang.Object | |||
↳ | com.android.tradefed.device.metric.BaseDeviceMetricCollector | ||
↳ | com.android.tradefed.device.metric.FilePullerDeviceMetricCollector | ||
↳ | com.android.tradefed.device.metric.BluetoothHciSnoopLogCollector |
Collector to enable Bluetooth HCI snoop logging on the DUT and to collect the log for each test. The collector will configure and enable snoop logging for the test run and revert the settings after the test run.
Summary
Fields | |
---|---|
public
static
final
String |
SNOOP_LOG_MODE_PROPERTY
|
Public constructors | |
---|---|
BluetoothHciSnoopLogCollector()
|
Public methods | |
---|---|
String
|
getReportingDir()
Retrieve the directory to report the HCI snoop logs to. |
void
|
onTestEnd(DeviceMetricData testData,
Callback when a test case is ended. |
void
|
onTestRunEnd(DeviceMetricData runData,
Callback when a test run is ended. |
void
|
onTestRunStart(DeviceMetricData runData)
Callback when a test run is started. |
void
|
onTestStart(DeviceMetricData testData)
Callback when a test case is started. |
void
|
processMetricDirectory(String key, File metricDirectory, DeviceMetricData runData)
Implementation of the method should allow to log the directory, parse it for metrics to be
put in |
final
void
|
processMetricFile(String key, File metricFile, DeviceMetricData runData)
Implementation of the method should allow to log the file, parse it for metrics to be put in
|
Protected methods | |
---|---|
void
|
executeShellCommand(ITestDevice device, String command)
Execute shell command on the device. |
Fields
SNOOP_LOG_MODE_PROPERTY
public static final String SNOOP_LOG_MODE_PROPERTY
Public constructors
BluetoothHciSnoopLogCollector
public BluetoothHciSnoopLogCollector ()
Public methods
getReportingDir
public String getReportingDir ()
Retrieve the directory to report the HCI snoop logs to.
Returns | |
---|---|
String |
onTestEnd
public void onTestEnd (DeviceMetricData testData,currentTestCaseMetrics, TestDescription test)
Callback when a test case is ended. This should be the time for clean up.
Parameters | |
---|---|
testData |
DeviceMetricData : the DeviceMetricData holding the data for the test case. Will be the
same object as during onTestStart(com.android.tradefed.device.metric.DeviceMetricData) . |
currentTestCaseMetrics |
: the current map of metrics passed to ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) . |
test |
TestDescription : the TestDescription of the test case in progress. |
Throws | |
---|---|
DeviceNotAvailableException |
onTestRunEnd
public void onTestRunEnd (DeviceMetricData runData,currentRunMetrics)
Callback when a test run is ended. This should be the time for clean up.
Parameters | |
---|---|
runData |
DeviceMetricData : the DeviceMetricData holding the data for the run. Will be the same
object as during onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData) . |
currentRunMetrics |
: the current map of metrics passed to ERROR(/#testRunEnded(long,Map)) . |
Throws | |
---|---|
DeviceNotAvailableException |
onTestRunStart
public void onTestRunStart (DeviceMetricData runData)
Callback when a test run is started.
Parameters | |
---|---|
runData |
DeviceMetricData : the DeviceMetricData holding the data for the run. |
Throws | |
---|---|
DeviceNotAvailableException |
onTestStart
public void onTestStart (DeviceMetricData testData)
Callback when a test case is started.
Parameters | |
---|---|
testData |
DeviceMetricData : the DeviceMetricData holding the data for the test case. |
Throws | |
---|---|
DeviceNotAvailableException |
processMetricDirectory
public void processMetricDirectory (String key, File metricDirectory, DeviceMetricData runData)
Implementation of the method should allow to log the directory, parse it for metrics to be
put in DeviceMetricData
.
Parameters | |
---|---|
key |
String : the option key associated to the directory that was pulled. |
metricDirectory |
File : the ERROR(/File) pulled from the device matching the option key. |
runData |
DeviceMetricData : the DeviceMetricData where metrics can be stored. |
processMetricFile
public final void processMetricFile (String key, File metricFile, DeviceMetricData runData)
Implementation of the method should allow to log the file, parse it for metrics to be put in
DeviceMetricData
.
Parameters | |
---|---|
key |
String : the option key associated to the file that was pulled. |
metricFile |
File : the ERROR(/File) pulled from the device matching the option key. |
runData |
DeviceMetricData : the DeviceMetricData where metrics can be stored. |
Protected methods
executeShellCommand
protected void executeShellCommand (ITestDevice device, String command)
Execute shell command on the device. If the execution failed (non-zero exit code), throw a
DeviceRuntimeException
.
Parameters | |
---|---|
device |
ITestDevice |
command |
String |
Throws | |
---|---|
|
com.android.tradefed.device.DeviceRuntimeException |
DeviceNotAvailableException |