// Signature format: 2.0
package android.net {

  public final class ConnectivityFrameworkInitializer {
    method public static void registerServiceWrappers();
  }

  public class ConnectivityManager {
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void addUidToMeteredNetworkAllowList(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void addUidToMeteredNetworkDenyList(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void factoryReset();
    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();
    method @Nullable public android.net.ProxyInfo getGlobalProxy();
    method @NonNull public static android.util.Range<java.lang.Integer> getIpSecNetIdRange();
    method @Nullable @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public android.net.LinkProperties getRedactedLinkPropertiesForPackage(@NonNull android.net.LinkProperties, int, @NonNull String);
    method @Nullable @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public android.net.NetworkCapabilities getRedactedNetworkCapabilitiesForPackage(@NonNull android.net.NetworkCapabilities, int, @NonNull String);
    method @FlaggedApi("com.android.net.flags.support_is_uid_networking_blocked") @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public boolean isUidNetworkingBlocked(int, boolean);
    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);
    method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD, android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS}) public void registerSystemDefaultNetworkCallback(@NonNull android.net.ConnectivityManager.NetworkCallback, @NonNull android.os.Handler);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void removeUidFromMeteredNetworkAllowList(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void removeUidFromMeteredNetworkDenyList(int);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void replaceFirewallChain(int, @NonNull int[]);
    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);
    method @Deprecated public boolean requestRouteToHostAddress(int, java.net.InetAddress);
    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);
    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);
    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);
    method @FlaggedApi("com.android.net.flags.set_data_saver_via_cm") @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setDataSaverEnabled(boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setFirewallChainEnabled(int, boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setGlobalProxy(@Nullable android.net.ProxyInfo);
    method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void setLegacyLockdownVpnEnabled(boolean);
    method @Deprecated @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setProfileNetworkPreference(@NonNull android.os.UserHandle, int, @Nullable java.util.concurrent.Executor, @Nullable Runnable);
    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);
    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>>);
    method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void setUidFirewallRule(int, int, int);
    method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.NETWORK_SETTINGS}) public void setVpnDefaultForUids(@NonNull String, @NonNull java.util.Collection<android.util.Range<java.lang.Integer>>);
    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);
    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);
    method public void systemReady();
    field public static final String ACTION_CLEAR_DNS_CACHE = "android.net.action.CLEAR_DNS_CACHE";
    field public static final String ACTION_PROMPT_LOST_VALIDATION = "android.net.action.PROMPT_LOST_VALIDATION";
    field public static final String ACTION_PROMPT_PARTIAL_CONNECTIVITY = "android.net.action.PROMPT_PARTIAL_CONNECTIVITY";
    field public static final String ACTION_PROMPT_UNVALIDATED = "android.net.action.PROMPT_UNVALIDATED";
    field public static final int BLOCKED_METERED_REASON_ADMIN_DISABLED = 262144; // 0x40000
    field public static final int BLOCKED_METERED_REASON_DATA_SAVER = 65536; // 0x10000
    field public static final int BLOCKED_METERED_REASON_MASK = -65536; // 0xffff0000
    field public static final int BLOCKED_METERED_REASON_USER_RESTRICTED = 131072; // 0x20000
    field @FlaggedApi("com.android.net.flags.basic_background_restrictions_enabled") public static final int BLOCKED_REASON_APP_BACKGROUND = 64; // 0x40
    field public static final int BLOCKED_REASON_APP_STANDBY = 4; // 0x4
    field public static final int BLOCKED_REASON_BATTERY_SAVER = 1; // 0x1
    field public static final int BLOCKED_REASON_DOZE = 2; // 0x2
    field public static final int BLOCKED_REASON_LOCKDOWN_VPN = 16; // 0x10
    field public static final int BLOCKED_REASON_LOW_POWER_STANDBY = 32; // 0x20
    field public static final int BLOCKED_REASON_NONE = 0; // 0x0
    field public static final int BLOCKED_REASON_RESTRICTED_MODE = 8; // 0x8
    field @FlaggedApi("com.android.net.flags.basic_background_restrictions_enabled") public static final int FIREWALL_CHAIN_BACKGROUND = 6; // 0x6
    field public static final int FIREWALL_CHAIN_DOZABLE = 1; // 0x1
    field public static final int FIREWALL_CHAIN_LOW_POWER_STANDBY = 5; // 0x5
    field public static final int FIREWALL_CHAIN_OEM_DENY_1 = 7; // 0x7
    field public static final int FIREWALL_CHAIN_OEM_DENY_2 = 8; // 0x8
    field public static final int FIREWALL_CHAIN_OEM_DENY_3 = 9; // 0x9
    field public static final int FIREWALL_CHAIN_POWERSAVE = 3; // 0x3
    field public static final int FIREWALL_CHAIN_RESTRICTED = 4; // 0x4
    field public static final int FIREWALL_CHAIN_STANDBY = 2; // 0x2
    field public static final int FIREWALL_RULE_ALLOW = 1; // 0x1
    field public static final int FIREWALL_RULE_DEFAULT = 0; // 0x0
    field public static final int FIREWALL_RULE_DENY = 2; // 0x2
    field public static final int PROFILE_NETWORK_PREFERENCE_DEFAULT = 0; // 0x0
    field public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE = 1; // 0x1
    field public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE_BLOCKING = 3; // 0x3
    field public static final int PROFILE_NETWORK_PREFERENCE_ENTERPRISE_NO_FALLBACK = 2; // 0x2
  }

  public static class ConnectivityManager.NetworkCallback {
    method public void onBlockedStatusChanged(@NonNull android.net.Network, int);
  }

  public class ConnectivitySettingsManager {
    method public static void clearGlobalProxy(@NonNull android.content.Context);
    method @Nullable public static String getCaptivePortalHttpUrl(@NonNull android.content.Context);
    method public static int getCaptivePortalMode(@NonNull android.content.Context, int);
    method @NonNull public static java.time.Duration getConnectivityKeepPendingIntentDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method @NonNull public static android.util.Range<java.lang.Integer> getDnsResolverSampleRanges(@NonNull android.content.Context);
    method @NonNull public static java.time.Duration getDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static int getDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, int);
    method @Nullable public static android.net.ProxyInfo getGlobalProxy(@NonNull android.content.Context);
    method public static long getIngressRateLimitInBytesPerSecond(@NonNull android.content.Context);
    method @NonNull public static java.time.Duration getMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static boolean getMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
    method @NonNull public static java.util.Set<java.lang.Integer> getMobileDataPreferredUids(@NonNull android.content.Context);
    method public static int getNetworkAvoidBadWifi(@NonNull android.content.Context);
    method @Nullable public static String getNetworkMeteredMultipathPreference(@NonNull android.content.Context);
    method public static int getNetworkSwitchNotificationMaximumDailyCount(@NonNull android.content.Context, int);
    method @NonNull public static java.time.Duration getNetworkSwitchNotificationRateDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method @NonNull public static String getPrivateDnsDefaultMode(@NonNull android.content.Context);
    method @Nullable public static String getPrivateDnsHostname(@NonNull android.content.Context);
    method public static int getPrivateDnsMode(@NonNull android.content.Context);
    method @NonNull public static java.util.Set<java.lang.Integer> getUidsAllowedOnRestrictedNetworks(@NonNull android.content.Context);
    method public static boolean getWifiAlwaysRequested(@NonNull android.content.Context, boolean);
    method @NonNull public static java.time.Duration getWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static void setCaptivePortalHttpUrl(@NonNull android.content.Context, @Nullable String);
    method public static void setCaptivePortalMode(@NonNull android.content.Context, int);
    method public static void setConnectivityKeepPendingIntentDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static void setDnsResolverSampleRanges(@NonNull android.content.Context, @NonNull android.util.Range<java.lang.Integer>);
    method public static void setDnsResolverSampleValidityDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static void setDnsResolverSuccessThresholdPercent(@NonNull android.content.Context, @IntRange(from=0, to=100) int);
    method public static void setGlobalProxy(@NonNull android.content.Context, @NonNull android.net.ProxyInfo);
    method public static void setIngressRateLimitInBytesPerSecond(@NonNull android.content.Context, @IntRange(from=-1L, to=4294967295L) long);
    method public static void setMobileDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static void setMobileDataAlwaysOn(@NonNull android.content.Context, boolean);
    method public static void setMobileDataPreferredUids(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
    method public static void setNetworkAvoidBadWifi(@NonNull android.content.Context, int);
    method public static void setNetworkMeteredMultipathPreference(@NonNull android.content.Context, @NonNull String);
    method public static void setNetworkSwitchNotificationMaximumDailyCount(@NonNull android.content.Context, @IntRange(from=0) int);
    method public static void setNetworkSwitchNotificationRateDuration(@NonNull android.content.Context, @NonNull java.time.Duration);
    method public static void setPrivateDnsDefaultMode(@NonNull android.content.Context, @NonNull int);
    method public static void setPrivateDnsHostname(@NonNull android.content.Context, @Nullable String);
    method public static void setPrivateDnsMode(@NonNull android.content.Context, int);
    method public static void setUidsAllowedOnRestrictedNetworks(@NonNull android.content.Context, @NonNull java.util.Set<java.lang.Integer>);
    method public static void setWifiAlwaysRequested(@NonNull android.content.Context, boolean);
    method public static void setWifiDataActivityTimeout(@NonNull android.content.Context, @NonNull java.time.Duration);
    field public static final int CAPTIVE_PORTAL_MODE_AVOID = 2; // 0x2
    field public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0; // 0x0
    field public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1; // 0x1
    field public static final int NETWORK_AVOID_BAD_WIFI_AVOID = 2; // 0x2
    field public static final int NETWORK_AVOID_BAD_WIFI_IGNORE = 0; // 0x0
    field public static final int NETWORK_AVOID_BAD_WIFI_PROMPT = 1; // 0x1
    field public static final int PRIVATE_DNS_MODE_OFF = 1; // 0x1
    field public static final int PRIVATE_DNS_MODE_OPPORTUNISTIC = 2; // 0x2
    field public static final int PRIVATE_DNS_MODE_PROVIDER_HOSTNAME = 3; // 0x3
  }

  public final class DhcpOption implements android.os.Parcelable {
    ctor public DhcpOption(byte, @Nullable byte[]);
    method public int describeContents();
    method public byte getType();
    method @Nullable public byte[] getValue();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.DhcpOption> CREATOR;
  }

  public final class NetworkAgentConfig implements android.os.Parcelable {
    method @Nullable public String getSubscriberId();
    method public boolean isBypassableVpn();
    method public boolean isVpnValidationRequired();
  }

  public static final class NetworkAgentConfig.Builder {
    method @NonNull public android.net.NetworkAgentConfig.Builder setBypassableVpn(boolean);
    method @NonNull public android.net.NetworkAgentConfig.Builder setLocalRoutesExcludedForVpn(boolean);
    method @NonNull public android.net.NetworkAgentConfig.Builder setSubscriberId(@Nullable String);
    method @NonNull public android.net.NetworkAgentConfig.Builder setVpnRequiresValidation(boolean);
  }

  public final class NetworkCapabilities implements android.os.Parcelable {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public java.util.Set<java.lang.Integer> getAllowedUids();
    method @Nullable public java.util.Set<android.util.Range<java.lang.Integer>> getUids();
    method public boolean hasForbiddenCapability(int);
    field public static final long REDACT_ALL = -1L; // 0xffffffffffffffffL
    field public static final long REDACT_FOR_ACCESS_FINE_LOCATION = 1L; // 0x1L
    field public static final long REDACT_FOR_LOCAL_MAC_ADDRESS = 2L; // 0x2L
    field public static final long REDACT_FOR_NETWORK_SETTINGS = 4L; // 0x4L
    field public static final long REDACT_NONE = 0L; // 0x0L
    field public static final int TRANSPORT_TEST = 7; // 0x7
  }

  public static final class NetworkCapabilities.Builder {
    method @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_FACTORY) public android.net.NetworkCapabilities.Builder setAllowedUids(@NonNull java.util.Set<java.lang.Integer>);
    method @NonNull public android.net.NetworkCapabilities.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
  }

  public class NetworkRequest implements android.os.Parcelable {
    method @NonNull public int[] getEnterpriseIds();
    method @NonNull public int[] getForbiddenCapabilities();
    method public boolean hasEnterpriseId(int);
    method public boolean hasForbiddenCapability(int);
  }

  public static class NetworkRequest.Builder {
    method @NonNull public android.net.NetworkRequest.Builder addForbiddenCapability(int);
    method @NonNull public android.net.NetworkRequest.Builder removeForbiddenCapability(int);
    method @NonNull public android.net.NetworkRequest.Builder setUids(@Nullable java.util.Set<android.util.Range<java.lang.Integer>>);
  }

  public final class ProfileNetworkPreference implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public int[] getExcludedUids();
    method @NonNull public int[] getIncludedUids();
    method public int getPreference();
    method public int getPreferenceEnterpriseId();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.ProfileNetworkPreference> CREATOR;
  }

  public static final class ProfileNetworkPreference.Builder {
    ctor public ProfileNetworkPreference.Builder();
    method @NonNull public android.net.ProfileNetworkPreference build();
    method @NonNull public android.net.ProfileNetworkPreference.Builder setExcludedUids(@NonNull int[]);
    method @NonNull public android.net.ProfileNetworkPreference.Builder setIncludedUids(@NonNull int[]);
    method @NonNull public android.net.ProfileNetworkPreference.Builder setPreference(int);
    method @NonNull public android.net.ProfileNetworkPreference.Builder setPreferenceEnterpriseId(int);
  }

  public final class TestNetworkInterface implements android.os.Parcelable {
    ctor public TestNetworkInterface(@NonNull android.os.ParcelFileDescriptor, @NonNull String);
    method public int describeContents();
    method @NonNull public android.os.ParcelFileDescriptor getFileDescriptor();
    method @NonNull public String getInterfaceName();
    method @Nullable public android.net.MacAddress getMacAddress();
    method public int getMtu();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkInterface> CREATOR;
  }

  public class TestNetworkManager {
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public android.net.TestNetworkInterface createTapInterface();
    method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public android.net.TestNetworkInterface createTunInterface(@NonNull java.util.Collection<android.net.LinkAddress>);
    method @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public void setupTestNetwork(@NonNull String, @NonNull android.os.IBinder);
    method @RequiresPermission(android.Manifest.permission.MANAGE_TEST_NETWORKS) public void teardownTestNetwork(@NonNull android.net.Network);
    field public static final String TEST_TAP_PREFIX = "testtap";
  }

  public final class TestNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    ctor public TestNetworkSpecifier(@NonNull String);
    method public int describeContents();
    method @Nullable public String getInterfaceName();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.TestNetworkSpecifier> CREATOR;
  }

  public interface TransportInfo {
    method public default long getApplicableRedactions();
    method @NonNull public default android.net.TransportInfo makeCopy(long);
  }

  public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
    ctor @Deprecated public VpnTransportInfo(int, @Nullable String);
    method public long getApplicableRedactions();
    method @Nullable public String getSessionId();
    method @NonNull public android.net.VpnTransportInfo makeCopy(long);
  }

}

