diff --git a/api/system-current.txt b/api/system-current.txt index e2b6960f54212..a2f83fd7783ff 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3275,7 +3275,7 @@ package android.net { 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 getRoutes(String); + method @NonNull public java.util.List 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 @@ package android.net.metrics { } 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 43bbca30946d0..bb1a957da589d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -695,7 +695,7 @@ package android.net { 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 getRoutes(String); + method @NonNull public java.util.List 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 @@ package android.net.metrics { } 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 0728d83cbdb1e..14dbca0183f0a 100644 --- a/core/java/android/net/StaticIpConfiguration.java +++ b/core/java/android/net/StaticIpConfiguration.java @@ -134,7 +134,7 @@ public final class StaticIpConfiguration implements Parcelable { * 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 getRoutes(String iface) { + public @NonNull List getRoutes(@Nullable String iface) { List routes = new ArrayList(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 9eb87ef43cbb7..ebca7e6d56078 100644 --- a/core/java/android/net/metrics/ValidationProbeEvent.java +++ b/core/java/android/net/metrics/ValidationProbeEvent.java @@ -153,11 +153,14 @@ public final class ValidationProbeEvent implements IpConnectivityLog.Event { 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"); }