summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/net/LinkProperties.java29
-rw-r--r--core/java/android/os/INetworkManagementService.aidl16
2 files changed, 42 insertions, 3 deletions
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index 2dcc544..0a09fcb 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -642,6 +642,35 @@ public class LinkProperties implements Parcelable {
return result;
}
+ /**
+ * Compares all interface names in this LinkProperties with another
+ * LinkProperties, examining both the the base link and all stacked links.
+ *
+ * @param target a LinkProperties with the new list of interface names
+ * @return the differences between the interface names.
+ * @hide
+ */
+ public CompareResult<String> compareAllInterfaceNames(LinkProperties target) {
+ /*
+ * Duplicate the interface names into removed, we will be removing
+ * interface names which are common between this and target
+ * leaving the interface names that are different. And interface names which
+ * are in target but not in this are placed in added.
+ */
+ CompareResult<String> result = new CompareResult<String>();
+
+ result.removed = getAllInterfaceNames();
+ result.added.clear();
+ if (target != null) {
+ for (String r : target.getAllInterfaceNames()) {
+ if (! result.removed.remove(r)) {
+ result.added.add(r);
+ }
+ }
+ }
+ return result;
+ }
+
@Override
/**
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index 0784800..eb9ba13 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -410,15 +410,25 @@ interface INetworkManagementService
boolean isNetworkActive();
/**
- * setup a new network
+ * Setup a new network.
*/
- void createNetwork(int netId, String iface);
+ void createNetwork(int netId);
/**
- * remove a network
+ * Remove a network.
*/
void removeNetwork(int netId);
+ /**
+ * Add an interface to a network.
+ */
+ void addInterfaceToNetwork(String iface, int netId);
+
+ /**
+ * Remove an Interface from a network.
+ */
+ void removeInterfaceFromNetwork(String iface, int netId);
+
void addLegacyRouteForNetId(int netId, in RouteInfo routeInfo, int uid);
void removeLegacyRouteForNetId(int netId, in RouteInfo routeInfo, int uid);