to top
public class

WifiPreparer

extends Object
implements ITargetPreparer ITargetCleaner @OptionClass(alias = "wifi")
java.lang.Object
   ↳ com.android.tradefed.targetprep.WifiPreparer

Class Overview

A ITargetPreparer that configures wifi on the device if necessary.

Unlike DeviceSetup, this preparer works when adb is not root aka user builds.

Summary

Fields
private boolean mDisconnectWifiAfterTest @Option(name = "disconnect-wifi-after-test", description = "disconnect from wifi network after test completes.")
private boolean mMonitorNetwork @Option(name = "monitor-network", description = "monitor network connectivity during test.")
private boolean mSkip @Option(name = "skip", description = "skip the connectivity check and wifi setup")
private String mWifiNetwork @Option(name = "wifi-network", description = "the name of wifi network to connect to.")
private String mWifiPsk @Option(name = "wifi-psk", description = "WPA-PSK passphrase of wifi network to connect to.")
Public Constructors
WifiPreparer()
Public Methods
void setUp(ITestDevice device, IBuildInfo buildInfo)
Perform the target setup for testing.
void tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
Perform the target cleanup/teardown after testing.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.targetprep.ITargetPreparer
From interface com.android.tradefed.targetprep.ITargetCleaner

Fields

private boolean mDisconnectWifiAfterTest

private boolean mMonitorNetwork

private boolean mSkip

private String mWifiNetwork

private String mWifiPsk

Public Constructors

public WifiPreparer ()

Public Methods

public void setUp (ITestDevice device, IBuildInfo buildInfo)

Perform the target setup for testing.

Parameters
device the ITestDevice to prepare.
buildInfo data about the build under test.

public void tearDown (ITestDevice device, IBuildInfo buildInfo, Throwable e)

Perform the target cleanup/teardown after testing.

Parameters
device the ITestDevice to prepare.
buildInfo data about the build under test.
e if the invocation ended with an exception, this will be the exception that was caught at the Invocation level. Otherwise, will be null.