1// Signature format: 2.0
2package android.net {
3
4  public class CaptivePortal implements android.os.Parcelable {
5    method public int describeContents();
6    method public void ignoreNetwork();
7    method public void reportCaptivePortalDismissed();
8    method public void writeToParcel(android.os.Parcel, int);
9    field @NonNull public static final android.os.Parcelable.Creator<android.net.CaptivePortal> CREATOR;
10  }
11
12  public class ConnectivityDiagnosticsManager {
13    method public void registerConnectivityDiagnosticsCallback(@NonNull android.net.NetworkRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback);
14    method public void unregisterConnectivityDiagnosticsCallback(@NonNull android.net.ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback);
15  }
16
17  public abstract static class ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback {
18    ctor public ConnectivityDiagnosticsManager.ConnectivityDiagnosticsCallback();
19    method public void onConnectivityReportAvailable(@NonNull android.net.ConnectivityDiagnosticsManager.ConnectivityReport);
20    method public void onDataStallSuspected(@NonNull android.net.ConnectivityDiagnosticsManager.DataStallReport);
21    method public void onNetworkConnectivityReported(@NonNull android.net.Network, boolean);
22  }
23
24  public static final class ConnectivityDiagnosticsManager.ConnectivityReport implements android.os.Parcelable {
25    ctor public ConnectivityDiagnosticsManager.ConnectivityReport(@NonNull android.net.Network, long, @NonNull android.net.LinkProperties, @NonNull android.net.NetworkCapabilities, @NonNull android.os.PersistableBundle);
26    method public int describeContents();
27    method @NonNull public android.os.PersistableBundle getAdditionalInfo();
28    method @NonNull public android.net.LinkProperties getLinkProperties();
29    method @NonNull public android.net.Network getNetwork();
30    method @NonNull public android.net.NetworkCapabilities getNetworkCapabilities();
31    method public long getReportTimestamp();
32    method public void writeToParcel(@NonNull android.os.Parcel, int);
33    field @NonNull public static final android.os.Parcelable.Creator<android.net.ConnectivityDiagnosticsManager.ConnectivityReport> CREATOR;
34    field public static final String KEY_NETWORK_PROBES_ATTEMPTED_BITMASK = "networkProbesAttempted";
35    field public static final String KEY_NETWORK_PROBES_SUCCEEDED_BITMASK = "networkProbesSucceeded";
36    field public static final String KEY_NETWORK_VALIDATION_RESULT = "networkValidationResult";
37    field public static final int NETWORK_PROBE_DNS = 4; // 0x4
38    field public static final int NETWORK_PROBE_FALLBACK = 32; // 0x20
39    field public static final int NETWORK_PROBE_HTTP = 8; // 0x8
40    field public static final int NETWORK_PROBE_HTTPS = 16; // 0x10
41    field public static final int NETWORK_PROBE_PRIVATE_DNS = 64; // 0x40
42    field public static final int NETWORK_VALIDATION_RESULT_INVALID = 0; // 0x0
43    field public static final int NETWORK_VALIDATION_RESULT_PARTIALLY_VALID = 2; // 0x2
44    field public static final int NETWORK_VALIDATION_RESULT_SKIPPED = 3; // 0x3
45    field public static final int NETWORK_VALIDATION_RESULT_VALID = 1; // 0x1
46  }
47
48  public static final class ConnectivityDiagnosticsManager.DataStallReport implements android.os.Parcelable {
49    ctor public ConnectivityDiagnosticsManager.DataStallReport(@NonNull android.net.Network, long, int, @NonNull android.net.LinkProperties, @NonNull android.net.NetworkCapabilities, @NonNull android.os.PersistableBundle);
50    method public int describeContents();
51    method public int getDetectionMethod();
52    method @NonNull public android.net.LinkProperties getLinkProperties();
53    method @NonNull public android.net.Network getNetwork();
54    method @NonNull public android.net.NetworkCapabilities getNetworkCapabilities();
55    method public long getReportTimestamp();
56    method @NonNull public android.os.PersistableBundle getStallDetails();
57    method public void writeToParcel(@NonNull android.os.Parcel, int);
58    field @NonNull public static final android.os.Parcelable.Creator<android.net.ConnectivityDiagnosticsManager.DataStallReport> CREATOR;
59    field public static final int DETECTION_METHOD_DNS_EVENTS = 1; // 0x1
60    field public static final int DETECTION_METHOD_TCP_METRICS = 2; // 0x2
61    field public static final String KEY_DNS_CONSECUTIVE_TIMEOUTS = "dnsConsecutiveTimeouts";
62    field public static final String KEY_TCP_METRICS_COLLECTION_PERIOD_MILLIS = "tcpMetricsCollectionPeriodMillis";
63    field public static final String KEY_TCP_PACKET_FAIL_RATE = "tcpPacketFailRate";
64  }
65
66  public class ConnectivityManager {
67    method public void addDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
68    method public boolean bindProcessToNetwork(@Nullable android.net.Network);
69    method @NonNull public android.net.SocketKeepalive createSocketKeepalive(@NonNull android.net.Network, @NonNull android.net.IpSecManager.UdpEncapsulationSocket, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull java.util.concurrent.Executor, @NonNull android.net.SocketKeepalive.Callback);
70    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.Network getActiveNetwork();
71    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getActiveNetworkInfo();
72    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo[] getAllNetworkInfo();
73    method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.Network[] getAllNetworks();
74    method @Deprecated public boolean getBackgroundDataSetting();
75    method @Nullable public android.net.Network getBoundNetworkForProcess();
76    method public int getConnectionOwnerUid(int, @NonNull java.net.InetSocketAddress, @NonNull java.net.InetSocketAddress);
77    method @Nullable public android.net.ProxyInfo getDefaultProxy();
78    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.LinkProperties getLinkProperties(@Nullable android.net.Network);
79    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public int getMultipathPreference(@Nullable android.net.Network);
80    method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkCapabilities getNetworkCapabilities(@Nullable android.net.Network);
81    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getNetworkInfo(int);
82    method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public android.net.NetworkInfo getNetworkInfo(@Nullable android.net.Network);
83    method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public int getNetworkPreference();
84    method @Nullable public byte[] getNetworkWatchlistConfigHash();
85    method @Deprecated @Nullable public static android.net.Network getProcessDefaultNetwork();
86    method public int getRestrictBackgroundStatus();
87    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public boolean isActiveNetworkMetered();
88    method public boolean isDefaultNetworkActive();
89    method @Deprecated public static boolean isNetworkTypeValid(int);
90    method public void registerBestMatchingNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
91    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback);
92    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
93    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback);
94    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
95    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void registerNetworkCallback(@NonNull android.net.NetworkRequest, @NonNull android.app.PendingIntent);
96    method public void releaseNetworkRequest(@NonNull android.app.PendingIntent);
97    method public void removeDefaultNetworkActiveListener(@NonNull android.net.ConnectivityManager.OnNetworkActiveListener);
98    method @Deprecated public void reportBadNetwork(@Nullable android.net.Network);
99    method public void reportNetworkConnectivity(@Nullable android.net.Network, boolean);
100    method public boolean requestBandwidthUpdate(@NonNull android.net.Network);
101    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback);
102    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
103    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, int);
104    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler, int);
105    method public void requestNetwork(@NonNull android.net.NetworkRequest, @NonNull android.app.PendingIntent);
106    method @Deprecated public void setNetworkPreference(int);
107    method @Deprecated public static boolean setProcessDefaultNetwork(@Nullable android.net.Network);
108    method public void unregisterNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback);
109    method public void unregisterNetworkCallback(@NonNull android.app.PendingIntent);
110    field @Deprecated public static final String ACTION_BACKGROUND_DATA_SETTING_CHANGED = "android.net.conn.BACKGROUND_DATA_SETTING_CHANGED";
111    field public static final String ACTION_CAPTIVE_PORTAL_SIGN_IN = "android.net.conn.CAPTIVE_PORTAL";
112    field public static final String ACTION_RESTRICT_BACKGROUND_CHANGED = "android.net.conn.RESTRICT_BACKGROUND_CHANGED";
113    field @Deprecated public static final String CONNECTIVITY_ACTION = "android.net.conn.CONNECTIVITY_CHANGE";
114    field @Deprecated public static final int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
115    field public static final String EXTRA_CAPTIVE_PORTAL = "android.net.extra.CAPTIVE_PORTAL";
116    field public static final String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
117    field @Deprecated public static final String EXTRA_EXTRA_INFO = "extraInfo";
118    field @Deprecated public static final String EXTRA_IS_FAILOVER = "isFailover";
119    field public static final String EXTRA_NETWORK = "android.net.extra.NETWORK";
120    field @Deprecated public static final String EXTRA_NETWORK_INFO = "networkInfo";
121    field public static final String EXTRA_NETWORK_REQUEST = "android.net.extra.NETWORK_REQUEST";
122    field @Deprecated public static final String EXTRA_NETWORK_TYPE = "networkType";
123    field public static final String EXTRA_NO_CONNECTIVITY = "noConnectivity";
124    field @Deprecated public static final String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
125    field public static final String EXTRA_REASON = "reason";
126    field public static final int MULTIPATH_PREFERENCE_HANDOVER = 1; // 0x1
127    field public static final int MULTIPATH_PREFERENCE_PERFORMANCE = 4; // 0x4
128    field public static final int MULTIPATH_PREFERENCE_RELIABILITY = 2; // 0x2
129    field public static final int RESTRICT_BACKGROUND_STATUS_DISABLED = 1; // 0x1
130    field public static final int RESTRICT_BACKGROUND_STATUS_ENABLED = 3; // 0x3
131    field public static final int RESTRICT_BACKGROUND_STATUS_WHITELISTED = 2; // 0x2
132    field @Deprecated public static final int TYPE_BLUETOOTH = 7; // 0x7
133    field @Deprecated public static final int TYPE_DUMMY = 8; // 0x8
134    field @Deprecated public static final int TYPE_ETHERNET = 9; // 0x9
135    field @Deprecated public static final int TYPE_MOBILE = 0; // 0x0
136    field @Deprecated public static final int TYPE_MOBILE_DUN = 4; // 0x4
137    field @Deprecated public static final int TYPE_MOBILE_HIPRI = 5; // 0x5
138    field @Deprecated public static final int TYPE_MOBILE_MMS = 2; // 0x2
139    field @Deprecated public static final int TYPE_MOBILE_SUPL = 3; // 0x3
140    field @Deprecated public static final int TYPE_VPN = 17; // 0x11
141    field @Deprecated public static final int TYPE_WIFI = 1; // 0x1
142    field @Deprecated public static final int TYPE_WIMAX = 6; // 0x6
143  }
144
145  public static class ConnectivityManager.NetworkCallback {
146    ctor public ConnectivityManager.NetworkCallback();
147    ctor public ConnectivityManager.NetworkCallback(int);
148    method public void onAvailable(@NonNull android.net.Network);
149    method public void onBlockedStatusChanged(@NonNull android.net.Network, boolean);
150    method public void onCapabilitiesChanged(@NonNull android.net.Network, @NonNull android.net.NetworkCapabilities);
151    method public void onLinkPropertiesChanged(@NonNull android.net.Network, @NonNull android.net.LinkProperties);
152    method public void onLosing(@NonNull android.net.Network, int);
153    method public void onLost(@NonNull android.net.Network);
154    method public void onUnavailable();
155    field public static final int FLAG_INCLUDE_LOCATION_INFO = 1; // 0x1
156  }
157
158  public static interface ConnectivityManager.OnNetworkActiveListener {
159    method public void onNetworkActive();
160  }
161
162  public class DhcpInfo implements android.os.Parcelable {
163    ctor public DhcpInfo();
164    method public int describeContents();
165    method public void writeToParcel(android.os.Parcel, int);
166    field @NonNull public static final android.os.Parcelable.Creator<android.net.DhcpInfo> CREATOR;
167    field public int dns1;
168    field public int dns2;
169    field public int gateway;
170    field public int ipAddress;
171    field public int leaseDuration;
172    field public int netmask;
173    field public int serverAddress;
174  }
175
176  public final class DnsResolver {
177    method @NonNull public static android.net.DnsResolver getInstance();
178    method public void query(@Nullable android.net.Network, @NonNull String, int, @NonNull java.util.concurrent.Executor, @Nullable android.os.CancellationSignal, @NonNull android.net.DnsResolver.Callback<? super java.util.List<java.net.InetAddress>>);
179    method public void query(@Nullable android.net.Network, @NonNull String, int, int, @NonNull java.util.concurrent.Executor, @Nullable android.os.CancellationSignal, @NonNull android.net.DnsResolver.Callback<? super java.util.List<java.net.InetAddress>>);
180    method public void rawQuery(@Nullable android.net.Network, @NonNull byte[], int, @NonNull java.util.concurrent.Executor, @Nullable android.os.CancellationSignal, @NonNull android.net.DnsResolver.Callback<? super byte[]>);
181    method public void rawQuery(@Nullable android.net.Network, @NonNull String, int, int, int, @NonNull java.util.concurrent.Executor, @Nullable android.os.CancellationSignal, @NonNull android.net.DnsResolver.Callback<? super byte[]>);
182    field public static final int CLASS_IN = 1; // 0x1
183    field public static final int ERROR_PARSE = 0; // 0x0
184    field public static final int ERROR_SYSTEM = 1; // 0x1
185    field public static final int FLAG_EMPTY = 0; // 0x0
186    field public static final int FLAG_NO_CACHE_LOOKUP = 4; // 0x4
187    field public static final int FLAG_NO_CACHE_STORE = 2; // 0x2
188    field public static final int FLAG_NO_RETRY = 1; // 0x1
189    field public static final int TYPE_A = 1; // 0x1
190    field public static final int TYPE_AAAA = 28; // 0x1c
191  }
192
193  public static interface DnsResolver.Callback<T> {
194    method public void onAnswer(@NonNull T, int);
195    method public void onError(@NonNull android.net.DnsResolver.DnsException);
196  }
197
198  public static class DnsResolver.DnsException extends java.lang.Exception {
199    ctor public DnsResolver.DnsException(int, @Nullable Throwable);
200    field public final int code;
201  }
202
203  public class InetAddresses {
204    method public static boolean isNumericAddress(@NonNull String);
205    method @NonNull public static java.net.InetAddress parseNumericAddress(@NonNull String);
206  }
207
208  public final class IpConfiguration implements android.os.Parcelable {
209    method public int describeContents();
210    method @Nullable public android.net.ProxyInfo getHttpProxy();
211    method @Nullable public android.net.StaticIpConfiguration getStaticIpConfiguration();
212    method public void writeToParcel(@NonNull android.os.Parcel, int);
213    field @NonNull public static final android.os.Parcelable.Creator<android.net.IpConfiguration> CREATOR;
214  }
215
216  public static final class IpConfiguration.Builder {
217    ctor public IpConfiguration.Builder();
218    method @NonNull public android.net.IpConfiguration build();
219    method @NonNull public android.net.IpConfiguration.Builder setHttpProxy(@Nullable android.net.ProxyInfo);
220    method @NonNull public android.net.IpConfiguration.Builder setStaticIpConfiguration(@Nullable android.net.StaticIpConfiguration);
221  }
222
223  public final class IpPrefix implements android.os.Parcelable {
224    ctor public IpPrefix(@NonNull java.net.InetAddress, @IntRange(from=0, to=128) int);
225    method public boolean contains(@NonNull java.net.InetAddress);
226    method public int describeContents();
227    method @NonNull public java.net.InetAddress getAddress();
228    method @IntRange(from=0, to=128) public int getPrefixLength();
229    method @NonNull public byte[] getRawAddress();
230    method public void writeToParcel(android.os.Parcel, int);
231    field @NonNull public static final android.os.Parcelable.Creator<android.net.IpPrefix> CREATOR;
232  }
233
234  public class LinkAddress implements android.os.Parcelable {
235    method public int describeContents();
236    method public java.net.InetAddress getAddress();
237    method public int getFlags();
238    method @IntRange(from=0, to=128) public int getPrefixLength();
239    method public int getScope();
240    method public void writeToParcel(android.os.Parcel, int);
241    field @NonNull public static final android.os.Parcelable.Creator<android.net.LinkAddress> CREATOR;
242  }
243
244  public final class LinkProperties implements android.os.Parcelable {
245    ctor public LinkProperties();
246    method public boolean addRoute(@NonNull android.net.RouteInfo);
247    method public void clear();
248    method public int describeContents();
249    method @Nullable public java.net.Inet4Address getDhcpServerAddress();
250    method @NonNull public java.util.List<java.net.InetAddress> getDnsServers();
251    method @Nullable public String getDomains();
252    method @Nullable public android.net.ProxyInfo getHttpProxy();
253    method @Nullable public String getInterfaceName();
254    method @NonNull public java.util.List<android.net.LinkAddress> getLinkAddresses();
255    method public int getMtu();
256    method @Nullable public android.net.IpPrefix getNat64Prefix();
257    method @Nullable public String getPrivateDnsServerName();
258    method @NonNull public java.util.List<android.net.RouteInfo> getRoutes();
259    method public boolean isPrivateDnsActive();
260    method public boolean isWakeOnLanSupported();
261    method public void setDhcpServerAddress(@Nullable java.net.Inet4Address);
262    method public void setDnsServers(@NonNull java.util.Collection<java.net.InetAddress>);
263    method public void setDomains(@Nullable String);
264    method public void setHttpProxy(@Nullable android.net.ProxyInfo);
265    method public void setInterfaceName(@Nullable String);
266    method public void setLinkAddresses(@NonNull java.util.Collection<android.net.LinkAddress>);
267    method public void setMtu(int);
268    method public void setNat64Prefix(@Nullable android.net.IpPrefix);
269    method public void writeToParcel(android.os.Parcel, int);
270    field @NonNull public static final android.os.Parcelable.Creator<android.net.LinkProperties> CREATOR;
271  }
272
273  public final class MacAddress implements android.os.Parcelable {
274    method public int describeContents();
275    method @NonNull public static android.net.MacAddress fromBytes(@NonNull byte[]);
276    method @NonNull public static android.net.MacAddress fromString(@NonNull String);
277    method public int getAddressType();
278    method @Nullable public java.net.Inet6Address getLinkLocalIpv6FromEui48Mac();
279    method public boolean isLocallyAssigned();
280    method public boolean matches(@NonNull android.net.MacAddress, @NonNull android.net.MacAddress);
281    method @NonNull public byte[] toByteArray();
282    method @NonNull public String toOuiString();
283    method public void writeToParcel(android.os.Parcel, int);
284    field public static final android.net.MacAddress BROADCAST_ADDRESS;
285    field @NonNull public static final android.os.Parcelable.Creator<android.net.MacAddress> CREATOR;
286    field public static final int TYPE_BROADCAST = 3; // 0x3
287    field public static final int TYPE_MULTICAST = 2; // 0x2
288    field public static final int TYPE_UNICAST = 1; // 0x1
289  }
290
291  public class Network implements android.os.Parcelable {
292    method public void bindSocket(java.net.DatagramSocket) throws java.io.IOException;
293    method public void bindSocket(java.net.Socket) throws java.io.IOException;
294    method public void bindSocket(java.io.FileDescriptor) throws java.io.IOException;
295    method public int describeContents();
296    method public static android.net.Network fromNetworkHandle(long);
297    method public java.net.InetAddress[] getAllByName(String) throws java.net.UnknownHostException;
298    method public java.net.InetAddress getByName(String) throws java.net.UnknownHostException;
299    method public long getNetworkHandle();
300    method public javax.net.SocketFactory getSocketFactory();
301    method public java.net.URLConnection openConnection(java.net.URL) throws java.io.IOException;
302    method public java.net.URLConnection openConnection(java.net.URL, java.net.Proxy) throws java.io.IOException;
303    method public void writeToParcel(android.os.Parcel, int);
304    field @NonNull public static final android.os.Parcelable.Creator<android.net.Network> CREATOR;
305  }
306
307  public final class NetworkCapabilities implements android.os.Parcelable {
308    ctor public NetworkCapabilities();
309    ctor public NetworkCapabilities(android.net.NetworkCapabilities);
310    method public int describeContents();
311    method @NonNull public int[] getCapabilities();
312    method @NonNull public int[] getEnterpriseIds();
313    method public int getLinkDownstreamBandwidthKbps();
314    method public int getLinkUpstreamBandwidthKbps();
315    method @Nullable public android.net.NetworkSpecifier getNetworkSpecifier();
316    method public int getOwnerUid();
317    method public int getSignalStrength();
318    method @FlaggedApi("com.android.net.flags.request_restricted_wifi") @NonNull public java.util.Set<java.lang.Integer> getSubscriptionIds();
319    method @Nullable public android.net.TransportInfo getTransportInfo();
320    method public boolean hasCapability(int);
321    method public boolean hasEnterpriseId(int);
322    method public boolean hasTransport(int);
323    method public void writeToParcel(android.os.Parcel, int);
324    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkCapabilities> CREATOR;
325    field public static final int NET_CAPABILITY_CAPTIVE_PORTAL = 17; // 0x11
326    field public static final int NET_CAPABILITY_CBS = 5; // 0x5
327    field public static final int NET_CAPABILITY_DUN = 2; // 0x2
328    field public static final int NET_CAPABILITY_EIMS = 10; // 0xa
329    field public static final int NET_CAPABILITY_ENTERPRISE = 29; // 0x1d
330    field public static final int NET_CAPABILITY_FOREGROUND = 19; // 0x13
331    field public static final int NET_CAPABILITY_FOTA = 3; // 0x3
332    field public static final int NET_CAPABILITY_HEAD_UNIT = 32; // 0x20
333    field public static final int NET_CAPABILITY_IA = 7; // 0x7
334    field public static final int NET_CAPABILITY_IMS = 4; // 0x4
335    field public static final int NET_CAPABILITY_INTERNET = 12; // 0xc
336    field @FlaggedApi("com.android.net.flags.net_capability_local_network") public static final int NET_CAPABILITY_LOCAL_NETWORK = 36; // 0x24
337    field public static final int NET_CAPABILITY_MCX = 23; // 0x17
338    field public static final int NET_CAPABILITY_MMS = 0; // 0x0
339    field public static final int NET_CAPABILITY_MMTEL = 33; // 0x21
340    field @FlaggedApi("com.android.net.flags.net_capability_not_bandwidth_constrained") public static final int NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED = 37; // 0x25
341    field public static final int NET_CAPABILITY_NOT_CONGESTED = 20; // 0x14
342    field public static final int NET_CAPABILITY_NOT_METERED = 11; // 0xb
343    field public static final int NET_CAPABILITY_NOT_RESTRICTED = 13; // 0xd
344    field public static final int NET_CAPABILITY_NOT_ROAMING = 18; // 0x12
345    field public static final int NET_CAPABILITY_NOT_SUSPENDED = 21; // 0x15
346    field public static final int NET_CAPABILITY_NOT_VPN = 15; // 0xf
347    field public static final int NET_CAPABILITY_PRIORITIZE_BANDWIDTH = 35; // 0x23
348    field public static final int NET_CAPABILITY_PRIORITIZE_LATENCY = 34; // 0x22
349    field public static final int NET_CAPABILITY_RCS = 8; // 0x8
350    field public static final int NET_CAPABILITY_SUPL = 1; // 0x1
351    field public static final int NET_CAPABILITY_TEMPORARILY_NOT_METERED = 25; // 0x19
352    field public static final int NET_CAPABILITY_TRUSTED = 14; // 0xe
353    field public static final int NET_CAPABILITY_VALIDATED = 16; // 0x10
354    field public static final int NET_CAPABILITY_WIFI_P2P = 6; // 0x6
355    field public static final int NET_CAPABILITY_XCAP = 9; // 0x9
356    field public static final int NET_ENTERPRISE_ID_1 = 1; // 0x1
357    field public static final int NET_ENTERPRISE_ID_2 = 2; // 0x2
358    field public static final int NET_ENTERPRISE_ID_3 = 3; // 0x3
359    field public static final int NET_ENTERPRISE_ID_4 = 4; // 0x4
360    field public static final int NET_ENTERPRISE_ID_5 = 5; // 0x5
361    field public static final int SIGNAL_STRENGTH_UNSPECIFIED = -2147483648; // 0x80000000
362    field public static final int TRANSPORT_BLUETOOTH = 2; // 0x2
363    field public static final int TRANSPORT_CELLULAR = 0; // 0x0
364    field public static final int TRANSPORT_ETHERNET = 3; // 0x3
365    field public static final int TRANSPORT_LOWPAN = 6; // 0x6
366    field @FlaggedApi("com.android.net.flags.support_transport_satellite") public static final int TRANSPORT_SATELLITE = 10; // 0xa
367    field public static final int TRANSPORT_THREAD = 9; // 0x9
368    field public static final int TRANSPORT_USB = 8; // 0x8
369    field public static final int TRANSPORT_VPN = 4; // 0x4
370    field public static final int TRANSPORT_WIFI = 1; // 0x1
371    field public static final int TRANSPORT_WIFI_AWARE = 5; // 0x5
372  }
373
374  @Deprecated public class NetworkInfo implements android.os.Parcelable {
375    ctor @Deprecated public NetworkInfo(int, int, @Nullable String, @Nullable String);
376    method @Deprecated public int describeContents();
377    method @Deprecated @NonNull public android.net.NetworkInfo.DetailedState getDetailedState();
378    method @Deprecated public String getExtraInfo();
379    method @Deprecated public String getReason();
380    method @Deprecated public android.net.NetworkInfo.State getState();
381    method @Deprecated public int getSubtype();
382    method @Deprecated public String getSubtypeName();
383    method @Deprecated public int getType();
384    method @Deprecated public String getTypeName();
385    method @Deprecated public boolean isAvailable();
386    method @Deprecated public boolean isConnected();
387    method @Deprecated public boolean isConnectedOrConnecting();
388    method @Deprecated public boolean isFailover();
389    method @Deprecated public boolean isRoaming();
390    method @Deprecated public void setDetailedState(@NonNull android.net.NetworkInfo.DetailedState, @Nullable String, @Nullable String);
391    method @Deprecated public void writeToParcel(android.os.Parcel, int);
392    field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
393  }
394
395  @Deprecated public enum NetworkInfo.DetailedState {
396    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
397    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState BLOCKED;
398    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CAPTIVE_PORTAL_CHECK;
399    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTED;
400    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTING;
401    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTED;
402    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTING;
403    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState FAILED;
404    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState IDLE;
405    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState OBTAINING_IPADDR;
406    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SCANNING;
407    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SUSPENDED;
408    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
409  }
410
411  @Deprecated public enum NetworkInfo.State {
412    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTED;
413    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTING;
414    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTED;
415    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTING;
416    enum_constant @Deprecated public static final android.net.NetworkInfo.State SUSPENDED;
417    enum_constant @Deprecated public static final android.net.NetworkInfo.State UNKNOWN;
418  }
419
420  public class NetworkRequest implements android.os.Parcelable {
421    method public boolean canBeSatisfiedBy(@Nullable android.net.NetworkCapabilities);
422    method public int describeContents();
423    method @NonNull public int[] getCapabilities();
424    method @Nullable public android.net.NetworkSpecifier getNetworkSpecifier();
425    method @FlaggedApi("com.android.net.flags.request_restricted_wifi") @NonNull public java.util.Set<java.lang.Integer> getSubscriptionIds();
426    method @NonNull public int[] getTransportTypes();
427    method public boolean hasCapability(int);
428    method public boolean hasTransport(int);
429    method public void writeToParcel(android.os.Parcel, int);
430    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkRequest> CREATOR;
431  }
432
433  public static class NetworkRequest.Builder {
434    ctor public NetworkRequest.Builder();
435    ctor public NetworkRequest.Builder(@NonNull android.net.NetworkRequest);
436    method public android.net.NetworkRequest.Builder addCapability(int);
437    method public android.net.NetworkRequest.Builder addTransportType(int);
438    method public android.net.NetworkRequest build();
439    method @NonNull public android.net.NetworkRequest.Builder clearCapabilities();
440    method public android.net.NetworkRequest.Builder removeCapability(int);
441    method public android.net.NetworkRequest.Builder removeTransportType(int);
442    method @NonNull public android.net.NetworkRequest.Builder setIncludeOtherUidNetworks(boolean);
443    method @Deprecated public android.net.NetworkRequest.Builder setNetworkSpecifier(String);
444    method public android.net.NetworkRequest.Builder setNetworkSpecifier(android.net.NetworkSpecifier);
445    method @FlaggedApi("com.android.net.flags.request_restricted_wifi") @NonNull public android.net.NetworkRequest.Builder setSubscriptionIds(@NonNull java.util.Set<java.lang.Integer>);
446  }
447
448  public class ParseException extends java.lang.RuntimeException {
449    ctor public ParseException(@NonNull String);
450    ctor public ParseException(@NonNull String, @NonNull Throwable);
451    field public String response;
452  }
453
454  public class ProxyInfo implements android.os.Parcelable {
455    ctor public ProxyInfo(@Nullable android.net.ProxyInfo);
456    method public static android.net.ProxyInfo buildDirectProxy(String, int);
457    method public static android.net.ProxyInfo buildDirectProxy(String, int, java.util.List<java.lang.String>);
458    method public static android.net.ProxyInfo buildPacProxy(android.net.Uri);
459    method @NonNull public static android.net.ProxyInfo buildPacProxy(@NonNull android.net.Uri, int);
460    method public int describeContents();
461    method public String[] getExclusionList();
462    method public String getHost();
463    method public android.net.Uri getPacFileUrl();
464    method public int getPort();
465    method public boolean isValid();
466    method public void writeToParcel(android.os.Parcel, int);
467    field @NonNull public static final android.os.Parcelable.Creator<android.net.ProxyInfo> CREATOR;
468  }
469
470  public final class RouteInfo implements android.os.Parcelable {
471    method public int describeContents();
472    method @NonNull public android.net.IpPrefix getDestination();
473    method @Nullable public java.net.InetAddress getGateway();
474    method @Nullable public String getInterface();
475    method public int getType();
476    method public boolean hasGateway();
477    method public boolean isDefaultRoute();
478    method public boolean matches(java.net.InetAddress);
479    method public void writeToParcel(android.os.Parcel, int);
480    field @NonNull public static final android.os.Parcelable.Creator<android.net.RouteInfo> CREATOR;
481    field public static final int RTN_THROW = 9; // 0x9
482    field public static final int RTN_UNICAST = 1; // 0x1
483    field public static final int RTN_UNREACHABLE = 7; // 0x7
484  }
485
486  public abstract class SocketKeepalive implements java.lang.AutoCloseable {
487    method public final void close();
488    method public final void start(@IntRange(from=0xa, to=0xe10) int);
489    method public final void stop();
490    field public static final int ERROR_HARDWARE_ERROR = -31; // 0xffffffe1
491    field public static final int ERROR_INSUFFICIENT_RESOURCES = -32; // 0xffffffe0
492    field public static final int ERROR_INVALID_INTERVAL = -24; // 0xffffffe8
493    field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb
494    field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9
495    field public static final int ERROR_INVALID_NETWORK = -20; // 0xffffffec
496    field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea
497    field public static final int ERROR_INVALID_SOCKET = -25; // 0xffffffe7
498    field public static final int ERROR_SOCKET_NOT_IDLE = -26; // 0xffffffe6
499    field public static final int ERROR_UNSUPPORTED = -30; // 0xffffffe2
500  }
501
502  public static class SocketKeepalive.Callback {
503    ctor public SocketKeepalive.Callback();
504    method public void onDataReceived();
505    method public void onError(int);
506    method public void onStarted();
507    method public void onStopped();
508  }
509
510  public final class StaticIpConfiguration implements android.os.Parcelable {
511    method public int describeContents();
512    method @NonNull public java.util.List<java.net.InetAddress> getDnsServers();
513    method @Nullable public String getDomains();
514    method @Nullable public java.net.InetAddress getGateway();
515    method @NonNull public android.net.LinkAddress getIpAddress();
516    method public void writeToParcel(@NonNull android.os.Parcel, int);
517    field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR;
518  }
519
520  public static final class StaticIpConfiguration.Builder {
521    ctor public StaticIpConfiguration.Builder();
522    method @NonNull public android.net.StaticIpConfiguration build();
523    method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>);
524    method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String);
525    method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress);
526    method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@NonNull android.net.LinkAddress);
527  }
528
529  public interface TransportInfo {
530  }
531
532}
533
534package android.net.http {
535
536  public abstract class BidirectionalStream {
537    ctor public BidirectionalStream();
538    method public abstract void cancel();
539    method public abstract void flush();
540    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
541    method @NonNull public abstract String getHttpMethod();
542    method public abstract int getPriority();
543    method public abstract int getTrafficStatsTag();
544    method public abstract int getTrafficStatsUid();
545    method public abstract boolean hasTrafficStatsTag();
546    method public abstract boolean hasTrafficStatsUid();
547    method public abstract boolean isDelayRequestHeadersUntilFirstFlushEnabled();
548    method public abstract boolean isDone();
549    method public abstract void read(@NonNull java.nio.ByteBuffer);
550    method public abstract void start();
551    method public abstract void write(@NonNull java.nio.ByteBuffer, boolean);
552    field public static final int STREAM_PRIORITY_HIGHEST = 4; // 0x4
553    field public static final int STREAM_PRIORITY_IDLE = 0; // 0x0
554    field public static final int STREAM_PRIORITY_LOW = 2; // 0x2
555    field public static final int STREAM_PRIORITY_LOWEST = 1; // 0x1
556    field public static final int STREAM_PRIORITY_MEDIUM = 3; // 0x3
557  }
558
559  public abstract static class BidirectionalStream.Builder {
560    ctor public BidirectionalStream.Builder();
561    method @NonNull public abstract android.net.http.BidirectionalStream.Builder addHeader(@NonNull String, @NonNull String);
562    method @NonNull public abstract android.net.http.BidirectionalStream build();
563    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setDelayRequestHeadersUntilFirstFlushEnabled(boolean);
564    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setHttpMethod(@NonNull String);
565    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setPriority(int);
566    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setTrafficStatsTag(int);
567    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setTrafficStatsUid(int);
568  }
569
570  public static interface BidirectionalStream.Callback {
571    method public void onCanceled(@NonNull android.net.http.BidirectionalStream, @Nullable android.net.http.UrlResponseInfo);
572    method public void onFailed(@NonNull android.net.http.BidirectionalStream, @Nullable android.net.http.UrlResponseInfo, @NonNull android.net.http.HttpException);
573    method public void onReadCompleted(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer, boolean);
574    method public void onResponseHeadersReceived(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo);
575    method public void onResponseTrailersReceived(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull android.net.http.HeaderBlock);
576    method public void onStreamReady(@NonNull android.net.http.BidirectionalStream);
577    method public void onSucceeded(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo);
578    method public void onWriteCompleted(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer, boolean);
579  }
580
581  public abstract class CallbackException extends android.net.http.HttpException {
582    ctor protected CallbackException(@Nullable String, @Nullable Throwable);
583  }
584
585  public class ConnectionMigrationOptions {
586    method public int getAllowNonDefaultNetworkUsage();
587    method public int getDefaultNetworkMigration();
588    method public int getPathDegradationMigration();
589    field public static final int MIGRATION_OPTION_DISABLED = 2; // 0x2
590    field public static final int MIGRATION_OPTION_ENABLED = 1; // 0x1
591    field public static final int MIGRATION_OPTION_UNSPECIFIED = 0; // 0x0
592  }
593
594  public static final class ConnectionMigrationOptions.Builder {
595    ctor public ConnectionMigrationOptions.Builder();
596    method @NonNull public android.net.http.ConnectionMigrationOptions build();
597    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setAllowNonDefaultNetworkUsage(int);
598    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setDefaultNetworkMigration(int);
599    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setPathDegradationMigration(int);
600  }
601
602  public final class DnsOptions {
603    method public int getPersistHostCache();
604    method @Nullable public java.time.Duration getPersistHostCachePeriod();
605    method public int getPreestablishConnectionsToStaleDnsResults();
606    method public int getStaleDns();
607    method @Nullable public android.net.http.DnsOptions.StaleDnsOptions getStaleDnsOptions();
608    method public int getUseHttpStackDnsResolver();
609    field public static final int DNS_OPTION_DISABLED = 2; // 0x2
610    field public static final int DNS_OPTION_ENABLED = 1; // 0x1
611    field public static final int DNS_OPTION_UNSPECIFIED = 0; // 0x0
612  }
613
614  public static final class DnsOptions.Builder {
615    ctor public DnsOptions.Builder();
616    method @NonNull public android.net.http.DnsOptions build();
617    method @NonNull public android.net.http.DnsOptions.Builder setPersistHostCache(int);
618    method @NonNull public android.net.http.DnsOptions.Builder setPersistHostCachePeriod(@NonNull java.time.Duration);
619    method @NonNull public android.net.http.DnsOptions.Builder setPreestablishConnectionsToStaleDnsResults(int);
620    method @NonNull public android.net.http.DnsOptions.Builder setStaleDns(int);
621    method @NonNull public android.net.http.DnsOptions.Builder setStaleDnsOptions(@NonNull android.net.http.DnsOptions.StaleDnsOptions);
622    method @NonNull public android.net.http.DnsOptions.Builder setUseHttpStackDnsResolver(int);
623  }
624
625  public static class DnsOptions.StaleDnsOptions {
626    method public int getAllowCrossNetworkUsage();
627    method @Nullable public java.time.Duration getFreshLookupTimeout();
628    method @Nullable public java.time.Duration getMaxExpiredDelay();
629    method public int getUseStaleOnNameNotResolved();
630  }
631
632  public static final class DnsOptions.StaleDnsOptions.Builder {
633    ctor public DnsOptions.StaleDnsOptions.Builder();
634    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions build();
635    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setAllowCrossNetworkUsage(int);
636    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setFreshLookupTimeout(@NonNull java.time.Duration);
637    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setMaxExpiredDelay(@NonNull java.time.Duration);
638    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setUseStaleOnNameNotResolved(int);
639  }
640
641  public abstract class HeaderBlock {
642    ctor public HeaderBlock();
643    method @NonNull public abstract java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> getAsList();
644    method @NonNull public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAsMap();
645  }
646
647  public abstract class HttpEngine {
648    method public void bindToNetwork(@Nullable android.net.Network);
649    method @NonNull public abstract java.net.URLStreamHandlerFactory createUrlStreamHandlerFactory();
650    method @NonNull public static String getVersionString();
651    method @NonNull public abstract android.net.http.BidirectionalStream.Builder newBidirectionalStreamBuilder(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.http.BidirectionalStream.Callback);
652    method @NonNull public abstract android.net.http.UrlRequest.Builder newUrlRequestBuilder(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.http.UrlRequest.Callback);
653    method @NonNull public abstract java.net.URLConnection openConnection(@NonNull java.net.URL) throws java.io.IOException;
654    method public abstract void shutdown();
655  }
656
657  public static class HttpEngine.Builder {
658    ctor public HttpEngine.Builder(@NonNull android.content.Context);
659    method @NonNull public android.net.http.HttpEngine.Builder addPublicKeyPins(@NonNull String, @NonNull java.util.Set<byte[]>, boolean, @NonNull java.time.Instant);
660    method @NonNull public android.net.http.HttpEngine.Builder addQuicHint(@NonNull String, int, int);
661    method @NonNull public android.net.http.HttpEngine build();
662    method @NonNull public String getDefaultUserAgent();
663    method @NonNull public android.net.http.HttpEngine.Builder setConnectionMigrationOptions(@NonNull android.net.http.ConnectionMigrationOptions);
664    method @NonNull public android.net.http.HttpEngine.Builder setDnsOptions(@NonNull android.net.http.DnsOptions);
665    method @NonNull public android.net.http.HttpEngine.Builder setEnableBrotli(boolean);
666    method @NonNull public android.net.http.HttpEngine.Builder setEnableHttp2(boolean);
667    method @NonNull public android.net.http.HttpEngine.Builder setEnableHttpCache(int, long);
668    method @NonNull public android.net.http.HttpEngine.Builder setEnablePublicKeyPinningBypassForLocalTrustAnchors(boolean);
669    method @NonNull public android.net.http.HttpEngine.Builder setEnableQuic(boolean);
670    method @NonNull public android.net.http.HttpEngine.Builder setQuicOptions(@NonNull android.net.http.QuicOptions);
671    method @NonNull public android.net.http.HttpEngine.Builder setStoragePath(@NonNull String);
672    method @NonNull public android.net.http.HttpEngine.Builder setUserAgent(@NonNull String);
673    field public static final int HTTP_CACHE_DISABLED = 0; // 0x0
674    field public static final int HTTP_CACHE_DISK = 3; // 0x3
675    field public static final int HTTP_CACHE_DISK_NO_HTTP = 2; // 0x2
676    field public static final int HTTP_CACHE_IN_MEMORY = 1; // 0x1
677  }
678
679  public class HttpException extends java.io.IOException {
680    ctor public HttpException(@Nullable String, @Nullable Throwable);
681  }
682
683  public final class InlineExecutionProhibitedException extends java.util.concurrent.RejectedExecutionException {
684    ctor public InlineExecutionProhibitedException();
685  }
686
687  public abstract class NetworkException extends android.net.http.HttpException {
688    ctor public NetworkException(@Nullable String, @Nullable Throwable);
689    method public abstract int getErrorCode();
690    method public abstract boolean isImmediatelyRetryable();
691    field public static final int ERROR_ADDRESS_UNREACHABLE = 9; // 0x9
692    field public static final int ERROR_CONNECTION_CLOSED = 5; // 0x5
693    field public static final int ERROR_CONNECTION_REFUSED = 7; // 0x7
694    field public static final int ERROR_CONNECTION_RESET = 8; // 0x8
695    field public static final int ERROR_CONNECTION_TIMED_OUT = 6; // 0x6
696    field public static final int ERROR_HOSTNAME_NOT_RESOLVED = 1; // 0x1
697    field public static final int ERROR_INTERNET_DISCONNECTED = 2; // 0x2
698    field public static final int ERROR_NETWORK_CHANGED = 3; // 0x3
699    field public static final int ERROR_OTHER = 11; // 0xb
700    field public static final int ERROR_QUIC_PROTOCOL_FAILED = 10; // 0xa
701    field public static final int ERROR_TIMED_OUT = 4; // 0x4
702  }
703
704  public abstract class QuicException extends android.net.http.NetworkException {
705    ctor protected QuicException(@Nullable String, @Nullable Throwable);
706  }
707
708  public class QuicOptions {
709    method @NonNull public java.util.Set<java.lang.String> getAllowedQuicHosts();
710    method @Nullable public String getHandshakeUserAgent();
711    method @Nullable public java.time.Duration getIdleConnectionTimeout();
712    method public int getInMemoryServerConfigsCacheSize();
713    method public boolean hasInMemoryServerConfigsCacheSize();
714  }
715
716  public static final class QuicOptions.Builder {
717    ctor public QuicOptions.Builder();
718    method @NonNull public android.net.http.QuicOptions.Builder addAllowedQuicHost(@NonNull String);
719    method @NonNull public android.net.http.QuicOptions build();
720    method @NonNull public android.net.http.QuicOptions.Builder setHandshakeUserAgent(@NonNull String);
721    method @NonNull public android.net.http.QuicOptions.Builder setIdleConnectionTimeout(@NonNull java.time.Duration);
722    method @NonNull public android.net.http.QuicOptions.Builder setInMemoryServerConfigsCacheSize(int);
723  }
724
725  public abstract class UploadDataProvider implements java.io.Closeable {
726    ctor public UploadDataProvider();
727    method public void close() throws java.io.IOException;
728    method public abstract long getLength() throws java.io.IOException;
729    method public abstract void read(@NonNull android.net.http.UploadDataSink, @NonNull java.nio.ByteBuffer) throws java.io.IOException;
730    method public abstract void rewind(@NonNull android.net.http.UploadDataSink) throws java.io.IOException;
731  }
732
733  public abstract class UploadDataSink {
734    ctor public UploadDataSink();
735    method public abstract void onReadError(@NonNull Exception);
736    method public abstract void onReadSucceeded(boolean);
737    method public abstract void onRewindError(@NonNull Exception);
738    method public abstract void onRewindSucceeded();
739  }
740
741  public abstract class UrlRequest {
742    method public abstract void cancel();
743    method public abstract void followRedirect();
744    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
745    method @Nullable public abstract String getHttpMethod();
746    method public abstract int getPriority();
747    method public abstract void getStatus(@NonNull android.net.http.UrlRequest.StatusListener);
748    method public abstract int getTrafficStatsTag();
749    method public abstract int getTrafficStatsUid();
750    method public abstract boolean hasTrafficStatsTag();
751    method public abstract boolean hasTrafficStatsUid();
752    method public abstract boolean isCacheDisabled();
753    method public abstract boolean isDirectExecutorAllowed();
754    method public abstract boolean isDone();
755    method public abstract void read(@NonNull java.nio.ByteBuffer);
756    method public abstract void start();
757    field public static final int REQUEST_PRIORITY_HIGHEST = 4; // 0x4
758    field public static final int REQUEST_PRIORITY_IDLE = 0; // 0x0
759    field public static final int REQUEST_PRIORITY_LOW = 2; // 0x2
760    field public static final int REQUEST_PRIORITY_LOWEST = 1; // 0x1
761    field public static final int REQUEST_PRIORITY_MEDIUM = 3; // 0x3
762  }
763
764  public abstract static class UrlRequest.Builder {
765    method @NonNull public abstract android.net.http.UrlRequest.Builder addHeader(@NonNull String, @NonNull String);
766    method @NonNull public abstract android.net.http.UrlRequest.Builder bindToNetwork(@Nullable android.net.Network);
767    method @NonNull public abstract android.net.http.UrlRequest build();
768    method @NonNull public abstract android.net.http.UrlRequest.Builder setCacheDisabled(boolean);
769    method @NonNull public abstract android.net.http.UrlRequest.Builder setDirectExecutorAllowed(boolean);
770    method @NonNull public abstract android.net.http.UrlRequest.Builder setHttpMethod(@NonNull String);
771    method @NonNull public abstract android.net.http.UrlRequest.Builder setPriority(int);
772    method @NonNull public abstract android.net.http.UrlRequest.Builder setTrafficStatsTag(int);
773    method @NonNull public abstract android.net.http.UrlRequest.Builder setTrafficStatsUid(int);
774    method @NonNull public abstract android.net.http.UrlRequest.Builder setUploadDataProvider(@NonNull android.net.http.UploadDataProvider, @NonNull java.util.concurrent.Executor);
775  }
776
777  public static interface UrlRequest.Callback {
778    method public void onCanceled(@NonNull android.net.http.UrlRequest, @Nullable android.net.http.UrlResponseInfo);
779    method public void onFailed(@NonNull android.net.http.UrlRequest, @Nullable android.net.http.UrlResponseInfo, @NonNull android.net.http.HttpException);
780    method public void onReadCompleted(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer) throws java.lang.Exception;
781    method public void onRedirectReceived(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo, @NonNull String) throws java.lang.Exception;
782    method public void onResponseStarted(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo) throws java.lang.Exception;
783    method public void onSucceeded(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo);
784  }
785
786  public static class UrlRequest.Status {
787    field public static final int CONNECTING = 10; // 0xa
788    field public static final int DOWNLOADING_PAC_FILE = 5; // 0x5
789    field public static final int ESTABLISHING_PROXY_TUNNEL = 8; // 0x8
790    field public static final int IDLE = 0; // 0x0
791    field public static final int INVALID = -1; // 0xffffffff
792    field public static final int READING_RESPONSE = 14; // 0xe
793    field public static final int RESOLVING_HOST = 9; // 0x9
794    field public static final int RESOLVING_HOST_IN_PAC_FILE = 7; // 0x7
795    field public static final int RESOLVING_PROXY_FOR_URL = 6; // 0x6
796    field public static final int SENDING_REQUEST = 12; // 0xc
797    field public static final int SSL_HANDSHAKE = 11; // 0xb
798    field public static final int WAITING_FOR_AVAILABLE_SOCKET = 2; // 0x2
799    field public static final int WAITING_FOR_CACHE = 4; // 0x4
800    field public static final int WAITING_FOR_DELEGATE = 3; // 0x3
801    field public static final int WAITING_FOR_RESPONSE = 13; // 0xd
802    field public static final int WAITING_FOR_STALLED_SOCKET_POOL = 1; // 0x1
803  }
804
805  public static interface UrlRequest.StatusListener {
806    method public void onStatus(int);
807  }
808
809  public abstract class UrlResponseInfo {
810    ctor public UrlResponseInfo();
811    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
812    method public abstract int getHttpStatusCode();
813    method @NonNull public abstract String getHttpStatusText();
814    method @NonNull public abstract String getNegotiatedProtocol();
815    method public abstract long getReceivedByteCount();
816    method @NonNull public abstract String getUrl();
817    method @NonNull public abstract java.util.List<java.lang.String> getUrlChain();
818    method public abstract boolean wasCached();
819  }
820
821}
822
823