// Signature format: 2.0
package android.app.usage {

  public final class NetworkStats implements java.lang.AutoCloseable {
    method public void close();
    method public boolean getNextBucket(@Nullable android.app.usage.NetworkStats.Bucket);
    method public boolean hasNextBucket();
  }

  public static class NetworkStats.Bucket {
    ctor public NetworkStats.Bucket();
    method public int getDefaultNetworkStatus();
    method public long getEndTimeStamp();
    method public int getMetered();
    method public int getRoaming();
    method public long getRxBytes();
    method public long getRxPackets();
    method public long getStartTimeStamp();
    method public int getState();
    method public int getTag();
    method public long getTxBytes();
    method public long getTxPackets();
    method public int getUid();
    field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff
    field public static final int DEFAULT_NETWORK_NO = 1; // 0x1
    field public static final int DEFAULT_NETWORK_YES = 2; // 0x2
    field public static final int METERED_ALL = -1; // 0xffffffff
    field public static final int METERED_NO = 1; // 0x1
    field public static final int METERED_YES = 2; // 0x2
    field public static final int ROAMING_ALL = -1; // 0xffffffff
    field public static final int ROAMING_NO = 1; // 0x1
    field public static final int ROAMING_YES = 2; // 0x2
    field public static final int STATE_ALL = -1; // 0xffffffff
    field public static final int STATE_DEFAULT = 1; // 0x1
    field public static final int STATE_FOREGROUND = 2; // 0x2
    field public static final int TAG_NONE = 0; // 0x0
    field public static final int UID_ALL = -1; // 0xffffffff
    field public static final int UID_REMOVED = -4; // 0xfffffffc
    field public static final int UID_TETHERING = -5; // 0xfffffffb
  }

  public class NetworkStatsManager {
    method @WorkerThread public android.app.usage.NetworkStats queryDetails(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUid(int, @Nullable String, long, long, int) throws java.lang.SecurityException;
    method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTag(int, @Nullable String, long, long, int, int) throws java.lang.SecurityException;
    method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTagState(int, @Nullable String, long, long, int, int, int) throws java.lang.SecurityException;
    method @WorkerThread public android.app.usage.NetworkStats querySummary(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method @WorkerThread public android.app.usage.NetworkStats.Bucket querySummaryForDevice(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method @WorkerThread public android.app.usage.NetworkStats.Bucket querySummaryForUser(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException;
    method public void registerUsageCallback(int, @Nullable String, long, @NonNull android.app.usage.NetworkStatsManager.UsageCallback);
    method public void registerUsageCallback(int, @Nullable String, long, @NonNull android.app.usage.NetworkStatsManager.UsageCallback, @Nullable android.os.Handler);
    method public void unregisterUsageCallback(@NonNull android.app.usage.NetworkStatsManager.UsageCallback);
  }

  public abstract static class NetworkStatsManager.UsageCallback {
    ctor public NetworkStatsManager.UsageCallback();
    method public abstract void onThresholdReached(int, @Nullable String);
  }

}

package android.net {

  public final class EthernetNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable {
    ctor public EthernetNetworkSpecifier(@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.EthernetNetworkSpecifier> CREATOR;
  }

  public final class IpSecAlgorithm implements android.os.Parcelable {
    ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[]);
    ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[], int);
    method public int describeContents();
    method @NonNull public byte[] getKey();
    method @NonNull public String getName();
    method @NonNull public static java.util.Set<java.lang.String> getSupportedAlgorithms();
    method public int getTruncationLengthBits();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final String AUTH_AES_CMAC = "cmac(aes)";
    field public static final String AUTH_AES_XCBC = "xcbc(aes)";
    field public static final String AUTH_CRYPT_AES_GCM = "rfc4106(gcm(aes))";
    field public static final String AUTH_CRYPT_CHACHA20_POLY1305 = "rfc7539esp(chacha20,poly1305)";
    field public static final String AUTH_HMAC_MD5 = "hmac(md5)";
    field public static final String AUTH_HMAC_SHA1 = "hmac(sha1)";
    field public static final String AUTH_HMAC_SHA256 = "hmac(sha256)";
    field public static final String AUTH_HMAC_SHA384 = "hmac(sha384)";
    field public static final String AUTH_HMAC_SHA512 = "hmac(sha512)";
    field @NonNull public static final android.os.Parcelable.Creator<android.net.IpSecAlgorithm> CREATOR;
    field public static final String CRYPT_AES_CBC = "cbc(aes)";
    field public static final String CRYPT_AES_CTR = "rfc3686(ctr(aes))";
  }

  public class IpSecManager {
    method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress) throws android.net.IpSecManager.ResourceUnavailableException;
    method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress, int) throws android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method public void applyTransportModeTransform(@NonNull java.net.Socket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(@NonNull java.net.DatagramSocket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method public void applyTransportModeTransform(@NonNull java.io.FileDescriptor, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
    method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket(int) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket() throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
    method public void removeTransportModeTransforms(@NonNull java.net.Socket) throws java.io.IOException;
    method public void removeTransportModeTransforms(@NonNull java.net.DatagramSocket) throws java.io.IOException;
    method public void removeTransportModeTransforms(@NonNull java.io.FileDescriptor) throws java.io.IOException;
    field public static final int DIRECTION_IN = 0; // 0x0
    field public static final int DIRECTION_OUT = 1; // 0x1
  }

  public static final class IpSecManager.ResourceUnavailableException extends android.util.AndroidException {
  }

  public static final class IpSecManager.SecurityParameterIndex implements java.lang.AutoCloseable {
    method public void close();
    method public int getSpi();
  }

  public static final class IpSecManager.SpiUnavailableException extends android.util.AndroidException {
    method public int getSpi();
  }

  public static final class IpSecManager.UdpEncapsulationSocket implements java.lang.AutoCloseable {
    method public void close() throws java.io.IOException;
    method public java.io.FileDescriptor getFileDescriptor();
    method public int getPort();
  }

  public final class IpSecTransform implements java.lang.AutoCloseable {
    method public void close();
  }

  public static class IpSecTransform.Builder {
    ctor public IpSecTransform.Builder(@NonNull android.content.Context);
    method @NonNull public android.net.IpSecTransform buildTransportModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
    method @NonNull public android.net.IpSecTransform.Builder setAuthenticatedEncryption(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setAuthentication(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setEncryption(@NonNull android.net.IpSecAlgorithm);
    method @NonNull public android.net.IpSecTransform.Builder setIpv4Encapsulation(@NonNull android.net.IpSecManager.UdpEncapsulationSocket, int);
  }

  public class TrafficStats {
    ctor public TrafficStats();
    method public static void clearThreadStatsTag();
    method public static void clearThreadStatsUid();
    method public static int getAndSetThreadStatsTag(int);
    method public static long getMobileRxBytes();
    method public static long getMobileRxPackets();
    method public static long getMobileTxBytes();
    method public static long getMobileTxPackets();
    method public static long getRxBytes(@NonNull String);
    method public static long getRxPackets(@NonNull String);
    method public static int getThreadStatsTag();
    method public static int getThreadStatsUid();
    method public static long getTotalRxBytes();
    method public static long getTotalRxPackets();
    method public static long getTotalTxBytes();
    method public static long getTotalTxPackets();
    method public static long getTxBytes(@NonNull String);
    method public static long getTxPackets(@NonNull String);
    method public static long getUidRxBytes(int);
    method public static long getUidRxPackets(int);
    method @Deprecated public static long getUidTcpRxBytes(int);
    method @Deprecated public static long getUidTcpRxSegments(int);
    method @Deprecated public static long getUidTcpTxBytes(int);
    method @Deprecated public static long getUidTcpTxSegments(int);
    method public static long getUidTxBytes(int);
    method public static long getUidTxPackets(int);
    method @Deprecated public static long getUidUdpRxBytes(int);
    method @Deprecated public static long getUidUdpRxPackets(int);
    method @Deprecated public static long getUidUdpTxBytes(int);
    method @Deprecated public static long getUidUdpTxPackets(int);
    method public static void incrementOperationCount(int);
    method public static void incrementOperationCount(int, int);
    method public static void setThreadStatsTag(int);
    method public static void setThreadStatsUid(int);
    method public static void tagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException;
    method public static void tagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException;
    method public static void tagSocket(@NonNull java.net.Socket) throws java.net.SocketException;
    method public static void untagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException;
    method public static void untagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException;
    method public static void untagSocket(@NonNull java.net.Socket) throws java.net.SocketException;
    field public static final int UNSUPPORTED = -1; // 0xffffffff
  }

}

package android.net.nsd {

  public final class NsdManager {
    method public void discoverServices(String, int, android.net.nsd.NsdManager.DiscoveryListener);
    method public void discoverServices(@NonNull String, int, @Nullable android.net.Network, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.DiscoveryListener);
    method @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) public void discoverServices(@NonNull String, int, @NonNull android.net.NetworkRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.DiscoveryListener);
    method public void registerService(android.net.nsd.NsdServiceInfo, int, android.net.nsd.NsdManager.RegistrationListener);
    method public void registerService(@NonNull android.net.nsd.NsdServiceInfo, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.RegistrationListener);
    method public void registerServiceInfoCallback(@NonNull android.net.nsd.NsdServiceInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.ServiceInfoCallback);
    method @Deprecated public void resolveService(android.net.nsd.NsdServiceInfo, android.net.nsd.NsdManager.ResolveListener);
    method @Deprecated public void resolveService(@NonNull android.net.nsd.NsdServiceInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.ResolveListener);
    method public void stopServiceDiscovery(android.net.nsd.NsdManager.DiscoveryListener);
    method public void stopServiceResolution(@NonNull android.net.nsd.NsdManager.ResolveListener);
    method public void unregisterService(android.net.nsd.NsdManager.RegistrationListener);
    method public void unregisterServiceInfoCallback(@NonNull android.net.nsd.NsdManager.ServiceInfoCallback);
    field public static final String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED";
    field public static final String EXTRA_NSD_STATE = "nsd_state";
    field public static final int FAILURE_ALREADY_ACTIVE = 3; // 0x3
    field public static final int FAILURE_BAD_PARAMETERS = 6; // 0x6
    field public static final int FAILURE_INTERNAL_ERROR = 0; // 0x0
    field public static final int FAILURE_MAX_LIMIT = 4; // 0x4
    field public static final int FAILURE_OPERATION_NOT_RUNNING = 5; // 0x5
    field public static final int NSD_STATE_DISABLED = 1; // 0x1
    field public static final int NSD_STATE_ENABLED = 2; // 0x2
    field public static final int PROTOCOL_DNS_SD = 1; // 0x1
  }

  public static interface NsdManager.DiscoveryListener {
    method public void onDiscoveryStarted(String);
    method public void onDiscoveryStopped(String);
    method public void onServiceFound(android.net.nsd.NsdServiceInfo);
    method public void onServiceLost(android.net.nsd.NsdServiceInfo);
    method public void onStartDiscoveryFailed(String, int);
    method public void onStopDiscoveryFailed(String, int);
  }

  public static interface NsdManager.RegistrationListener {
    method public void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int);
    method public void onServiceRegistered(android.net.nsd.NsdServiceInfo);
    method public void onServiceUnregistered(android.net.nsd.NsdServiceInfo);
    method public void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int);
  }

  public static interface NsdManager.ResolveListener {
    method public default void onResolutionStopped(@NonNull android.net.nsd.NsdServiceInfo);
    method public void onResolveFailed(android.net.nsd.NsdServiceInfo, int);
    method public void onServiceResolved(android.net.nsd.NsdServiceInfo);
    method public default void onStopResolutionFailed(@NonNull android.net.nsd.NsdServiceInfo, int);
  }

  public static interface NsdManager.ServiceInfoCallback {
    method public void onServiceInfoCallbackRegistrationFailed(int);
    method public void onServiceInfoCallbackUnregistered();
    method public void onServiceLost();
    method public void onServiceUpdated(@NonNull android.net.nsd.NsdServiceInfo);
  }

  public final class NsdServiceInfo implements android.os.Parcelable {
    ctor public NsdServiceInfo();
    method public int describeContents();
    method public java.util.Map<java.lang.String,byte[]> getAttributes();
    method @Deprecated public java.net.InetAddress getHost();
    method @NonNull public java.util.List<java.net.InetAddress> getHostAddresses();
    method @Nullable public android.net.Network getNetwork();
    method public int getPort();
    method public String getServiceName();
    method public String getServiceType();
    method public void removeAttribute(String);
    method public void setAttribute(String, String);
    method @Deprecated public void setHost(java.net.InetAddress);
    method public void setHostAddresses(@NonNull java.util.List<java.net.InetAddress>);
    method public void setNetwork(@Nullable android.net.Network);
    method public void setPort(int);
    method public void setServiceName(String);
    method public void setServiceType(String);
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.NsdServiceInfo> CREATOR;
  }

}

