1// Signature format: 2.0 2package android.net { 3 4 public class CaptivePortal implements android.os.Parcelable { 5 method @Deprecated public void logEvent(int, @NonNull String); 6 method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void reevaluateNetwork(); 7 method public void useNetwork(); 8 field public static final int APP_REQUEST_REEVALUATION_REQUIRED = 100; // 0x64 9 field public static final int APP_RETURN_DISMISSED = 0; // 0x0 10 field public static final int APP_RETURN_UNWANTED = 1; // 0x1 11 field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2 12 } 13 14 public final class CaptivePortalData implements android.os.Parcelable { 15 method public int describeContents(); 16 method public long getByteLimit(); 17 method public long getExpiryTimeMillis(); 18 method public long getRefreshTimeMillis(); 19 method @Nullable public android.net.Uri getUserPortalUrl(); 20 method public int getUserPortalUrlSource(); 21 method @Nullable public CharSequence getVenueFriendlyName(); 22 method @Nullable public android.net.Uri getVenueInfoUrl(); 23 method public int getVenueInfoUrlSource(); 24 method public boolean isCaptive(); 25 method public boolean isSessionExtendable(); 26 method public void writeToParcel(@NonNull android.os.Parcel, int); 27 field public static final int CAPTIVE_PORTAL_DATA_SOURCE_OTHER = 0; // 0x0 28 field public static final int CAPTIVE_PORTAL_DATA_SOURCE_PASSPOINT = 1; // 0x1 29 field @NonNull public static final android.os.Parcelable.Creator<android.net.CaptivePortalData> CREATOR; 30 } 31 32 public static class CaptivePortalData.Builder { 33 ctor public CaptivePortalData.Builder(); 34 ctor public CaptivePortalData.Builder(@Nullable android.net.CaptivePortalData); 35 method @NonNull public android.net.CaptivePortalData build(); 36 method @NonNull public android.net.CaptivePortalData.Builder setBytesRemaining(long); 37 method @NonNull public android.net.CaptivePortalData.Builder setCaptive(boolean); 38 method @NonNull public android.net.CaptivePortalData.Builder setExpiryTime(long); 39 method @NonNull public android.net.CaptivePortalData.Builder setRefreshTime(long); 40 method @NonNull public android.net.CaptivePortalData.Builder setSessionExtendable(boolean); 41 method @NonNull public android.net.CaptivePortalData.Builder setUserPortalUrl(@Nullable android.net.Uri); 42 method @NonNull public android.net.CaptivePortalData.Builder setUserPortalUrl(@Nullable android.net.Uri, int); 43 method @NonNull public android.net.CaptivePortalData.Builder setVenueFriendlyName(@Nullable CharSequence); 44 method @NonNull public android.net.CaptivePortalData.Builder setVenueInfoUrl(@Nullable android.net.Uri); 45 method @NonNull public android.net.CaptivePortalData.Builder setVenueInfoUrl(@Nullable android.net.Uri, int); 46 } 47 48 public class ConnectivityManager { 49 method @NonNull @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createNattKeepalive(@NonNull android.net.Network, @NonNull android.os.ParcelFileDescriptor, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback); 50 method @NonNull @RequiresPermission(android.Manifest.permission.PACKET_KEEPALIVE_OFFLOAD) public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull java.net.Socket, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback); 51 method @Deprecated @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public String getCaptivePortalServerUrl(); 52 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void getLatestTetheringEntitlementResult(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEntitlementResultListener); 53 method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.TETHER_PRIVILEGED, android.Manifest.permission.WRITE_SETTINGS}) public boolean isTetheringSupported(); 54 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_FACTORY}) public int registerNetworkProvider(@NonNull android.net.NetworkProvider); 55 method public void registerQosCallback(@NonNull android.net.QosSocketInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.QosCallback); 56 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void registerTetheringEventCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityManager.OnTetheringEventCallback); 57 method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void requestNetwork(@NonNull android.net.NetworkRequest, int, int, @NonNull android.os.Handler, @NonNull android.net.ConnectivityManager.NetworkCallback); 58 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_AIRPLANE_MODE, android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK}) public void setAirplaneMode(boolean); 59 method @RequiresPermission(android.Manifest.permission.CONTROL_OEM_PAID_NETWORK_PREFERENCE) public void setOemNetworkPreference(@NonNull android.net.OemNetworkPreferences, @Nullable java.util.concurrent.Executor, @Nullable Runnable); 60 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public boolean shouldAvoidBadWifi(); 61 method @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public void startCaptivePortalApp(@NonNull android.net.Network, @NonNull android.os.Bundle); 62 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback); 63 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int, boolean, android.net.ConnectivityManager.OnStartTetheringCallback, android.os.Handler); 64 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void stopTethering(int); 65 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_FACTORY}) public void unregisterNetworkProvider(@NonNull android.net.NetworkProvider); 66 method public void unregisterQosCallback(@NonNull android.net.QosCallback); 67 method @Deprecated @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void unregisterTetheringEventCallback(@NonNull android.net.ConnectivityManager.OnTetheringEventCallback); 68 field public static final String EXTRA_CAPTIVE_PORTAL_PROBE_SPEC = "android.net.extra.CAPTIVE_PORTAL_PROBE_SPEC"; 69 field public static final String EXTRA_CAPTIVE_PORTAL_USER_AGENT = "android.net.extra.CAPTIVE_PORTAL_USER_AGENT"; 70 field public static final int TETHERING_BLUETOOTH = 2; // 0x2 71 field public static final int TETHERING_USB = 1; // 0x1 72 field public static final int TETHERING_WIFI = 0; // 0x0 73 field @Deprecated public static final int TETHER_ERROR_ENTITLEMENT_UNKONWN = 13; // 0xd 74 field @Deprecated public static final int TETHER_ERROR_NO_ERROR = 0; // 0x0 75 field @Deprecated public static final int TETHER_ERROR_PROVISION_FAILED = 11; // 0xb 76 field public static final int TYPE_NONE = -1; // 0xffffffff 77 field @Deprecated public static final int TYPE_PROXY = 16; // 0x10 78 field @Deprecated public static final int TYPE_WIFI_P2P = 13; // 0xd 79 } 80 81 @Deprecated public abstract static class ConnectivityManager.OnStartTetheringCallback { 82 ctor @Deprecated public ConnectivityManager.OnStartTetheringCallback(); 83 method @Deprecated public void onTetheringFailed(); 84 method @Deprecated public void onTetheringStarted(); 85 } 86 87 @Deprecated public static interface ConnectivityManager.OnTetheringEntitlementResultListener { 88 method @Deprecated public void onTetheringEntitlementResult(int); 89 } 90 91 @Deprecated public abstract static class ConnectivityManager.OnTetheringEventCallback { 92 ctor @Deprecated public ConnectivityManager.OnTetheringEventCallback(); 93 method @Deprecated public void onUpstreamChanged(@Nullable android.net.Network); 94 } 95 96 public final class DscpPolicy implements android.os.Parcelable { 97 method public int describeContents(); 98 method @Nullable public java.net.InetAddress getDestinationAddress(); 99 method @Nullable public android.util.Range<java.lang.Integer> getDestinationPortRange(); 100 method public int getDscpValue(); 101 method public int getPolicyId(); 102 method public int getProtocol(); 103 method @Nullable public java.net.InetAddress getSourceAddress(); 104 method public int getSourcePort(); 105 method public void writeToParcel(@NonNull android.os.Parcel, int); 106 field @NonNull public static final android.os.Parcelable.Creator<android.net.DscpPolicy> CREATOR; 107 field public static final int PROTOCOL_ANY = -1; // 0xffffffff 108 field public static final int SOURCE_PORT_ANY = -1; // 0xffffffff 109 } 110 111 public static final class DscpPolicy.Builder { 112 ctor public DscpPolicy.Builder(int, int); 113 method @NonNull public android.net.DscpPolicy build(); 114 method @NonNull public android.net.DscpPolicy.Builder setDestinationAddress(@NonNull java.net.InetAddress); 115 method @NonNull public android.net.DscpPolicy.Builder setDestinationPortRange(@NonNull android.util.Range<java.lang.Integer>); 116 method @NonNull public android.net.DscpPolicy.Builder setProtocol(int); 117 method @NonNull public android.net.DscpPolicy.Builder setSourceAddress(@NonNull java.net.InetAddress); 118 method @NonNull public android.net.DscpPolicy.Builder setSourcePort(int); 119 } 120 121 public final class InvalidPacketException extends java.lang.Exception { 122 ctor public InvalidPacketException(int); 123 method public int getError(); 124 field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb 125 field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9 126 field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea 127 } 128 129 public final class IpConfiguration implements android.os.Parcelable { 130 ctor public IpConfiguration(); 131 ctor public IpConfiguration(@NonNull android.net.IpConfiguration); 132 method @NonNull public android.net.IpConfiguration.IpAssignment getIpAssignment(); 133 method @NonNull public android.net.IpConfiguration.ProxySettings getProxySettings(); 134 method public void setHttpProxy(@Nullable android.net.ProxyInfo); 135 method public void setIpAssignment(@NonNull android.net.IpConfiguration.IpAssignment); 136 method public void setProxySettings(@NonNull android.net.IpConfiguration.ProxySettings); 137 method public void setStaticIpConfiguration(@Nullable android.net.StaticIpConfiguration); 138 } 139 140 public enum IpConfiguration.IpAssignment { 141 enum_constant public static final android.net.IpConfiguration.IpAssignment DHCP; 142 enum_constant public static final android.net.IpConfiguration.IpAssignment STATIC; 143 enum_constant public static final android.net.IpConfiguration.IpAssignment UNASSIGNED; 144 } 145 146 public enum IpConfiguration.ProxySettings { 147 enum_constant public static final android.net.IpConfiguration.ProxySettings NONE; 148 enum_constant public static final android.net.IpConfiguration.ProxySettings PAC; 149 enum_constant public static final android.net.IpConfiguration.ProxySettings STATIC; 150 enum_constant public static final android.net.IpConfiguration.ProxySettings UNASSIGNED; 151 } 152 153 public final class IpPrefix implements android.os.Parcelable { 154 ctor public IpPrefix(@NonNull String); 155 } 156 157 public class KeepalivePacketData { 158 ctor protected KeepalivePacketData(@NonNull java.net.InetAddress, @IntRange(from=0, to=65535) int, @NonNull java.net.InetAddress, @IntRange(from=0, to=65535) int, @NonNull byte[]) throws android.net.InvalidPacketException; 159 method @NonNull public java.net.InetAddress getDstAddress(); 160 method public int getDstPort(); 161 method @NonNull public byte[] getPacket(); 162 method @NonNull public java.net.InetAddress getSrcAddress(); 163 method public int getSrcPort(); 164 } 165 166 public class LinkAddress implements android.os.Parcelable { 167 ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int); 168 ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int, int, int, long, long); 169 ctor public LinkAddress(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int); 170 ctor public LinkAddress(@NonNull String); 171 ctor public LinkAddress(@NonNull String, int, int); 172 method public long getDeprecationTime(); 173 method public long getExpirationTime(); 174 method public boolean isGlobalPreferred(); 175 method public boolean isIpv4(); 176 method public boolean isIpv6(); 177 method public boolean isSameAddressAs(@Nullable android.net.LinkAddress); 178 field public static final long LIFETIME_PERMANENT = 9223372036854775807L; // 0x7fffffffffffffffL 179 field public static final long LIFETIME_UNKNOWN = -1L; // 0xffffffffffffffffL 180 } 181 182 public final class LinkProperties implements android.os.Parcelable { 183 ctor public LinkProperties(@Nullable android.net.LinkProperties); 184 ctor public LinkProperties(@Nullable android.net.LinkProperties, boolean); 185 method public boolean addDnsServer(@NonNull java.net.InetAddress); 186 method public boolean addLinkAddress(@NonNull android.net.LinkAddress); 187 method public boolean addPcscfServer(@NonNull java.net.InetAddress); 188 method @NonNull public java.util.List<java.net.InetAddress> getAddresses(); 189 method @NonNull public java.util.List<java.lang.String> getAllInterfaceNames(); 190 method @NonNull public java.util.List<android.net.LinkAddress> getAllLinkAddresses(); 191 method @NonNull public java.util.List<android.net.RouteInfo> getAllRoutes(); 192 method @Nullable public android.net.Uri getCaptivePortalApiUrl(); 193 method @Nullable public android.net.CaptivePortalData getCaptivePortalData(); 194 method @NonNull public java.util.List<java.net.InetAddress> getPcscfServers(); 195 method @Nullable public String getTcpBufferSizes(); 196 method @NonNull public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers(); 197 method public boolean hasGlobalIpv6Address(); 198 method public boolean hasIpv4Address(); 199 method public boolean hasIpv4DefaultRoute(); 200 method public boolean hasIpv4DnsServer(); 201 method public boolean hasIpv6DefaultRoute(); 202 method public boolean hasIpv6DnsServer(); 203 method public boolean isIpv4Provisioned(); 204 method public boolean isIpv6Provisioned(); 205 method public boolean isProvisioned(); 206 method public boolean isReachable(@NonNull java.net.InetAddress); 207 method public boolean removeDnsServer(@NonNull java.net.InetAddress); 208 method public boolean removeLinkAddress(@NonNull android.net.LinkAddress); 209 method public boolean removeRoute(@NonNull android.net.RouteInfo); 210 method public void setCaptivePortalApiUrl(@Nullable android.net.Uri); 211 method public void setCaptivePortalData(@Nullable android.net.CaptivePortalData); 212 method public void setPcscfServers(@NonNull java.util.Collection<java.net.InetAddress>); 213 method public void setPrivateDnsServerName(@Nullable String); 214 method public void setTcpBufferSizes(@Nullable String); 215 method public void setUsePrivateDns(boolean); 216 method public void setValidatedPrivateDnsServers(@NonNull java.util.Collection<java.net.InetAddress>); 217 } 218 219 public final class NattKeepalivePacketData extends android.net.KeepalivePacketData implements android.os.Parcelable { 220 ctor public NattKeepalivePacketData(@NonNull java.net.InetAddress, int, @NonNull java.net.InetAddress, int, @NonNull byte[]) throws android.net.InvalidPacketException; 221 method public int describeContents(); 222 method public void writeToParcel(@NonNull android.os.Parcel, int); 223 field @NonNull public static final android.os.Parcelable.Creator<android.net.NattKeepalivePacketData> CREATOR; 224 } 225 226 public class Network implements android.os.Parcelable { 227 ctor public Network(@NonNull android.net.Network); 228 method public int getNetId(); 229 method @NonNull public android.net.Network getPrivateDnsBypassingCopy(); 230 } 231 232 public abstract class NetworkAgent { 233 ctor public NetworkAgent(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String, @NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties, int, @NonNull android.net.NetworkAgentConfig, @Nullable android.net.NetworkProvider); 234 ctor public NetworkAgent(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String, @NonNull android.net.NetworkCapabilities, @NonNull android.net.LinkProperties, @NonNull android.net.NetworkScore, @NonNull android.net.NetworkAgentConfig, @Nullable android.net.NetworkProvider); 235 method @Nullable public android.net.Network getNetwork(); 236 method public void markConnected(); 237 method public void onAddKeepalivePacketFilter(int, @NonNull android.net.KeepalivePacketData); 238 method public void onAutomaticReconnectDisabled(); 239 method public void onBandwidthUpdateRequested(); 240 method public void onDscpPolicyStatusUpdated(int, int); 241 method public void onNetworkCreated(); 242 method public void onNetworkDestroyed(); 243 method public void onNetworkUnwanted(); 244 method public void onQosCallbackRegistered(int, @NonNull android.net.QosFilter); 245 method public void onQosCallbackUnregistered(int); 246 method public void onRemoveKeepalivePacketFilter(int); 247 method public void onSaveAcceptUnvalidated(boolean); 248 method public void onSignalStrengthThresholdsUpdated(@NonNull int[]); 249 method public void onStartSocketKeepalive(int, @NonNull java.time.Duration, @NonNull android.net.KeepalivePacketData); 250 method public void onStopSocketKeepalive(int); 251 method public void onValidationStatus(int, @Nullable android.net.Uri); 252 method @NonNull public android.net.Network register(); 253 method public void sendAddDscpPolicy(@NonNull android.net.DscpPolicy); 254 method public void sendLinkProperties(@NonNull android.net.LinkProperties); 255 method public void sendNetworkCapabilities(@NonNull android.net.NetworkCapabilities); 256 method public void sendNetworkScore(@NonNull android.net.NetworkScore); 257 method public void sendNetworkScore(@IntRange(from=0, to=99) int); 258 method public final void sendQosCallbackError(int, int); 259 method public final void sendQosSessionAvailable(int, int, @NonNull android.net.QosSessionAttributes); 260 method public final void sendQosSessionLost(int, int, int); 261 method public void sendRemoveAllDscpPolicies(); 262 method public void sendRemoveDscpPolicy(int); 263 method public final void sendSocketKeepaliveEvent(int, int); 264 method @Deprecated public void setLegacySubtype(int, @NonNull String); 265 method public void setLingerDuration(@NonNull java.time.Duration); 266 method public void setTeardownDelayMillis(@IntRange(from=0, to=0x1388) int); 267 method public void setUnderlyingNetworks(@Nullable java.util.List<android.net.Network>); 268 method public void unregister(); 269 method public void unregisterAfterReplacement(@IntRange(from=0, to=0x1388) int); 270 field public static final int DSCP_POLICY_STATUS_DELETED = 4; // 0x4 271 field public static final int DSCP_POLICY_STATUS_INSUFFICIENT_PROCESSING_RESOURCES = 3; // 0x3 272 field public static final int DSCP_POLICY_STATUS_POLICY_NOT_FOUND = 5; // 0x5 273 field public static final int DSCP_POLICY_STATUS_REQUESTED_CLASSIFIER_NOT_SUPPORTED = 2; // 0x2 274 field public static final int DSCP_POLICY_STATUS_REQUEST_DECLINED = 1; // 0x1 275 field public static final int DSCP_POLICY_STATUS_SUCCESS = 0; // 0x0 276 field public static final int VALIDATION_STATUS_NOT_VALID = 2; // 0x2 277 field public static final int VALIDATION_STATUS_VALID = 1; // 0x1 278 } 279 280 public final class NetworkAgentConfig implements android.os.Parcelable { 281 method public int describeContents(); 282 method public int getLegacyType(); 283 method @NonNull public String getLegacyTypeName(); 284 method public boolean isExplicitlySelected(); 285 method public boolean isPartialConnectivityAcceptable(); 286 method public boolean isUnvalidatedConnectivityAcceptable(); 287 method public void writeToParcel(@NonNull android.os.Parcel, int); 288 field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkAgentConfig> CREATOR; 289 } 290 291 public static final class NetworkAgentConfig.Builder { 292 ctor public NetworkAgentConfig.Builder(); 293 method @NonNull public android.net.NetworkAgentConfig build(); 294 method @NonNull public android.net.NetworkAgentConfig.Builder setExplicitlySelected(boolean); 295 method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyExtraInfo(@NonNull String); 296 method @NonNull public android.net.NetworkAgentConfig.Builder setLegacySubType(int); 297 method @NonNull public android.net.NetworkAgentConfig.Builder setLegacySubTypeName(@NonNull String); 298 method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyType(int); 299 method @NonNull public android.net.NetworkAgentConfig.Builder setLegacyTypeName(@NonNull String); 300 method @NonNull public android.net.NetworkAgentConfig.Builder setNat64DetectionEnabled(boolean); 301 method @NonNull public android.net.NetworkAgentConfig.Builder setPartialConnectivityAcceptable(boolean); 302 method @NonNull public android.net.NetworkAgentConfig.Builder setProvisioningNotificationEnabled(boolean); 303 method @NonNull public android.net.NetworkAgentConfig.Builder setUnvalidatedConnectivityAcceptable(boolean); 304 } 305 306 public final class NetworkCapabilities implements android.os.Parcelable { 307 method @NonNull public int[] getAdministratorUids(); 308 method @Nullable public static String getCapabilityCarrierName(int); 309 method @Nullable public String getSsid(); 310 method @NonNull public int[] getTransportTypes(); 311 method @Nullable public java.util.List<android.net.Network> getUnderlyingNetworks(); 312 method public boolean isPrivateDnsBroken(); 313 method public boolean satisfiedByNetworkCapabilities(@Nullable android.net.NetworkCapabilities); 314 field public static final int NET_CAPABILITY_BIP = 31; // 0x1f 315 field public static final int NET_CAPABILITY_NOT_VCN_MANAGED = 28; // 0x1c 316 field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16 317 field public static final int NET_CAPABILITY_OEM_PRIVATE = 26; // 0x1a 318 field public static final int NET_CAPABILITY_PARTIAL_CONNECTIVITY = 24; // 0x18 319 field public static final int NET_CAPABILITY_VEHICLE_INTERNAL = 27; // 0x1b 320 field public static final int NET_CAPABILITY_VSIM = 30; // 0x1e 321 } 322 323 public static final class NetworkCapabilities.Builder { 324 ctor public NetworkCapabilities.Builder(); 325 ctor public NetworkCapabilities.Builder(@NonNull android.net.NetworkCapabilities); 326 method @NonNull public android.net.NetworkCapabilities.Builder addCapability(int); 327 method @NonNull public android.net.NetworkCapabilities.Builder addEnterpriseId(int); 328 method @NonNull public android.net.NetworkCapabilities.Builder addTransportType(int); 329 method @NonNull public android.net.NetworkCapabilities build(); 330 method @NonNull public android.net.NetworkCapabilities.Builder removeCapability(int); 331 method @NonNull public android.net.NetworkCapabilities.Builder removeEnterpriseId(int); 332 method @NonNull public android.net.NetworkCapabilities.Builder removeTransportType(int); 333 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setAdministratorUids(@NonNull int[]); 334 method @NonNull public android.net.NetworkCapabilities.Builder setLinkDownstreamBandwidthKbps(int); 335 method @NonNull public android.net.NetworkCapabilities.Builder setLinkUpstreamBandwidthKbps(int); 336 method @NonNull public android.net.NetworkCapabilities.Builder setNetworkSpecifier(@Nullable android.net.NetworkSpecifier); 337 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setOwnerUid(int); 338 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setRequestorPackageName(@Nullable String); 339 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setRequestorUid(int); 340 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkCapabilities.Builder setSignalStrength(int); 341 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setSsid(@Nullable String); 342 method @NonNull public android.net.NetworkCapabilities.Builder setSubscriptionIds(@NonNull java.util.Set<java.lang.Integer>); 343 method @NonNull public android.net.NetworkCapabilities.Builder setTransportInfo(@Nullable android.net.TransportInfo); 344 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setUnderlyingNetworks(@Nullable java.util.List<android.net.Network>); 345 method @NonNull public static android.net.NetworkCapabilities.Builder withoutDefaultCapabilities(); 346 } 347 348 public class NetworkProvider { 349 ctor public NetworkProvider(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String); 350 method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void declareNetworkRequestUnfulfillable(@NonNull android.net.NetworkRequest); 351 method public int getProviderId(); 352 method public void onNetworkRequestWithdrawn(@NonNull android.net.NetworkRequest); 353 method public void onNetworkRequested(@NonNull android.net.NetworkRequest, @IntRange(from=0, to=99) int, int); 354 method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void registerNetworkOffer(@NonNull android.net.NetworkScore, @NonNull android.net.NetworkCapabilities, @NonNull java.util.concurrent.Executor, @NonNull android.net.NetworkProvider.NetworkOfferCallback); 355 method @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public void unregisterNetworkOffer(@NonNull android.net.NetworkProvider.NetworkOfferCallback); 356 field public static final int ID_NONE = -1; // 0xffffffff 357 } 358 359 public static interface NetworkProvider.NetworkOfferCallback { 360 method public void onNetworkNeeded(@NonNull android.net.NetworkRequest); 361 method public void onNetworkUnneeded(@NonNull android.net.NetworkRequest); 362 } 363 364 public class NetworkReleasedException extends java.lang.Exception { 365 ctor public NetworkReleasedException(); 366 } 367 368 public class NetworkRequest implements android.os.Parcelable { 369 method @Nullable public String getRequestorPackageName(); 370 method public int getRequestorUid(); 371 } 372 373 public static class NetworkRequest.Builder { 374 method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_SIGNAL_STRENGTH_WAKEUP) public android.net.NetworkRequest.Builder setSignalStrength(int); 375 } 376 377 public final class NetworkScore implements android.os.Parcelable { 378 method public int describeContents(); 379 method public int getKeepConnectedReason(); 380 method public int getLegacyInt(); 381 method public boolean isExiting(); 382 method public boolean isTransportPrimary(); 383 method public void writeToParcel(@NonNull android.os.Parcel, int); 384 field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkScore> CREATOR; 385 field public static final int KEEP_CONNECTED_FOR_HANDOVER = 1; // 0x1 386 field public static final int KEEP_CONNECTED_NONE = 0; // 0x0 387 } 388 389 public static final class NetworkScore.Builder { 390 ctor public NetworkScore.Builder(); 391 method @NonNull public android.net.NetworkScore build(); 392 method @NonNull public android.net.NetworkScore.Builder setExiting(boolean); 393 method @NonNull public android.net.NetworkScore.Builder setKeepConnectedReason(int); 394 method @NonNull public android.net.NetworkScore.Builder setLegacyInt(int); 395 method @NonNull public android.net.NetworkScore.Builder setTransportPrimary(boolean); 396 } 397 398 public final class OemNetworkPreferences implements android.os.Parcelable { 399 method public int describeContents(); 400 method @NonNull public java.util.Map<java.lang.String,java.lang.Integer> getNetworkPreferences(); 401 method public void writeToParcel(@NonNull android.os.Parcel, int); 402 field @NonNull public static final android.os.Parcelable.Creator<android.net.OemNetworkPreferences> CREATOR; 403 field public static final int OEM_NETWORK_PREFERENCE_OEM_PAID = 1; // 0x1 404 field public static final int OEM_NETWORK_PREFERENCE_OEM_PAID_NO_FALLBACK = 2; // 0x2 405 field public static final int OEM_NETWORK_PREFERENCE_OEM_PAID_ONLY = 3; // 0x3 406 field public static final int OEM_NETWORK_PREFERENCE_OEM_PRIVATE_ONLY = 4; // 0x4 407 field public static final int OEM_NETWORK_PREFERENCE_UNINITIALIZED = 0; // 0x0 408 } 409 410 public static final class OemNetworkPreferences.Builder { 411 ctor public OemNetworkPreferences.Builder(); 412 ctor public OemNetworkPreferences.Builder(@NonNull android.net.OemNetworkPreferences); 413 method @NonNull public android.net.OemNetworkPreferences.Builder addNetworkPreference(@NonNull String, int); 414 method @NonNull public android.net.OemNetworkPreferences build(); 415 method @NonNull public android.net.OemNetworkPreferences.Builder clearNetworkPreference(@NonNull String); 416 } 417 418 public abstract class QosCallback { 419 ctor public QosCallback(); 420 method public void onError(@NonNull android.net.QosCallbackException); 421 method public void onQosSessionAvailable(@NonNull android.net.QosSession, @NonNull android.net.QosSessionAttributes); 422 method public void onQosSessionLost(@NonNull android.net.QosSession); 423 } 424 425 public static class QosCallback.QosCallbackRegistrationException extends java.lang.RuntimeException { 426 } 427 428 public final class QosCallbackException extends java.lang.Exception { 429 ctor public QosCallbackException(@NonNull String); 430 ctor public QosCallbackException(@NonNull Throwable); 431 } 432 433 public abstract class QosFilter { 434 method @NonNull public abstract android.net.Network getNetwork(); 435 method public abstract boolean matchesLocalAddress(@NonNull java.net.InetAddress, int, int); 436 method public boolean matchesProtocol(int); 437 method public abstract boolean matchesRemoteAddress(@NonNull java.net.InetAddress, int, int); 438 } 439 440 public final class QosSession implements android.os.Parcelable { 441 ctor public QosSession(int, int); 442 method public int describeContents(); 443 method public int getSessionId(); 444 method public int getSessionType(); 445 method public long getUniqueId(); 446 method public void writeToParcel(@NonNull android.os.Parcel, int); 447 field @NonNull public static final android.os.Parcelable.Creator<android.net.QosSession> CREATOR; 448 field public static final int TYPE_EPS_BEARER = 1; // 0x1 449 field public static final int TYPE_NR_BEARER = 2; // 0x2 450 } 451 452 public interface QosSessionAttributes { 453 } 454 455 public final class QosSocketInfo implements android.os.Parcelable { 456 ctor public QosSocketInfo(@NonNull android.net.Network, @NonNull java.net.Socket) throws java.io.IOException; 457 ctor public QosSocketInfo(@NonNull android.net.Network, @NonNull java.net.DatagramSocket) throws java.io.IOException; 458 method public int describeContents(); 459 method @NonNull public java.net.InetSocketAddress getLocalSocketAddress(); 460 method @NonNull public android.net.Network getNetwork(); 461 method @Nullable public java.net.InetSocketAddress getRemoteSocketAddress(); 462 method public void writeToParcel(@NonNull android.os.Parcel, int); 463 field @NonNull public static final android.os.Parcelable.Creator<android.net.QosSocketInfo> CREATOR; 464 } 465 466 public final class RouteInfo implements android.os.Parcelable { 467 ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int); 468 ctor public RouteInfo(@Nullable android.net.IpPrefix, @Nullable java.net.InetAddress, @Nullable String, int, int); 469 method public int getMtu(); 470 } 471 472 public abstract class SocketKeepalive implements java.lang.AutoCloseable { 473 method public final void start(@IntRange(from=0xa, to=0xe10) int, int, @Nullable android.net.Network); 474 field public static final int ERROR_NO_SUCH_SLOT = -33; // 0xffffffdf 475 field public static final int FLAG_AUTOMATIC_ON_OFF = 1; // 0x1 476 field public static final int SUCCESS = 0; // 0x0 477 } 478 479 public class SocketLocalAddressChangedException extends java.lang.Exception { 480 ctor public SocketLocalAddressChangedException(); 481 } 482 483 public class SocketNotBoundException extends java.lang.Exception { 484 ctor public SocketNotBoundException(); 485 } 486 487 public class SocketNotConnectedException extends java.lang.Exception { 488 ctor public SocketNotConnectedException(); 489 } 490 491 public class SocketRemoteAddressChangedException extends java.lang.Exception { 492 ctor public SocketRemoteAddressChangedException(); 493 } 494 495 public final class StaticIpConfiguration implements android.os.Parcelable { 496 ctor public StaticIpConfiguration(); 497 ctor public StaticIpConfiguration(@Nullable android.net.StaticIpConfiguration); 498 method public void addDnsServer(@NonNull java.net.InetAddress); 499 method public void clear(); 500 method @NonNull public java.util.List<android.net.RouteInfo> getRoutes(@Nullable String); 501 } 502 503 public final class TcpKeepalivePacketData extends android.net.KeepalivePacketData implements android.os.Parcelable { 504 ctor public TcpKeepalivePacketData(@NonNull java.net.InetAddress, int, @NonNull java.net.InetAddress, int, @NonNull byte[], int, int, int, int, int, int) throws android.net.InvalidPacketException; 505 method public int describeContents(); 506 method public int getIpTos(); 507 method public int getIpTtl(); 508 method public int getTcpAck(); 509 method public int getTcpSeq(); 510 method public int getTcpWindow(); 511 method public int getTcpWindowScale(); 512 method public void writeToParcel(@NonNull android.os.Parcel, int); 513 field @NonNull public static final android.os.Parcelable.Creator<android.net.TcpKeepalivePacketData> CREATOR; 514 } 515 516 public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo { 517 ctor public VpnTransportInfo(int, @Nullable String, boolean, boolean); 518 method public boolean areLongLivedTcpConnectionsExpensive(); 519 method public int describeContents(); 520 method public int getType(); 521 method public boolean isBypassable(); 522 method public void writeToParcel(@NonNull android.os.Parcel, int); 523 field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR; 524 } 525 526} 527 528package android.net.apf { 529 530 public final class ApfCapabilities implements android.os.Parcelable { 531 ctor public ApfCapabilities(int, int, int); 532 method public int describeContents(); 533 method public static boolean getApfDrop8023Frames(); 534 method @NonNull public static int[] getApfEtherTypeBlackList(); 535 method public boolean hasDataAccess(); 536 method public void writeToParcel(android.os.Parcel, int); 537 field public static final android.os.Parcelable.Creator<android.net.apf.ApfCapabilities> CREATOR; 538 field public final int apfPacketFormat; 539 field public final int apfVersionSupported; 540 field public final int maximumApfProgramSize; 541 } 542 543} 544 545