From 29666e46f409fe333787a40bad0e89d6d7d8964e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 4 Nov 2010 15:27:33 -0700 Subject: [PATCH] Remove NetworkUtils.isIpAddress. Bug: 3073384 Change-Id: I5bd46d1995186c2384c68d0afff3b869f46624c5 --- core/java/android/net/NetworkUtils.java | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/core/java/android/net/NetworkUtils.java b/core/java/android/net/NetworkUtils.java index 6b1fe99715..8a653ddd55 100644 --- a/core/java/android/net/NetworkUtils.java +++ b/core/java/android/net/NetworkUtils.java @@ -174,28 +174,6 @@ public class NetworkUtils { return Integer.reverseBytes(value); } - public static boolean isIpAddress(String address) { - //TODO: Add NetworkUtils support for IPv6 configuration and - //remove IPv4 validation and use a generic InetAddress validation - try { - String[] parts = address.split("\\."); - if (parts.length != 4) { - return false; - } - int a = Integer.parseInt(parts[0]); - if (a < 0 || a > 255) return false; - a = Integer.parseInt(parts[1]); - if (a < 0 || a > 255) return false; - a = Integer.parseInt(parts[2]); - if (a < 0 || a > 255) return false; - a = Integer.parseInt(parts[3]); - if (a < 0 || a > 255) return false; - } catch (NumberFormatException ex) { - return false; - } - return true; - } - /** * Add a default route through the specified gateway. * @param interfaceName interface on which the route should be added