Merge "TestNetworkManager: add support for configuring tap link addresses"
This commit is contained in:
commit
e548be264b
1 changed files with 18 additions and 0 deletions
|
|
@ -192,6 +192,24 @@ public class TestNetworkManager {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a tap interface for testing purposes
|
||||
*
|
||||
* @param linkAddrs an array of LinkAddresses to assign to the TAP interface
|
||||
* @return A TestNetworkInterface representing the underlying TAP interface. Close the contained
|
||||
* ParcelFileDescriptor to tear down the TAP interface.
|
||||
* @hide
|
||||
*/
|
||||
@RequiresPermission(Manifest.permission.MANAGE_TEST_NETWORKS)
|
||||
@NonNull
|
||||
public TestNetworkInterface createTapInterface(@NonNull LinkAddress[] linkAddrs) {
|
||||
try {
|
||||
return mService.createInterface(TAP, CARRIER_UP, BRING_UP, linkAddrs, null /* iface */);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a tap interface for testing purposes
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in a new issue