summaryrefslogtreecommitdiff
path: root/core/java/android/net/LinkProperties.java
diff options
context:
space:
mode:
authorErik Kline <ek@google.com>2014-10-28 07:53:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-28 07:53:37 +0000
commitdd91fb44743f15ee308a4cfedeca6338b6912fdc (patch)
treeb0b467681601fc5c1bf9f59609d6e94819146cc3 /core/java/android/net/LinkProperties.java
parent111cc9f511dc65006fc2972c9ecbf295619e09b9 (diff)
parentd3b9fd33c69fa4fb844238c90b1fd343052946d9 (diff)
Merge "(re)define the definition of "provisioned"" into lmp-mr1-dev
Diffstat (limited to 'core/java/android/net/LinkProperties.java')
-rw-r--r--core/java/android/net/LinkProperties.java33
1 files changed, 27 insertions, 6 deletions
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index ef731b638e88..8b0dfc95fef0 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -675,17 +675,38 @@ public final class LinkProperties implements Parcelable {
}
/**
- * Returns true if this link is provisioned for global connectivity. For IPv6, this requires an
- * IP address, default route, and DNS server. For IPv4, this requires only an IPv4 address,
- * because WifiStateMachine accepts static configurations that only specify an address but not
- * DNS servers or a default route.
+ * Returns true if this link is provisioned for global IPv4 connectivity.
+ * This requires an IP address, default route, and DNS server.
+ *
+ * @return {@code true} if the link is provisioned, {@code false} otherwise.
+ */
+ private boolean hasIPv4() {
+ return (hasIPv4Address() &&
+ hasIPv4DefaultRoute() &&
+ hasIPv4DnsServer());
+ }
+
+ /**
+ * Returns true if this link is provisioned for global IPv6 connectivity.
+ * This requires an IP address, default route, and DNS server.
+ *
+ * @return {@code true} if the link is provisioned, {@code false} otherwise.
+ */
+ private boolean hasIPv6() {
+ return (hasGlobalIPv6Address() &&
+ hasIPv6DefaultRoute() &&
+ hasIPv6DnsServer());
+ }
+
+ /**
+ * Returns true if this link is provisioned for global connectivity,
+ * for at least one Internet Protocol family.
*
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
public boolean isProvisioned() {
- return (hasIPv4Address() ||
- (hasGlobalIPv6Address() && hasIPv6DefaultRoute() && hasIPv6DnsServer()));
+ return (hasIPv4() || hasIPv6());
}
/**