summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-10-28 07:00:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-28 07:00:31 +0000
commit111cc9f511dc65006fc2972c9ecbf295619e09b9 (patch)
tree368b3ffcc2dbb873e0acfbb9348cc288cc604404
parentaab38b7ea0b1774d158789772d0f6b1b99c1d3c9 (diff)
parentf3cab63ef2248aebf2c931cd1e84d5739791fa50 (diff)
downloadframeworks_base-111cc9f511dc65006fc2972c9ecbf295619e09b9.zip
frameworks_base-111cc9f511dc65006fc2972c9ecbf295619e09b9.tar.gz
frameworks_base-111cc9f511dc65006fc2972c9ecbf295619e09b9.tar.bz2
Merge "Change removeStackedLink to take an interface name." into lmp-mr1-dev
-rw-r--r--core/java/android/net/BaseNetworkStateTracker.java10
-rw-r--r--core/java/android/net/LinkProperties.java10
-rw-r--r--core/java/android/net/MobileDataStateTracker.java10
-rw-r--r--core/java/android/net/NetworkStateTracker.java10
-rw-r--r--core/tests/coretests/src/android/net/LinkPropertiesTest.java6
-rw-r--r--services/core/java/com/android/server/connectivity/Nat464Xlat.java2
6 files changed, 9 insertions, 39 deletions
diff --git a/core/java/android/net/BaseNetworkStateTracker.java b/core/java/android/net/BaseNetworkStateTracker.java
index 58d0048..e4e5b1e 100644
--- a/core/java/android/net/BaseNetworkStateTracker.java
+++ b/core/java/android/net/BaseNetworkStateTracker.java
@@ -170,16 +170,6 @@ public abstract class BaseNetworkStateTracker implements NetworkStateTracker {
}
@Override
- public void addStackedLink(LinkProperties link) {
- mLinkProperties.addStackedLink(link);
- }
-
- @Override
- public void removeStackedLink(LinkProperties link) {
- mLinkProperties.removeStackedLink(link);
- }
-
- @Override
public void supplyMessenger(Messenger messenger) {
// not supported on this network
}
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index 662c576..ef731b6 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -493,16 +493,16 @@ public final class LinkProperties implements Parcelable {
/**
* Removes a stacked link.
*
- * If there a stacked link with the same interfacename as link, it is
+ * If there is a stacked link with the given interface name, it is
* removed. Otherwise, nothing changes.
*
- * @param link The link to remove.
+ * @param iface The interface name of the link to remove.
* @return true if the link was removed, false otherwise.
* @hide
*/
- public boolean removeStackedLink(LinkProperties link) {
- if (link != null && link.getInterfaceName() != null) {
- LinkProperties removed = mStackedLinks.remove(link.getInterfaceName());
+ public boolean removeStackedLink(String iface) {
+ if (iface != null) {
+ LinkProperties removed = mStackedLinks.remove(iface);
return removed != null;
}
return false;
diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java
index d8012fe..40b7e06 100644
--- a/core/java/android/net/MobileDataStateTracker.java
+++ b/core/java/android/net/MobileDataStateTracker.java
@@ -661,16 +661,6 @@ public class MobileDataStateTracker extends BaseNetworkStateTracker {
}
@Override
- public void addStackedLink(LinkProperties link) {
- mLinkProperties.addStackedLink(link);
- }
-
- @Override
- public void removeStackedLink(LinkProperties link) {
- mLinkProperties.removeStackedLink(link);
- }
-
- @Override
public String toString() {
final CharArrayWriter writer = new CharArrayWriter();
final PrintWriter pw = new PrintWriter(writer);
diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java
index 35500cc..c80782c 100644
--- a/core/java/android/net/NetworkStateTracker.java
+++ b/core/java/android/net/NetworkStateTracker.java
@@ -216,16 +216,6 @@ public interface NetworkStateTracker {
*/
public void setDependencyMet(boolean met);
- /**
- * Informs the state tracker that another interface is stacked on top of it.
- **/
- public void addStackedLink(LinkProperties link);
-
- /**
- * Informs the state tracker that a stacked interface has been removed.
- **/
- public void removeStackedLink(LinkProperties link);
-
/*
* Called once to setup async channel between this and
* the underlying network specific code.
diff --git a/core/tests/coretests/src/android/net/LinkPropertiesTest.java b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
index 4015b3d..5b1a59c 100644
--- a/core/tests/coretests/src/android/net/LinkPropertiesTest.java
+++ b/core/tests/coretests/src/android/net/LinkPropertiesTest.java
@@ -338,14 +338,14 @@ public class LinkPropertiesTest extends TestCase {
assertFalse("newname".equals(link.getInterfaceName()));
}
- assertTrue(rmnet0.removeStackedLink(clat4));
+ assertTrue(rmnet0.removeStackedLink("clat4"));
assertEquals(0, rmnet0.getStackedLinks().size());
assertEquals(1, rmnet0.getAddresses().size());
assertEquals(1, rmnet0.getLinkAddresses().size());
assertEquals(1, rmnet0.getAllAddresses().size());
assertEquals(1, rmnet0.getAllLinkAddresses().size());
- assertFalse(rmnet0.removeStackedLink(clat4));
+ assertFalse(rmnet0.removeStackedLink("clat4"));
}
private LinkAddress getFirstLinkAddress(LinkProperties lp) {
@@ -370,7 +370,7 @@ public class LinkPropertiesTest extends TestCase {
assertTrue(stacked.hasGlobalIPv6Address());
assertFalse(lp.hasIPv4Address());
assertFalse(lp.hasGlobalIPv6Address());
- lp.removeStackedLink(stacked);
+ lp.removeStackedLink("stacked");
assertFalse(lp.hasIPv4Address());
assertFalse(lp.hasGlobalIPv6Address());
diff --git a/services/core/java/com/android/server/connectivity/Nat464Xlat.java b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
index c382be0..3b0d8c1 100644
--- a/services/core/java/com/android/server/connectivity/Nat464Xlat.java
+++ b/services/core/java/com/android/server/connectivity/Nat464Xlat.java
@@ -217,7 +217,7 @@ public class Nat464Xlat extends BaseNetworkObserver {
NetworkUtils.resetConnections(
CLAT_INTERFACE_NAME,
NetworkUtils.RESET_IPV4_ADDRESSES);
- mBaseLP.removeStackedLink(mLP);
+ mBaseLP.removeStackedLink(CLAT_INTERFACE_NAME);
updateConnectivityService();
}
Slog.i(TAG, "interface " + CLAT_INTERFACE_NAME +