summaryrefslogtreecommitdiffstats
path: root/core/tests/coretests
diff options
context:
space:
mode:
authorSreeram Ramachandran <sreeram@google.com>2014-06-03 18:41:43 -0700
committerRobert Greenwalt <rgreenwalt@google.com>2014-06-11 16:32:21 -0700
commit6307b35e1d3a8d577877be0b4c9cea1a909b6329 (patch)
tree9c074f682304e2096a920fa640f709861684626b /core/tests/coretests
parent52769be3ea1fd005ea66b7b08888b3009ac0dadf (diff)
downloadframeworks_base-6307b35e1d3a8d577877be0b4c9cea1a909b6329.zip
frameworks_base-6307b35e1d3a8d577877be0b4c9cea1a909b6329.tar.gz
frameworks_base-6307b35e1d3a8d577877be0b4c9cea1a909b6329.tar.bz2
Add a new IpPrefix class and use it in RouteInfo.
This change uses IpPrefix only in the public API and continues to use LinkAddress for everything else. It does not change the callers to use the new APIs, with the exception of changing all current uses of getDestination to getDestinationLinkAddress to make room for the new getDestination method that returns an IpPrefix. Based on Sreeram's earlier change: https://googleplex-android-review.git.corp.google.com/#/c/477874/ but a bit simplified and with a bit more documentation. Bug: 15142362 Bug: 13885501 Change-Id: Ib4cd96b22cbff4ea31bb26a7853989f50da8de4e (cherry picked from commit 7d3b4b9a3d4de9673119632da0ebd583e50126f7)
Diffstat (limited to 'core/tests/coretests')
-rw-r--r--core/tests/coretests/src/android/net/RouteInfoTest.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/tests/coretests/src/android/net/RouteInfoTest.java b/core/tests/coretests/src/android/net/RouteInfoTest.java
index 55d6592..01283a6 100644
--- a/core/tests/coretests/src/android/net/RouteInfoTest.java
+++ b/core/tests/coretests/src/android/net/RouteInfoTest.java
@@ -43,17 +43,17 @@ public class RouteInfoTest extends TestCase {
// Invalid input.
try {
- r = new RouteInfo(null, null, "rmnet0");
+ r = new RouteInfo((LinkAddress) null, null, "rmnet0");
fail("Expected RuntimeException: destination and gateway null");
} catch(RuntimeException e) {}
// Null destination is default route.
- r = new RouteInfo(null, Address("2001:db8::1"), null);
+ r = new RouteInfo((LinkAddress) null, Address("2001:db8::1"), null);
assertEquals(Prefix("::/0"), r.getDestination());
assertEquals(Address("2001:db8::1"), r.getGateway());
assertNull(r.getInterface());
- r = new RouteInfo(null, Address("192.0.2.1"), "wlan0");
+ r = new RouteInfo((LinkAddress) null, Address("192.0.2.1"), "wlan0");
assertEquals(Prefix("0.0.0.0/0"), r.getDestination());
assertEquals(Address("192.0.2.1"), r.getGateway());
assertEquals("wlan0", r.getInterface());