TestNetworkInterface: improve documentation of newly added methods
This change addresses API review feedback and improves documentation. Specifically, it adds documentation for the newly added getMtu() and getMacAddress() methods, describes under which conditions the MAC address is null and adds a short blurb on how (or in what context) this class is used. Test: TH Bug: 236187143 Change-Id: I349897fd55f3085ce88c8b94c84ec636bb5eb2a6
This commit is contained in:
parent
61845d0b10
commit
2af2ae8168
1 changed files with 17 additions and 0 deletions
|
|
@ -29,6 +29,9 @@ import java.net.SocketException;
|
|||
/**
|
||||
* This class is used to return the interface name, fd, MAC, and MTU of the test interface
|
||||
*
|
||||
* TestNetworkInterfaces are created by TestNetworkService and provide a
|
||||
* wrapper around a tun/tap interface that can be used in integration tests.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
|
|
@ -97,11 +100,25 @@ public final class TestNetworkInterface implements Parcelable {
|
|||
return mInterfaceName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tap interface MacAddress.
|
||||
*
|
||||
* When TestNetworkInterface wraps a tun interface, the MAC address is null.
|
||||
*
|
||||
* @return the tap interface MAC address or null.
|
||||
*/
|
||||
@Nullable
|
||||
public MacAddress getMacAddress() {
|
||||
return mMacAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the interface MTU.
|
||||
*
|
||||
* MTU defaults to 1500 if an error occurs.
|
||||
*
|
||||
* @return MTU in bytes.
|
||||
*/
|
||||
public int getMtu() {
|
||||
return mMtu;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue