Merge "Add nullability annotations" am: a1ee1fc888
am: 3d48153a8f
Change-Id: Ic81850c2976e7412e85856c5d1336f30d0691125
diff --git a/api/system-current.txt b/api/system-current.txt
index cbc680e..3e80fe6 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -3275,7 +3275,7 @@
method @Nullable public String getDomains();
method @Nullable public java.net.InetAddress getGateway();
method @Nullable public android.net.LinkAddress getIpAddress();
- method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(String);
+ method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String);
method public void setDomains(@Nullable String);
method public void setGateway(@Nullable java.net.InetAddress);
method public void setIpAddress(@Nullable android.net.LinkAddress);
@@ -3495,7 +3495,7 @@
}
public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
- method public static String getProbeName(int);
+ method @NonNull public static String getProbeName(int);
field public static final int DNS_FAILURE = 0; // 0x0
field public static final int DNS_SUCCESS = 1; // 0x1
field public static final int PROBE_DNS = 0; // 0x0
diff --git a/api/test-current.txt b/api/test-current.txt
index 1a4abe6..49ac5a2 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -695,7 +695,7 @@
method @Nullable public String getDomains();
method @Nullable public java.net.InetAddress getGateway();
method @Nullable public android.net.LinkAddress getIpAddress();
- method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(String);
+ method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String);
method public void setDomains(@Nullable String);
method public void setGateway(@Nullable java.net.InetAddress);
method public void setIpAddress(@Nullable android.net.LinkAddress);
@@ -914,7 +914,7 @@
}
public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
- method public static String getProbeName(int);
+ method @NonNull public static String getProbeName(int);
field public static final int DNS_FAILURE = 0; // 0x0
field public static final int DNS_SUCCESS = 1; // 0x1
field public static final int PROBE_DNS = 0; // 0x0
diff --git a/core/java/android/net/StaticIpConfiguration.java b/core/java/android/net/StaticIpConfiguration.java
index 0728d83..14dbca0 100644
--- a/core/java/android/net/StaticIpConfiguration.java
+++ b/core/java/android/net/StaticIpConfiguration.java
@@ -134,7 +134,7 @@
* route to the gateway as well. This configuration is arguably invalid, but it used to work
* in K and earlier, and other OSes appear to accept it.
*/
- public @NonNull List<RouteInfo> getRoutes(String iface) {
+ public @NonNull List<RouteInfo> getRoutes(@Nullable String iface) {
List<RouteInfo> routes = new ArrayList<RouteInfo>(3);
if (ipAddress != null) {
RouteInfo connectedRoute = new RouteInfo(ipAddress, null, iface);
diff --git a/core/java/android/net/metrics/ValidationProbeEvent.java b/core/java/android/net/metrics/ValidationProbeEvent.java
index 9eb87ef..ebca7e6 100644
--- a/core/java/android/net/metrics/ValidationProbeEvent.java
+++ b/core/java/android/net/metrics/ValidationProbeEvent.java
@@ -153,11 +153,14 @@
return (probeType & 0xff) | (firstValidation ? FIRST_VALIDATION : REVALIDATION);
}
- public static String getProbeName(int probeType) {
+ /**
+ * Get the name of a probe specified by its probe type.
+ */
+ public static @NonNull String getProbeName(int probeType) {
return Decoder.constants.get(probeType & 0xff, "PROBE_???");
}
- private static String getValidationStage(int probeType) {
+ private static @NonNull String getValidationStage(int probeType) {
return Decoder.constants.get(probeType & 0xff00, "UNKNOWN");
}