blob: f2f5c1b7f7f7473d9d9cc4b1b9bbd9cb2f80ab8a [file] [log] [blame]
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +09001// Signature format: 2.0
2package android.net {
3
4 public final class ConnectivityFrameworkInitializer {
5 method public static void registerServiceWrappers();
6 }
7
8 public class ConnectivityManager {
Chiachang Wangf9294e72021-03-18 09:44:34 +08009 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void factoryReset();
junyulaib1211372021-03-03 12:09:05 +080010 method @NonNull @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public java.util.List<android.net.NetworkStateSnapshot> getAllNetworkStateSnapshot();
Chiachang Wangf9294e72021-03-18 09:44:34 +080011 method @Nullable public android.net.ProxyInfo getGlobalProxy();
lucaslin5cdbcfb2021-03-12 00:46:33 +080012 method @NonNull public static android.util.Range<java.lang.Integer> getIpSecNetIdRange();
lucasline2cd02d2021-03-16 17:11:14 +080013 method @NonNull public static String getPrivateDnsMode(@NonNull android.content.Context);
Lorenzo Colittib90bdbd2021-03-22 18:23:21 +090014 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerDefaultNetworkCallbackAsUid(int, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090015 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerSystemDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
junyulaidbb70462021-03-09 20:49:48 +080016 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void requestBackgroundNetwork(@NonNull android.net.NetworkRequest, @NonNull android.os.Handler, @NonNull android.net.ConnectivityManager.NetworkCallback);
lucaslin29278ee2021-03-22 11:51:27 +080017 method @Deprecated public boolean requestRouteToHostAddress(int, java.net.InetAddress);
Chiachang Wangf9294e72021-03-18 09:44:34 +080018 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setAcceptPartialConnectivity(@NonNull android.net.Network, boolean, boolean);
19 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setAcceptUnvalidated(@NonNull android.net.Network, boolean, boolean);
20 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setAvoidUnvalidated(@NonNull android.net.Network);
21 method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setGlobalProxy(@Nullable android.net.ProxyInfo);
lucaslin29278ee2021-03-22 11:51:27 +080022 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void setLegacyLockdownVpnEnabled(boolean);
paulhu6865eb62021-03-25 12:36:56 +080023 method public static void setPrivateDnsMode(@NonNull android.content.Context, @NonNull String);
Chalard Jean0a4aefc2021-03-03 16:37:13 +090024 method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setProfileNetworkPreference(@NonNull android.os.UserHandle, int, @Nullable java.util.concurrent.Executor, @Nullable Runnable);
lucaslin29278ee2021-03-22 11:51:27 +080025 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void setRequireVpnForUids(boolean, @NonNull java.util.Collection<android.util.Range<java.lang.Integer>>);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090026 method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_TEST_NETWORKS, android.Manifest.permission.NETWORK_STACK}) public void simulateDataStall(int, long, @NonNull android.net.Network, @NonNull android.os.PersistableBundle);
Remi NGUYEN VAN8238a762021-03-16 18:06:06 +090027 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void startCaptivePortalApp(@NonNull android.net.Network);
lucaslin10774b72021-03-17 14:16:01 +080028 method public void systemReady();
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000029 field public static final int BLOCKED_METERED_REASON_ADMIN_DISABLED = 262144; // 0x40000
30 field public static final int BLOCKED_METERED_REASON_DATA_SAVER = 65536; // 0x10000
Lorenzo Colitti8ad58122021-03-18 00:54:57 +090031 field public static final int BLOCKED_METERED_REASON_MASK = -65536; // 0xffff0000
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000032 field public static final int BLOCKED_METERED_REASON_USER_RESTRICTED = 131072; // 0x20000
33 field public static final int BLOCKED_REASON_APP_STANDBY = 4; // 0x4
34 field public static final int BLOCKED_REASON_BATTERY_SAVER = 1; // 0x1
35 field public static final int BLOCKED_REASON_DOZE = 2; // 0x2
Lorenzo Colitti8ad58122021-03-18 00:54:57 +090036 field public static final int BLOCKED_REASON_LOCKDOWN_VPN = 16; // 0x10
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000037 field public static final int BLOCKED_REASON_NONE = 0; // 0x0
38 field public static final int BLOCKED_REASON_RESTRICTED_MODE = 8; // 0x8
lucaslin889dcda2021-03-12 17:56:09 +080039 field public static final String PRIVATE_DNS_MODE_OFF = "off";
40 field public static final String PRIVATE_DNS_MODE_OPPORTUNISTIC = "opportunistic";
41 field public static final String PRIVATE_DNS_MODE_PROVIDER_HOSTNAME = "hostname";
Chalard Jeanbef6b092021-03-17 14:33:24 +090042 field public static final int PROFILE_NETWORK_PREFERENCE_DEFAULT = 0; // 0x0
43 field public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE = 1; // 0x1
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090044 }
45
Lorenzo Colitti8ad58122021-03-18 00:54:57 +090046 public static class ConnectivityManager.NetworkCallback {
47 method public void onBlockedStatusChanged(@NonNull android.net.Network, int);
48 }
49
paulhu94430952021-03-23 00:24:50 +080050 public class ConnectivitySettingsManager {
51 method public static void clearGlobalProxy(@NonNull android.content.Context);
52 method @Nullable public static String getCaptivePortalHttpUrl(@NonNull android.content.Context);
53 method public static int getCaptivePortalMode(@NonNull android.content.Context, int);
54 method @NonNull public static java.time.Duration getConnectivityKeepPendingIntentDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
55 method @NonNull public static android.util.Range<java.lang.Integer> getDnsResolverSampleRanges(@NonNull android.content.Context);
56 method @NonNull public static java.time.Duration getDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
57 method public static int getDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, int);
58 method @Nullable public static android.net.ProxyInfo getGlobalProxy(@NonNull android.content.Context);
59 method @NonNull public static java.time.Duration getMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
60 method public static boolean getMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
paulhu7a4eeed2021-03-25 13:17:58 +080061 method @Nullable public static String getMobileDataPreferredApps(@NonNull android.content.Context);
paulhu94430952021-03-23 00:24:50 +080062 method public static int getNetworkAvoidBadWifi(@NonNull android.content.Context);
63 method @Nullable public static String getNetworkMeteredMultipathPreference(@NonNull android.content.Context);
64 method public static int getNetworkSwitchNotificationMaximumDailyCount(@NonNull android.content.Context, int);
65 method @NonNull public static java.time.Duration getNetworkSwitchNotificationRateDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
66 method @NonNull public static String getPrivateDnsDefaultMode(@NonNull android.content.Context);
67 method @Nullable public static String getPrivateDnsHostname(@NonNull android.content.Context);
68 method public static boolean getWifiAlwaysRequested(@NonNull android.content.Context, boolean);
69 method @NonNull public static java.time.Duration getWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
70 method public static void setCaptivePortalHttpUrl(@NonNull android.content.Context, @Nullable String);
71 method public static void setCaptivePortalMode(@NonNull android.content.Context, int);
72 method public static void setConnectivityKeepPendingIntentDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
73 method public static void setDnsResolverSampleRanges(@NonNull android.content.Context, @NonNull android.util.Range<java.lang.Integer>);
74 method public static void setDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
75 method public static void setDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, @IntRange(from=0, to=100) int);
76 method public static void setGlobalProxy(@NonNull android.content.Context, @NonNull android.net.ProxyInfo);
77 method public static void setMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
78 method public static void setMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
paulhu7a4eeed2021-03-25 13:17:58 +080079 method public static void setMobileDataPreferredApps(@NonNull android.content.Context, @Nullable String);
paulhu94430952021-03-23 00:24:50 +080080 method public static void setNetworkAvoidBadWifi(@NonNull android.content.Context, int);
81 method public static void setNetworkMeteredMultipathPreference(@NonNull android.content.Context, @NonNull String);
82 method public static void setNetworkSwitchNotificationMaximumDailyCount(@NonNull android.content.Context, @IntRange(from=0) int);
83 method public static void setNetworkSwitchNotificationRateDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
84 method public static void setPrivateDnsDefaultMode(@NonNull android.content.Context, @NonNull String);
85 method public static void setPrivateDnsHostname(@NonNull android.content.Context, @Nullable String);
86 method public static void setWifiAlwaysRequested(@NonNull android.content.Context, boolean);
87 method public static void setWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
88 field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
89 field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
90 field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
91 field public static final int NETWORK_AVOID_BAD_WIFI_AVOID = 2; // 0x2
92 field public static final int NETWORK_AVOID_BAD_WIFI_IGNORE = 0; // 0x0
93 field public static final int NETWORK_AVOID_BAD_WIFI_PROMPT = 1; // 0x1
94 }
95
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090096 public final class NetworkAgentConfig implements android.os.Parcelable {
97 method @Nullable public String getSubscriberId();
lucaslin0e345e92021-03-22 15:07:41 +080098 method public boolean isBypassableVpn();
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090099 }
100
101 public static final class NetworkAgentConfig.Builder {
lucaslin0e345e92021-03-22 15:07:41 +0800102 method @NonNull public android.net.NetworkAgentConfig.Builder setBypassableVpn(boolean);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900103 method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
104 }
105
106 public final class NetworkCapabilities implements android.os.Parcelable {
Roshan Piuse2d28382021-02-23 08:47:39 -0800107 ctor public NetworkCapabilities(@Nullable android.net.NetworkCapabilities, long);
Chiachang Wang628cb112021-03-19 00:45:39 +0000108 method @Nullable public java.util.Set<android.util.Range<java.lang.Integer>> getUids();
junyulaib15b7db2021-03-16 10:24:43 +0800109 method public boolean hasUnwantedCapability(int);
Roshan Piuse2d28382021-02-23 08:47:39 -0800110 field public static final long REDACT_ALL = -1L; // 0xffffffffffffffffL
111 field public static final long REDACT_FOR_ACCESS_FINE_LOCATION = 1L; // 0x1L
112 field public static final long REDACT_FOR_LOCAL_MAC_ADDRESS = 2L; // 0x2L
113 field public static final long REDACT_FOR_NETWORK_SETTINGS = 4L; // 0x4L
114 field public static final long REDACT_NONE = 0L; // 0x0L
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900115 field public static final int TRANSPORT_TEST = 7; // 0x7
116 }
117
Chiachang Wang628cb112021-03-19 00:45:39 +0000118 public static final class NetworkCapabilities.Builder {
119 method @NonNull public android.net.NetworkCapabilities.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
120 }
121
junyulaib15b7db2021-03-16 10:24:43 +0800122 public class NetworkRequest implements android.os.Parcelable {
lifrb4dab372021-03-11 20:11:09 +0800123 method @NonNull public int[] getUnwantedCapabilities();
junyulaib15b7db2021-03-16 10:24:43 +0800124 method public boolean hasUnwantedCapability(int);
125 }
126
Chiachang Wang628cb112021-03-19 00:45:39 +0000127 public static class NetworkRequest.Builder {
junyulaib15b7db2021-03-16 10:24:43 +0800128 method @NonNull public android.net.NetworkRequest.Builder addUnwantedCapability(int);
129 method @NonNull public android.net.NetworkRequest.Builder removeUnwantedCapability(int);
Chiachang Wang628cb112021-03-19 00:45:39 +0000130 method @NonNull public android.net.NetworkRequest.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
131 }
132
Remi NGUYEN VAN25dcabf2021-03-15 10:20:40 +0900133 public class ParseException extends java.lang.RuntimeException {
134 ctor public ParseException(@NonNull String);
135 ctor public ParseException(@NonNull String, @NonNull Throwable);
136 }
137
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900138 public final class TcpRepairWindow {
139 ctor public TcpRepairWindow(int, int, int, int, int, int);
140 field public final int maxWindow;
141 field public final int rcvWnd;
142 field public final int rcvWndScale;
143 field public final int rcvWup;
144 field public final int sndWl1;
145 field public final int sndWnd;
146 }
147
148 public final class TestNetworkInterface implements android.os.Parcelable {
149 ctor public TestNetworkInterface(@NonNull android.os.ParcelFileDescriptor, @NonNull String);
150 method public int describeContents();
151 method @NonNull public android.os.ParcelFileDescriptor getFileDescriptor();
152 method @NonNull public String getInterfaceName();
153 method public void writeToParcel(@NonNull android.os.Parcel, int);
154 field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkInterface> CREATOR;
155 }
156
157 public class TestNetworkManager {
158 method @NonNull public android.net.TestNetworkInterface createTapInterface();
159 method @NonNull public android.net.TestNetworkInterface createTunInterface(@NonNull java.util.Collection<android.net.LinkAddress>);
160 method public void setupTestNetwork(@NonNull String, @NonNull android.os.IBinder);
161 method public void teardownTestNetwork(@NonNull android.net.Network);
162 field public static final String TEST_TAP_PREFIX = "testtap";
163 }
164
Remi NGUYEN VANea33ac92021-02-04 14:20:19 +0900165 public final class TestNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
166 ctor public TestNetworkSpecifier(@NonNull String);
167 method public int describeContents();
168 method @Nullable public String getInterfaceName();
169 method public void writeToParcel(@NonNull android.os.Parcel, int);
170 field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkSpecifier> CREATOR;
171 }
172
Roshan Piuse2d28382021-02-23 08:47:39 -0800173 public interface TransportInfo {
174 method public default long getApplicableRedactions();
175 method @NonNull public default android.net.TransportInfo makeCopy(long);
176 }
177
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900178 public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
lifr65b9f962021-03-24 18:38:37 +0800179 ctor public VpnTransportInfo(int, @Nullable String);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900180 method public int describeContents();
lifr65b9f962021-03-24 18:38:37 +0800181 method @NonNull public android.net.VpnTransportInfo makeCopy(long);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900182 method public void writeToParcel(@NonNull android.os.Parcel, int);
183 field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR;
lifr65b9f962021-03-24 18:38:37 +0800184 field @Nullable public final String sessionId;
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900185 field public final int type;
186 }
187
188}
189