• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 @Nullable public android.net.TransportInfo getTransportInfo();
319    method public boolean hasCapability(int);
320    method public boolean hasEnterpriseId(int);
321    method public boolean hasTransport(int);
322    method public void writeToParcel(android.os.Parcel, int);
323    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkCapabilities> CREATOR;
324    field public static final int NET_CAPABILITY_CAPTIVE_PORTAL = 17; // 0x11
325    field public static final int NET_CAPABILITY_CBS = 5; // 0x5
326    field public static final int NET_CAPABILITY_DUN = 2; // 0x2
327    field public static final int NET_CAPABILITY_EIMS = 10; // 0xa
328    field public static final int NET_CAPABILITY_ENTERPRISE = 29; // 0x1d
329    field public static final int NET_CAPABILITY_FOREGROUND = 19; // 0x13
330    field public static final int NET_CAPABILITY_FOTA = 3; // 0x3
331    field public static final int NET_CAPABILITY_HEAD_UNIT = 32; // 0x20
332    field public static final int NET_CAPABILITY_IA = 7; // 0x7
333    field public static final int NET_CAPABILITY_IMS = 4; // 0x4
334    field public static final int NET_CAPABILITY_INTERNET = 12; // 0xc
335    field public static final int NET_CAPABILITY_MCX = 23; // 0x17
336    field public static final int NET_CAPABILITY_MMS = 0; // 0x0
337    field public static final int NET_CAPABILITY_MMTEL = 33; // 0x21
338    field public static final int NET_CAPABILITY_NOT_CONGESTED = 20; // 0x14
339    field public static final int NET_CAPABILITY_NOT_METERED = 11; // 0xb
340    field public static final int NET_CAPABILITY_NOT_RESTRICTED = 13; // 0xd
341    field public static final int NET_CAPABILITY_NOT_ROAMING = 18; // 0x12
342    field public static final int NET_CAPABILITY_NOT_SUSPENDED = 21; // 0x15
343    field public static final int NET_CAPABILITY_NOT_VPN = 15; // 0xf
344    field public static final int NET_CAPABILITY_PRIORITIZE_BANDWIDTH = 35; // 0x23
345    field public static final int NET_CAPABILITY_PRIORITIZE_LATENCY = 34; // 0x22
346    field public static final int NET_CAPABILITY_RCS = 8; // 0x8
347    field public static final int NET_CAPABILITY_SUPL = 1; // 0x1
348    field public static final int NET_CAPABILITY_TEMPORARILY_NOT_METERED = 25; // 0x19
349    field public static final int NET_CAPABILITY_TRUSTED = 14; // 0xe
350    field public static final int NET_CAPABILITY_VALIDATED = 16; // 0x10
351    field public static final int NET_CAPABILITY_WIFI_P2P = 6; // 0x6
352    field public static final int NET_CAPABILITY_XCAP = 9; // 0x9
353    field public static final int NET_ENTERPRISE_ID_1 = 1; // 0x1
354    field public static final int NET_ENTERPRISE_ID_2 = 2; // 0x2
355    field public static final int NET_ENTERPRISE_ID_3 = 3; // 0x3
356    field public static final int NET_ENTERPRISE_ID_4 = 4; // 0x4
357    field public static final int NET_ENTERPRISE_ID_5 = 5; // 0x5
358    field public static final int SIGNAL_STRENGTH_UNSPECIFIED = -2147483648; // 0x80000000
359    field public static final int TRANSPORT_BLUETOOTH = 2; // 0x2
360    field public static final int TRANSPORT_CELLULAR = 0; // 0x0
361    field public static final int TRANSPORT_ETHERNET = 3; // 0x3
362    field public static final int TRANSPORT_LOWPAN = 6; // 0x6
363    field public static final int TRANSPORT_THREAD = 9; // 0x9
364    field public static final int TRANSPORT_USB = 8; // 0x8
365    field public static final int TRANSPORT_VPN = 4; // 0x4
366    field public static final int TRANSPORT_WIFI = 1; // 0x1
367    field public static final int TRANSPORT_WIFI_AWARE = 5; // 0x5
368  }
369
370  @Deprecated public class NetworkInfo implements android.os.Parcelable {
371    ctor @Deprecated public NetworkInfo(int, int, @Nullable String, @Nullable String);
372    method @Deprecated public int describeContents();
373    method @Deprecated @NonNull public android.net.NetworkInfo.DetailedState getDetailedState();
374    method @Deprecated public String getExtraInfo();
375    method @Deprecated public String getReason();
376    method @Deprecated public android.net.NetworkInfo.State getState();
377    method @Deprecated public int getSubtype();
378    method @Deprecated public String getSubtypeName();
379    method @Deprecated public int getType();
380    method @Deprecated public String getTypeName();
381    method @Deprecated public boolean isAvailable();
382    method @Deprecated public boolean isConnected();
383    method @Deprecated public boolean isConnectedOrConnecting();
384    method @Deprecated public boolean isFailover();
385    method @Deprecated public boolean isRoaming();
386    method @Deprecated public void setDetailedState(@NonNull android.net.NetworkInfo.DetailedState, @Nullable String, @Nullable String);
387    method @Deprecated public void writeToParcel(android.os.Parcel, int);
388    field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
389  }
390
391  @Deprecated public enum NetworkInfo.DetailedState {
392    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
393    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState BLOCKED;
394    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CAPTIVE_PORTAL_CHECK;
395    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTED;
396    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState CONNECTING;
397    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTED;
398    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState DISCONNECTING;
399    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState FAILED;
400    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState IDLE;
401    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState OBTAINING_IPADDR;
402    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SCANNING;
403    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState SUSPENDED;
404    enum_constant @Deprecated public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
405  }
406
407  @Deprecated public enum NetworkInfo.State {
408    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTED;
409    enum_constant @Deprecated public static final android.net.NetworkInfo.State CONNECTING;
410    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTED;
411    enum_constant @Deprecated public static final android.net.NetworkInfo.State DISCONNECTING;
412    enum_constant @Deprecated public static final android.net.NetworkInfo.State SUSPENDED;
413    enum_constant @Deprecated public static final android.net.NetworkInfo.State UNKNOWN;
414  }
415
416  public class NetworkRequest implements android.os.Parcelable {
417    method public boolean canBeSatisfiedBy(@Nullable android.net.NetworkCapabilities);
418    method public int describeContents();
419    method @NonNull public int[] getCapabilities();
420    method @Nullable public android.net.NetworkSpecifier getNetworkSpecifier();
421    method @NonNull public int[] getTransportTypes();
422    method public boolean hasCapability(int);
423    method public boolean hasTransport(int);
424    method public void writeToParcel(android.os.Parcel, int);
425    field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkRequest> CREATOR;
426  }
427
428  public static class NetworkRequest.Builder {
429    ctor public NetworkRequest.Builder();
430    ctor public NetworkRequest.Builder(@NonNull android.net.NetworkRequest);
431    method public android.net.NetworkRequest.Builder addCapability(int);
432    method public android.net.NetworkRequest.Builder addTransportType(int);
433    method public android.net.NetworkRequest build();
434    method @NonNull public android.net.NetworkRequest.Builder clearCapabilities();
435    method public android.net.NetworkRequest.Builder removeCapability(int);
436    method public android.net.NetworkRequest.Builder removeTransportType(int);
437    method @NonNull public android.net.NetworkRequest.Builder setIncludeOtherUidNetworks(boolean);
438    method @Deprecated public android.net.NetworkRequest.Builder setNetworkSpecifier(String);
439    method public android.net.NetworkRequest.Builder setNetworkSpecifier(android.net.NetworkSpecifier);
440  }
441
442  public class ParseException extends java.lang.RuntimeException {
443    ctor public ParseException(@NonNull String);
444    ctor public ParseException(@NonNull String, @NonNull Throwable);
445    field public String response;
446  }
447
448  public class ProxyInfo implements android.os.Parcelable {
449    ctor public ProxyInfo(@Nullable android.net.ProxyInfo);
450    method public static android.net.ProxyInfo buildDirectProxy(String, int);
451    method public static android.net.ProxyInfo buildDirectProxy(String, int, java.util.List<java.lang.String>);
452    method public static android.net.ProxyInfo buildPacProxy(android.net.Uri);
453    method @NonNull public static android.net.ProxyInfo buildPacProxy(@NonNull android.net.Uri, int);
454    method public int describeContents();
455    method public String[] getExclusionList();
456    method public String getHost();
457    method public android.net.Uri getPacFileUrl();
458    method public int getPort();
459    method public boolean isValid();
460    method public void writeToParcel(android.os.Parcel, int);
461    field @NonNull public static final android.os.Parcelable.Creator<android.net.ProxyInfo> CREATOR;
462  }
463
464  public final class RouteInfo implements android.os.Parcelable {
465    method public int describeContents();
466    method @NonNull public android.net.IpPrefix getDestination();
467    method @Nullable public java.net.InetAddress getGateway();
468    method @Nullable public String getInterface();
469    method public int getType();
470    method public boolean hasGateway();
471    method public boolean isDefaultRoute();
472    method public boolean matches(java.net.InetAddress);
473    method public void writeToParcel(android.os.Parcel, int);
474    field @NonNull public static final android.os.Parcelable.Creator<android.net.RouteInfo> CREATOR;
475    field public static final int RTN_THROW = 9; // 0x9
476    field public static final int RTN_UNICAST = 1; // 0x1
477    field public static final int RTN_UNREACHABLE = 7; // 0x7
478  }
479
480  public abstract class SocketKeepalive implements java.lang.AutoCloseable {
481    method public final void close();
482    method public final void start(@IntRange(from=0xa, to=0xe10) int);
483    method public final void stop();
484    field public static final int ERROR_HARDWARE_ERROR = -31; // 0xffffffe1
485    field public static final int ERROR_INSUFFICIENT_RESOURCES = -32; // 0xffffffe0
486    field public static final int ERROR_INVALID_INTERVAL = -24; // 0xffffffe8
487    field public static final int ERROR_INVALID_IP_ADDRESS = -21; // 0xffffffeb
488    field public static final int ERROR_INVALID_LENGTH = -23; // 0xffffffe9
489    field public static final int ERROR_INVALID_NETWORK = -20; // 0xffffffec
490    field public static final int ERROR_INVALID_PORT = -22; // 0xffffffea
491    field public static final int ERROR_INVALID_SOCKET = -25; // 0xffffffe7
492    field public static final int ERROR_SOCKET_NOT_IDLE = -26; // 0xffffffe6
493    field public static final int ERROR_UNSUPPORTED = -30; // 0xffffffe2
494  }
495
496  public static class SocketKeepalive.Callback {
497    ctor public SocketKeepalive.Callback();
498    method public void onDataReceived();
499    method public void onError(int);
500    method public void onStarted();
501    method public void onStopped();
502  }
503
504  public final class StaticIpConfiguration implements android.os.Parcelable {
505    method public int describeContents();
506    method @NonNull public java.util.List<java.net.InetAddress> getDnsServers();
507    method @Nullable public String getDomains();
508    method @Nullable public java.net.InetAddress getGateway();
509    method @NonNull public android.net.LinkAddress getIpAddress();
510    method public void writeToParcel(@NonNull android.os.Parcel, int);
511    field @NonNull public static final android.os.Parcelable.Creator<android.net.StaticIpConfiguration> CREATOR;
512  }
513
514  public static final class StaticIpConfiguration.Builder {
515    ctor public StaticIpConfiguration.Builder();
516    method @NonNull public android.net.StaticIpConfiguration build();
517    method @NonNull public android.net.StaticIpConfiguration.Builder setDnsServers(@NonNull Iterable<java.net.InetAddress>);
518    method @NonNull public android.net.StaticIpConfiguration.Builder setDomains(@Nullable String);
519    method @NonNull public android.net.StaticIpConfiguration.Builder setGateway(@Nullable java.net.InetAddress);
520    method @NonNull public android.net.StaticIpConfiguration.Builder setIpAddress(@NonNull android.net.LinkAddress);
521  }
522
523  public interface TransportInfo {
524  }
525
526}
527
528package android.net.http {
529
530  public abstract class BidirectionalStream {
531    ctor public BidirectionalStream();
532    method public abstract void cancel();
533    method public abstract void flush();
534    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
535    method @NonNull public abstract String getHttpMethod();
536    method public abstract int getPriority();
537    method public abstract int getTrafficStatsTag();
538    method public abstract int getTrafficStatsUid();
539    method public abstract boolean hasTrafficStatsTag();
540    method public abstract boolean hasTrafficStatsUid();
541    method public abstract boolean isDelayRequestHeadersUntilFirstFlushEnabled();
542    method public abstract boolean isDone();
543    method public abstract void read(@NonNull java.nio.ByteBuffer);
544    method public abstract void start();
545    method public abstract void write(@NonNull java.nio.ByteBuffer, boolean);
546    field public static final int STREAM_PRIORITY_HIGHEST = 4; // 0x4
547    field public static final int STREAM_PRIORITY_IDLE = 0; // 0x0
548    field public static final int STREAM_PRIORITY_LOW = 2; // 0x2
549    field public static final int STREAM_PRIORITY_LOWEST = 1; // 0x1
550    field public static final int STREAM_PRIORITY_MEDIUM = 3; // 0x3
551  }
552
553  public abstract static class BidirectionalStream.Builder {
554    ctor public BidirectionalStream.Builder();
555    method @NonNull public abstract android.net.http.BidirectionalStream.Builder addHeader(@NonNull String, @NonNull String);
556    method @NonNull public abstract android.net.http.BidirectionalStream build();
557    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setDelayRequestHeadersUntilFirstFlushEnabled(boolean);
558    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setHttpMethod(@NonNull String);
559    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setPriority(int);
560    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setTrafficStatsTag(int);
561    method @NonNull public abstract android.net.http.BidirectionalStream.Builder setTrafficStatsUid(int);
562  }
563
564  public static interface BidirectionalStream.Callback {
565    method public void onCanceled(@NonNull android.net.http.BidirectionalStream, @Nullable android.net.http.UrlResponseInfo);
566    method public void onFailed(@NonNull android.net.http.BidirectionalStream, @Nullable android.net.http.UrlResponseInfo, @NonNull android.net.http.HttpException);
567    method public void onReadCompleted(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer, boolean);
568    method public void onResponseHeadersReceived(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo);
569    method public void onResponseTrailersReceived(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull android.net.http.HeaderBlock);
570    method public void onStreamReady(@NonNull android.net.http.BidirectionalStream);
571    method public void onSucceeded(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo);
572    method public void onWriteCompleted(@NonNull android.net.http.BidirectionalStream, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer, boolean);
573  }
574
575  public abstract class CallbackException extends android.net.http.HttpException {
576    ctor protected CallbackException(@Nullable String, @Nullable Throwable);
577  }
578
579  public class ConnectionMigrationOptions {
580    method public int getAllowNonDefaultNetworkUsage();
581    method public int getDefaultNetworkMigration();
582    method public int getPathDegradationMigration();
583    field public static final int MIGRATION_OPTION_DISABLED = 2; // 0x2
584    field public static final int MIGRATION_OPTION_ENABLED = 1; // 0x1
585    field public static final int MIGRATION_OPTION_UNSPECIFIED = 0; // 0x0
586  }
587
588  public static final class ConnectionMigrationOptions.Builder {
589    ctor public ConnectionMigrationOptions.Builder();
590    method @NonNull public android.net.http.ConnectionMigrationOptions build();
591    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setAllowNonDefaultNetworkUsage(int);
592    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setDefaultNetworkMigration(int);
593    method @NonNull public android.net.http.ConnectionMigrationOptions.Builder setPathDegradationMigration(int);
594  }
595
596  public final class DnsOptions {
597    method public int getPersistHostCache();
598    method @Nullable public java.time.Duration getPersistHostCachePeriod();
599    method public int getPreestablishConnectionsToStaleDnsResults();
600    method public int getStaleDns();
601    method @Nullable public android.net.http.DnsOptions.StaleDnsOptions getStaleDnsOptions();
602    method public int getUseHttpStackDnsResolver();
603    field public static final int DNS_OPTION_DISABLED = 2; // 0x2
604    field public static final int DNS_OPTION_ENABLED = 1; // 0x1
605    field public static final int DNS_OPTION_UNSPECIFIED = 0; // 0x0
606  }
607
608  public static final class DnsOptions.Builder {
609    ctor public DnsOptions.Builder();
610    method @NonNull public android.net.http.DnsOptions build();
611    method @NonNull public android.net.http.DnsOptions.Builder setPersistHostCache(int);
612    method @NonNull public android.net.http.DnsOptions.Builder setPersistHostCachePeriod(@NonNull java.time.Duration);
613    method @NonNull public android.net.http.DnsOptions.Builder setPreestablishConnectionsToStaleDnsResults(int);
614    method @NonNull public android.net.http.DnsOptions.Builder setStaleDns(int);
615    method @NonNull public android.net.http.DnsOptions.Builder setStaleDnsOptions(@NonNull android.net.http.DnsOptions.StaleDnsOptions);
616    method @NonNull public android.net.http.DnsOptions.Builder setUseHttpStackDnsResolver(int);
617  }
618
619  public static class DnsOptions.StaleDnsOptions {
620    method public int getAllowCrossNetworkUsage();
621    method @Nullable public java.time.Duration getFreshLookupTimeout();
622    method @Nullable public java.time.Duration getMaxExpiredDelay();
623    method public int getUseStaleOnNameNotResolved();
624  }
625
626  public static final class DnsOptions.StaleDnsOptions.Builder {
627    ctor public DnsOptions.StaleDnsOptions.Builder();
628    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions build();
629    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setAllowCrossNetworkUsage(int);
630    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setFreshLookupTimeout(@NonNull java.time.Duration);
631    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setMaxExpiredDelay(@NonNull java.time.Duration);
632    method @NonNull public android.net.http.DnsOptions.StaleDnsOptions.Builder setUseStaleOnNameNotResolved(int);
633  }
634
635  public abstract class HeaderBlock {
636    ctor public HeaderBlock();
637    method @NonNull public abstract java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> getAsList();
638    method @NonNull public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAsMap();
639  }
640
641  public abstract class HttpEngine {
642    method public void bindToNetwork(@Nullable android.net.Network);
643    method @NonNull public abstract java.net.URLStreamHandlerFactory createUrlStreamHandlerFactory();
644    method @NonNull public static String getVersionString();
645    method @NonNull public abstract android.net.http.BidirectionalStream.Builder newBidirectionalStreamBuilder(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.http.BidirectionalStream.Callback);
646    method @NonNull public abstract android.net.http.UrlRequest.Builder newUrlRequestBuilder(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.http.UrlRequest.Callback);
647    method @NonNull public abstract java.net.URLConnection openConnection(@NonNull java.net.URL) throws java.io.IOException;
648    method public abstract void shutdown();
649  }
650
651  public static class HttpEngine.Builder {
652    ctor public HttpEngine.Builder(@NonNull android.content.Context);
653    method @NonNull public android.net.http.HttpEngine.Builder addPublicKeyPins(@NonNull String, @NonNull java.util.Set<byte[]>, boolean, @NonNull java.time.Instant);
654    method @NonNull public android.net.http.HttpEngine.Builder addQuicHint(@NonNull String, int, int);
655    method @NonNull public android.net.http.HttpEngine build();
656    method @NonNull public String getDefaultUserAgent();
657    method @NonNull public android.net.http.HttpEngine.Builder setConnectionMigrationOptions(@NonNull android.net.http.ConnectionMigrationOptions);
658    method @NonNull public android.net.http.HttpEngine.Builder setDnsOptions(@NonNull android.net.http.DnsOptions);
659    method @NonNull public android.net.http.HttpEngine.Builder setEnableBrotli(boolean);
660    method @NonNull public android.net.http.HttpEngine.Builder setEnableHttp2(boolean);
661    method @NonNull public android.net.http.HttpEngine.Builder setEnableHttpCache(int, long);
662    method @NonNull public android.net.http.HttpEngine.Builder setEnablePublicKeyPinningBypassForLocalTrustAnchors(boolean);
663    method @NonNull public android.net.http.HttpEngine.Builder setEnableQuic(boolean);
664    method @NonNull public android.net.http.HttpEngine.Builder setQuicOptions(@NonNull android.net.http.QuicOptions);
665    method @NonNull public android.net.http.HttpEngine.Builder setStoragePath(@NonNull String);
666    method @NonNull public android.net.http.HttpEngine.Builder setUserAgent(@NonNull String);
667    field public static final int HTTP_CACHE_DISABLED = 0; // 0x0
668    field public static final int HTTP_CACHE_DISK = 3; // 0x3
669    field public static final int HTTP_CACHE_DISK_NO_HTTP = 2; // 0x2
670    field public static final int HTTP_CACHE_IN_MEMORY = 1; // 0x1
671  }
672
673  public class HttpException extends java.io.IOException {
674    ctor public HttpException(@Nullable String, @Nullable Throwable);
675  }
676
677  public final class InlineExecutionProhibitedException extends java.util.concurrent.RejectedExecutionException {
678    ctor public InlineExecutionProhibitedException();
679  }
680
681  public abstract class NetworkException extends android.net.http.HttpException {
682    ctor public NetworkException(@Nullable String, @Nullable Throwable);
683    method public abstract int getErrorCode();
684    method public abstract boolean isImmediatelyRetryable();
685    field public static final int ERROR_ADDRESS_UNREACHABLE = 9; // 0x9
686    field public static final int ERROR_CONNECTION_CLOSED = 5; // 0x5
687    field public static final int ERROR_CONNECTION_REFUSED = 7; // 0x7
688    field public static final int ERROR_CONNECTION_RESET = 8; // 0x8
689    field public static final int ERROR_CONNECTION_TIMED_OUT = 6; // 0x6
690    field public static final int ERROR_HOSTNAME_NOT_RESOLVED = 1; // 0x1
691    field public static final int ERROR_INTERNET_DISCONNECTED = 2; // 0x2
692    field public static final int ERROR_NETWORK_CHANGED = 3; // 0x3
693    field public static final int ERROR_OTHER = 11; // 0xb
694    field public static final int ERROR_QUIC_PROTOCOL_FAILED = 10; // 0xa
695    field public static final int ERROR_TIMED_OUT = 4; // 0x4
696  }
697
698  public abstract class QuicException extends android.net.http.NetworkException {
699    ctor protected QuicException(@Nullable String, @Nullable Throwable);
700  }
701
702  public class QuicOptions {
703    method @NonNull public java.util.Set<java.lang.String> getAllowedQuicHosts();
704    method @Nullable public String getHandshakeUserAgent();
705    method @Nullable public java.time.Duration getIdleConnectionTimeout();
706    method public int getInMemoryServerConfigsCacheSize();
707    method public boolean hasInMemoryServerConfigsCacheSize();
708  }
709
710  public static final class QuicOptions.Builder {
711    ctor public QuicOptions.Builder();
712    method @NonNull public android.net.http.QuicOptions.Builder addAllowedQuicHost(@NonNull String);
713    method @NonNull public android.net.http.QuicOptions build();
714    method @NonNull public android.net.http.QuicOptions.Builder setHandshakeUserAgent(@NonNull String);
715    method @NonNull public android.net.http.QuicOptions.Builder setIdleConnectionTimeout(@NonNull java.time.Duration);
716    method @NonNull public android.net.http.QuicOptions.Builder setInMemoryServerConfigsCacheSize(int);
717  }
718
719  public abstract class UploadDataProvider implements java.io.Closeable {
720    ctor public UploadDataProvider();
721    method public void close() throws java.io.IOException;
722    method public abstract long getLength() throws java.io.IOException;
723    method public abstract void read(@NonNull android.net.http.UploadDataSink, @NonNull java.nio.ByteBuffer) throws java.io.IOException;
724    method public abstract void rewind(@NonNull android.net.http.UploadDataSink) throws java.io.IOException;
725  }
726
727  public abstract class UploadDataSink {
728    ctor public UploadDataSink();
729    method public abstract void onReadError(@NonNull Exception);
730    method public abstract void onReadSucceeded(boolean);
731    method public abstract void onRewindError(@NonNull Exception);
732    method public abstract void onRewindSucceeded();
733  }
734
735  public abstract class UrlRequest {
736    method public abstract void cancel();
737    method public abstract void followRedirect();
738    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
739    method @Nullable public abstract String getHttpMethod();
740    method public abstract int getPriority();
741    method public abstract void getStatus(@NonNull android.net.http.UrlRequest.StatusListener);
742    method public abstract int getTrafficStatsTag();
743    method public abstract int getTrafficStatsUid();
744    method public abstract boolean hasTrafficStatsTag();
745    method public abstract boolean hasTrafficStatsUid();
746    method public abstract boolean isCacheDisabled();
747    method public abstract boolean isDirectExecutorAllowed();
748    method public abstract boolean isDone();
749    method public abstract void read(@NonNull java.nio.ByteBuffer);
750    method public abstract void start();
751    field public static final int REQUEST_PRIORITY_HIGHEST = 4; // 0x4
752    field public static final int REQUEST_PRIORITY_IDLE = 0; // 0x0
753    field public static final int REQUEST_PRIORITY_LOW = 2; // 0x2
754    field public static final int REQUEST_PRIORITY_LOWEST = 1; // 0x1
755    field public static final int REQUEST_PRIORITY_MEDIUM = 3; // 0x3
756  }
757
758  public abstract static class UrlRequest.Builder {
759    method @NonNull public abstract android.net.http.UrlRequest.Builder addHeader(@NonNull String, @NonNull String);
760    method @NonNull public abstract android.net.http.UrlRequest.Builder bindToNetwork(@Nullable android.net.Network);
761    method @NonNull public abstract android.net.http.UrlRequest build();
762    method @NonNull public abstract android.net.http.UrlRequest.Builder setCacheDisabled(boolean);
763    method @NonNull public abstract android.net.http.UrlRequest.Builder setDirectExecutorAllowed(boolean);
764    method @NonNull public abstract android.net.http.UrlRequest.Builder setHttpMethod(@NonNull String);
765    method @NonNull public abstract android.net.http.UrlRequest.Builder setPriority(int);
766    method @NonNull public abstract android.net.http.UrlRequest.Builder setTrafficStatsTag(int);
767    method @NonNull public abstract android.net.http.UrlRequest.Builder setTrafficStatsUid(int);
768    method @NonNull public abstract android.net.http.UrlRequest.Builder setUploadDataProvider(@NonNull android.net.http.UploadDataProvider, @NonNull java.util.concurrent.Executor);
769  }
770
771  public static interface UrlRequest.Callback {
772    method public void onCanceled(@NonNull android.net.http.UrlRequest, @Nullable android.net.http.UrlResponseInfo);
773    method public void onFailed(@NonNull android.net.http.UrlRequest, @Nullable android.net.http.UrlResponseInfo, @NonNull android.net.http.HttpException);
774    method public void onReadCompleted(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo, @NonNull java.nio.ByteBuffer) throws java.lang.Exception;
775    method public void onRedirectReceived(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo, @NonNull String) throws java.lang.Exception;
776    method public void onResponseStarted(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo) throws java.lang.Exception;
777    method public void onSucceeded(@NonNull android.net.http.UrlRequest, @NonNull android.net.http.UrlResponseInfo);
778  }
779
780  public static class UrlRequest.Status {
781    field public static final int CONNECTING = 10; // 0xa
782    field public static final int DOWNLOADING_PAC_FILE = 5; // 0x5
783    field public static final int ESTABLISHING_PROXY_TUNNEL = 8; // 0x8
784    field public static final int IDLE = 0; // 0x0
785    field public static final int INVALID = -1; // 0xffffffff
786    field public static final int READING_RESPONSE = 14; // 0xe
787    field public static final int RESOLVING_HOST = 9; // 0x9
788    field public static final int RESOLVING_HOST_IN_PAC_FILE = 7; // 0x7
789    field public static final int RESOLVING_PROXY_FOR_URL = 6; // 0x6
790    field public static final int SENDING_REQUEST = 12; // 0xc
791    field public static final int SSL_HANDSHAKE = 11; // 0xb
792    field public static final int WAITING_FOR_AVAILABLE_SOCKET = 2; // 0x2
793    field public static final int WAITING_FOR_CACHE = 4; // 0x4
794    field public static final int WAITING_FOR_DELEGATE = 3; // 0x3
795    field public static final int WAITING_FOR_RESPONSE = 13; // 0xd
796    field public static final int WAITING_FOR_STALLED_SOCKET_POOL = 1; // 0x1
797  }
798
799  public static interface UrlRequest.StatusListener {
800    method public void onStatus(int);
801  }
802
803  public abstract class UrlResponseInfo {
804    ctor public UrlResponseInfo();
805    method @NonNull public abstract android.net.http.HeaderBlock getHeaders();
806    method public abstract int getHttpStatusCode();
807    method @NonNull public abstract String getHttpStatusText();
808    method @NonNull public abstract String getNegotiatedProtocol();
809    method public abstract long getReceivedByteCount();
810    method @NonNull public abstract String getUrl();
811    method @NonNull public abstract java.util.List<java.lang.String> getUrlChain();
812    method public abstract boolean wasCached();
813  }
814
815}
816
817