summaryrefslogtreecommitdiffstats
path: root/core/java/android/net/LinkProperties.java
diff options
context:
space:
mode:
authorPaul Jensen <pauljensen@google.com>2014-04-28 10:33:11 -0400
committerLorenzo Colitti <lorenzo@google.com>2014-05-14 03:56:34 -0700
commit992f25257938ecc0378514f21c6e6e6375272976 (patch)
tree655d587b0275b1fd6c32a22f504fc6292f6f4b75 /core/java/android/net/LinkProperties.java
parent7b81602f3c18df8a4ca0342c514af8f7e394c0d7 (diff)
downloadframeworks_base-992f25257938ecc0378514f21c6e6e6375272976.zip
frameworks_base-992f25257938ecc0378514f21c6e6e6375272976.tar.gz
frameworks_base-992f25257938ecc0378514f21c6e6e6375272976.tar.bz2
Separate network and interface addition/removal netd APIs.
This should facilitate stacked interfaces (i.e. clatd). Change-Id: Ib3e7a4d3847ef6ec4449451f6da42e75959baa4f
Diffstat (limited to 'core/java/android/net/LinkProperties.java')
-rw-r--r--core/java/android/net/LinkProperties.java29
1 files changed, 29 insertions, 0 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
/**