blob: 7a0142a6f4f1b1b4a8073b3a5ff7f52b7bbea83b [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();
Aaron Huangda103b32021-04-17 13:46:25 +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> getAllNetworkStateSnapshots();
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();
Chiachang Wang9075ae32021-04-20 15:41:24 +080013 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void registerDefaultNetworkCallbackForUid(int, @NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +090014 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);
junyulai8c8ac362021-04-15 00:39:49 +080015 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.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
lucaslin29278ee2021-03-22 11:51:27 +080016 method @Deprecated public boolean requestRouteToHostAddress(int, java.net.InetAddress);
Chiachang Wangf9294e72021-03-18 09:44:34 +080017 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);
18 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);
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 setAvoidUnvalidated(@NonNull android.net.Network);
20 method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setGlobalProxy(@Nullable android.net.ProxyInfo);
lucaslin29278ee2021-03-22 11:51:27 +080021 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void setLegacyLockdownVpnEnabled(boolean);
Sooraj Sasindrane7aee272021-11-24 20:26:55 -080022 method @Deprecated @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setProfileNetworkPreference(@NonNull android.os.UserHandle, int, @Nullable java.util.concurrent.Executor, @Nullable Runnable);
23 method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setProfileNetworkPreferences(@NonNull android.os.UserHandle, @NonNull java.util.List<android.net.ProfileNetworkPreference>, @Nullable java.util.concurrent.Executor, @Nullable Runnable);
lucaslin29278ee2021-03-22 11:51:27 +080024 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 +090025 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 +090026 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 +080027 method public void systemReady();
paulhub49c8422021-04-07 16:18:13 +080028 field public static final String ACTION_CLEAR_DNS_CACHE = "android.net.action.CLEAR_DNS_CACHE";
lucaslind89b2982021-03-04 17:09:51 +080029 field public static final String ACTION_PROMPT_LOST_VALIDATION = "android.net.action.PROMPT_LOST_VALIDATION";
30 field public static final String ACTION_PROMPT_PARTIAL_CONNECTIVITY = "android.net.action.PROMPT_PARTIAL_CONNECTIVITY";
31 field public static final String ACTION_PROMPT_UNVALIDATED = "android.net.action.PROMPT_UNVALIDATED";
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000032 field public static final int BLOCKED_METERED_REASON_ADMIN_DISABLED = 262144; // 0x40000
33 field public static final int BLOCKED_METERED_REASON_DATA_SAVER = 65536; // 0x10000
Lorenzo Colitti8ad58122021-03-18 00:54:57 +090034 field public static final int BLOCKED_METERED_REASON_MASK = -65536; // 0xffff0000
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000035 field public static final int BLOCKED_METERED_REASON_USER_RESTRICTED = 131072; // 0x20000
36 field public static final int BLOCKED_REASON_APP_STANDBY = 4; // 0x4
37 field public static final int BLOCKED_REASON_BATTERY_SAVER = 1; // 0x1
38 field public static final int BLOCKED_REASON_DOZE = 2; // 0x2
Lorenzo Colitti8ad58122021-03-18 00:54:57 +090039 field public static final int BLOCKED_REASON_LOCKDOWN_VPN = 16; // 0x10
Sudheer Shankaf1520bb2021-03-23 08:12:28 +000040 field public static final int BLOCKED_REASON_NONE = 0; // 0x0
41 field public static final int BLOCKED_REASON_RESTRICTED_MODE = 8; // 0x8
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);
paulhu344c1162021-05-11 09:42:50 +080061 method @NonNull public static java.util.Set<java.lang.Integer> getMobileDataPreferredUids(@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);
lucaslin57f9ba82021-04-23 21:03:39 +080068 method public static int getPrivateDnsMode(@NonNull android.content.Context);
paulhu91e78062021-05-26 16:16:57 +080069 method @NonNull public static java.util.Set<java.lang.Integer> getUidsAllowedOnRestrictedNetworks(@NonNull android.content.Context);
paulhu94430952021-03-23 00:24:50 +080070 method public static boolean getWifiAlwaysRequested(@NonNull android.content.Context, boolean);
71 method @NonNull public static java.time.Duration getWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
72 method public static void setCaptivePortalHttpUrl(@NonNull android.content.Context, @Nullable String);
73 method public static void setCaptivePortalMode(@NonNull android.content.Context, int);
74 method public static void setConnectivityKeepPendingIntentDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
75 method public static void setDnsResolverSampleRanges(@NonNull android.content.Context, @NonNull android.util.Range<java.lang.Integer>);
76 method public static void setDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
77 method public static void setDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, @IntRange(from=0, to=100) int);
78 method public static void setGlobalProxy(@NonNull android.content.Context, @NonNull android.net.ProxyInfo);
79 method public static void setMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
80 method public static void setMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
paulhu344c1162021-05-11 09:42:50 +080081 method public static void setMobileDataPreferredUids(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
paulhu94430952021-03-23 00:24:50 +080082 method public static void setNetworkAvoidBadWifi(@NonNull android.content.Context, int);
83 method public static void setNetworkMeteredMultipathPreference(@NonNull android.content.Context, @NonNull String);
84 method public static void setNetworkSwitchNotificationMaximumDailyCount(@NonNull android.content.Context, @IntRange(from=0) int);
85 method public static void setNetworkSwitchNotificationRateDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
lucaslin57f9ba82021-04-23 21:03:39 +080086 method public static void setPrivateDnsDefaultMode(@NonNull android.content.Context, @NonNull int);
paulhu94430952021-03-23 00:24:50 +080087 method public static void setPrivateDnsHostname(@NonNull android.content.Context, @Nullable String);
lucaslin57f9ba82021-04-23 21:03:39 +080088 method public static void setPrivateDnsMode(@NonNull android.content.Context, int);
paulhu91e78062021-05-26 16:16:57 +080089 method public static void setUidsAllowedOnRestrictedNetworks(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
paulhu94430952021-03-23 00:24:50 +080090 method public static void setWifiAlwaysRequested(@NonNull android.content.Context, boolean);
91 method public static void setWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
92 field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
93 field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
94 field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
95 field public static final int NETWORK_AVOID_BAD_WIFI_AVOID = 2; // 0x2
96 field public static final int NETWORK_AVOID_BAD_WIFI_IGNORE = 0; // 0x0
97 field public static final int NETWORK_AVOID_BAD_WIFI_PROMPT = 1; // 0x1
lucaslin57f9ba82021-04-23 21:03:39 +080098 field public static final int PRIVATE_DNS_MODE_OFF = 1; // 0x1
99 field public static final int PRIVATE_DNS_MODE_OPPORTUNISTIC = 2; // 0x2
100 field public static final int PRIVATE_DNS_MODE_PROVIDER_HOSTNAME = 3; // 0x3
paulhu94430952021-03-23 00:24:50 +0800101 }
102
Mingguang Xu2d87c612021-10-29 00:18:55 -0700103 public final class DhcpOption implements android.os.Parcelable {
104 ctor public DhcpOption(byte, @Nullable byte[]);
105 method public int describeContents();
106 method public byte getType();
107 method @Nullable public byte[] getValue();
108 method public void writeToParcel(@NonNull android.os.Parcel, int);
109 field @NonNull public static final android.os.Parcelable.Creator<android.net.DhcpOption> CREATOR;
110 }
111
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900112 public final class NetworkAgentConfig implements android.os.Parcelable {
113 method @Nullable public String getSubscriberId();
lucaslin0e345e92021-03-22 15:07:41 +0800114 method public boolean isBypassableVpn();
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900115 }
116
117 public static final class NetworkAgentConfig.Builder {
lucaslin0e345e92021-03-22 15:07:41 +0800118 method @NonNull public android.net.NetworkAgentConfig.Builder setBypassableVpn(boolean);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900119 method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
120 }
121
122 public final class NetworkCapabilities implements android.os.Parcelable {
Chiachang Wang628cb112021-03-19 00:45:39 +0000123 method @Nullable public java.util.Set<android.util.Range<java.lang.Integer>> getUids();
Lorenzo Colitti395fafb2021-04-27 10:37:09 +0900124 method public boolean hasForbiddenCapability(int);
Sooraj Sasindran41969372021-12-10 11:31:19 -0800125 field public static final int NET_CAPABILITY_ENTERPRISE_SUB_LEVEL_1 = 1; // 0x1
126 field public static final int NET_CAPABILITY_ENTERPRISE_SUB_LEVEL_2 = 2; // 0x2
127 field public static final int NET_CAPABILITY_ENTERPRISE_SUB_LEVEL_3 = 3; // 0x3
128 field public static final int NET_CAPABILITY_ENTERPRISE_SUB_LEVEL_4 = 4; // 0x4
129 field public static final int NET_CAPABILITY_ENTERPRISE_SUB_LEVEL_5 = 5; // 0x5
Roshan Piuse2d28382021-02-23 08:47:39 -0800130 field public static final long REDACT_ALL = -1L; // 0xffffffffffffffffL
131 field public static final long REDACT_FOR_ACCESS_FINE_LOCATION = 1L; // 0x1L
132 field public static final long REDACT_FOR_LOCAL_MAC_ADDRESS = 2L; // 0x2L
133 field public static final long REDACT_FOR_NETWORK_SETTINGS = 4L; // 0x4L
134 field public static final long REDACT_NONE = 0L; // 0x0L
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900135 field public static final int TRANSPORT_TEST = 7; // 0x7
136 }
137
Chiachang Wang628cb112021-03-19 00:45:39 +0000138 public static final class NetworkCapabilities.Builder {
139 method @NonNull public android.net.NetworkCapabilities.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
140 }
141
junyulaib15b7db2021-03-16 10:24:43 +0800142 public class NetworkRequest implements android.os.Parcelable {
Lorenzo Colitti395fafb2021-04-27 10:37:09 +0900143 method @NonNull public int[] getForbiddenCapabilities();
144 method public boolean hasForbiddenCapability(int);
junyulaib15b7db2021-03-16 10:24:43 +0800145 }
146
Chiachang Wang628cb112021-03-19 00:45:39 +0000147 public static class NetworkRequest.Builder {
Lorenzo Colitti395fafb2021-04-27 10:37:09 +0900148 method @NonNull public android.net.NetworkRequest.Builder addForbiddenCapability(int);
149 method @NonNull public android.net.NetworkRequest.Builder removeForbiddenCapability(int);
Chiachang Wang628cb112021-03-19 00:45:39 +0000150 method @NonNull public android.net.NetworkRequest.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
151 }
152
Sooraj Sasindrane7aee272021-11-24 20:26:55 -0800153 public final class ProfileNetworkPreference implements android.os.Parcelable {
154 method public int describeContents();
155 method public int getPreference();
156 method public void writeToParcel(@NonNull android.os.Parcel, int);
157 field @NonNull public static final android.os.Parcelable.Creator<android.net.ProfileNetworkPreference> CREATOR;
158 }
159
160 public static final class ProfileNetworkPreference.Builder {
161 ctor public ProfileNetworkPreference.Builder();
162 method @NonNull public android.net.ProfileNetworkPreference build();
163 method @NonNull public android.net.ProfileNetworkPreference.Builder setPreference(int);
164 }
165
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900166 public final class TestNetworkInterface implements android.os.Parcelable {
167 ctor public TestNetworkInterface(@NonNull android.os.ParcelFileDescriptor, @NonNull String);
168 method public int describeContents();
169 method @NonNull public android.os.ParcelFileDescriptor getFileDescriptor();
170 method @NonNull public String getInterfaceName();
171 method public void writeToParcel(@NonNull android.os.Parcel, int);
172 field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkInterface> CREATOR;
173 }
174
175 public class TestNetworkManager {
Remi NGUYEN VANc5174c32021-04-08 16:08:46 +0900176 method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public android.net.TestNetworkInterface createTapInterface();
177 method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public android.net.TestNetworkInterface createTunInterface(@NonNull java.util.Collection<android.net.LinkAddress>);
178 method @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public void setupTestNetwork(@NonNull String, @NonNull android.os.IBinder);
179 method @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public void teardownTestNetwork(@NonNull android.net.Network);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900180 field public static final String TEST_TAP_PREFIX = "testtap";
181 }
182
Remi NGUYEN VANea33ac92021-02-04 14:20:19 +0900183 public final class TestNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
184 ctor public TestNetworkSpecifier(@NonNull String);
185 method public int describeContents();
186 method @Nullable public String getInterfaceName();
187 method public void writeToParcel(@NonNull android.os.Parcel, int);
188 field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkSpecifier> CREATOR;
189 }
190
Roshan Piuse2d28382021-02-23 08:47:39 -0800191 public interface TransportInfo {
192 method public default long getApplicableRedactions();
193 method @NonNull public default android.net.TransportInfo makeCopy(long);
194 }
195
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900196 public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
lifr65b9f962021-03-24 18:38:37 +0800197 ctor public VpnTransportInfo(int, @Nullable String);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900198 method public int describeContents();
Chiachang Wang9075ae32021-04-20 15:41:24 +0800199 method @Nullable public String getSessionId();
200 method public int getType();
lifr65b9f962021-03-24 18:38:37 +0800201 method @NonNull public android.net.VpnTransportInfo makeCopy(long);
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900202 method public void writeToParcel(@NonNull android.os.Parcel, int);
203 field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR;
Remi NGUYEN VANf15fc7f2021-01-28 13:37:03 +0900204 }
205
206}
207