summaryrefslogtreecommitdiff
path: root/core/java/android/net/EthernetManager.java
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-03-17 00:16:13 +0900
committerLorenzo Colitti <lorenzo@google.com>2020-03-19 09:46:37 +0900
commitda4fe152c44f516bd1303734d5dec78563a96aa3 (patch)
tree53f93021d159e15e49287ed58c95c0bec77564b4 /core/java/android/net/EthernetManager.java
parent2ea0b56cff0ec1c99a6f3a1660dd5b4d801eb5bf (diff)
Make Ethernet interfaces more testable.
This CL adds a setIncludeTestInterfaces method to EthernetManager that, when called, causes the Ethernet service to recognize and manage test interfaces created by TestNetworkManager. Bug: 150644681 Test: Tested by EthernetTetheringTest in same topic Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
Diffstat (limited to 'core/java/android/net/EthernetManager.java')
-rw-r--r--core/java/android/net/EthernetManager.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/net/EthernetManager.java b/core/java/android/net/EthernetManager.java
index 83b5f63576f2..d975017f9c8e 100644
--- a/core/java/android/net/EthernetManager.java
+++ b/core/java/android/net/EthernetManager.java
@@ -200,6 +200,21 @@ public class EthernetManager {
}
/**
+ * Whether to treat interfaces created by {@link TestNetworkManager#createTapInterface}
+ * as Ethernet interfaces. The effects of this method apply to any test interfaces that are
+ * already present on the system.
+ * @hide
+ */
+ @TestApi
+ public void setIncludeTestInterfaces(boolean include) {
+ try {
+ mService.setIncludeTestInterfaces(include);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* A request for a tethered interface.
*/
public static class TetheredInterfaceRequest {