diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java index 75646fdf90..bf411cccd5 100644 --- a/core/java/android/net/LinkProperties.java +++ b/core/java/android/net/LinkProperties.java @@ -112,6 +112,16 @@ public class LinkProperties implements Parcelable { return Collections.unmodifiableCollection(mLinkAddresses); } + /** + * Replaces the LinkAddresses on this link with the given collection of addresses + */ + public void setLinkAddresses(Collection addresses) { + mLinkAddresses.clear(); + for (LinkAddress address: addresses) { + addLinkAddress(address); + } + } + public void addDns(InetAddress dns) { if (dns != null) mDnses.add(dns); } @@ -127,6 +137,16 @@ public class LinkProperties implements Parcelable { return Collections.unmodifiableCollection(mRoutes); } + /** + * Replaces the RouteInfos on this link with the given collection of RouteInfos. + */ + public void setRoutes(Collection routes) { + mRoutes.clear(); + for (RouteInfo route : routes) { + addRoute(route); + } + } + public void setHttpProxy(ProxyProperties proxy) { mHttpProxy = proxy; }