From 00a0fd650b7a31dffb88c229242bb04fa0b487a4 Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Mon, 9 Jun 2014 22:58:46 +0900 Subject: Minor changes to the LinkAddress API docs. 1. Rename getNetworkPrefixLength to getPrefixLength. Update all callers in frameworks/base and add a shim method and a TODO for the rest. 2. @hide isSameAddressAs. It doesn't add much, and it's just one-liner that callers can implement if they want. 3. Fix the alignment of the initial paragraph (). 4. Remove the documentation that talks about creating LinkAddresses, since there's no public API for creating them. With these changes I think LinkAddress is fine as a public API. Bug: 15142362 Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c (cherry picked from commit 9ab53650cfcd91a2a151b44b3fd1381841f76269) --- core/tests/coretests/src/android/net/LinkAddressTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/tests') diff --git a/core/tests/coretests/src/android/net/LinkAddressTest.java b/core/tests/coretests/src/android/net/LinkAddressTest.java index bccf556..814ecdd 100644 --- a/core/tests/coretests/src/android/net/LinkAddressTest.java +++ b/core/tests/coretests/src/android/net/LinkAddressTest.java @@ -56,26 +56,26 @@ public class LinkAddressTest extends AndroidTestCase { // Valid addresses work as expected. address = new LinkAddress(V4_ADDRESS, 25); assertEquals(V4_ADDRESS, address.getAddress()); - assertEquals(25, address.getNetworkPrefixLength()); + assertEquals(25, address.getPrefixLength()); assertEquals(0, address.getFlags()); assertEquals(RT_SCOPE_UNIVERSE, address.getScope()); address = new LinkAddress(V6_ADDRESS, 127); assertEquals(V6_ADDRESS, address.getAddress()); - assertEquals(127, address.getNetworkPrefixLength()); + assertEquals(127, address.getPrefixLength()); assertEquals(0, address.getFlags()); assertEquals(RT_SCOPE_UNIVERSE, address.getScope()); // Nonsensical flags/scopes or combinations thereof are acceptable. address = new LinkAddress(V6 + "/64", IFA_F_DEPRECATED | IFA_F_PERMANENT, RT_SCOPE_LINK); assertEquals(V6_ADDRESS, address.getAddress()); - assertEquals(64, address.getNetworkPrefixLength()); + assertEquals(64, address.getPrefixLength()); assertEquals(IFA_F_DEPRECATED | IFA_F_PERMANENT, address.getFlags()); assertEquals(RT_SCOPE_LINK, address.getScope()); address = new LinkAddress(V4 + "/23", 123, 456); assertEquals(V4_ADDRESS, address.getAddress()); - assertEquals(23, address.getNetworkPrefixLength()); + assertEquals(23, address.getPrefixLength()); assertEquals(123, address.getFlags()); assertEquals(456, address.getScope()); @@ -94,10 +94,10 @@ public class LinkAddressTest extends AndroidTestCase { } assertEquals(NetworkUtils.numericToInetAddress("127.0.0.1"), ipv4Loopback.getAddress()); - assertEquals(8, ipv4Loopback.getNetworkPrefixLength()); + assertEquals(8, ipv4Loopback.getPrefixLength()); assertEquals(NetworkUtils.numericToInetAddress("::1"), ipv6Loopback.getAddress()); - assertEquals(128, ipv6Loopback.getNetworkPrefixLength()); + assertEquals(128, ipv6Loopback.getPrefixLength()); // Null addresses are rejected. try { -- cgit v1.1