paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 1 | // Signature format: 2.0 |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 2 | package android.app.usage { |
| 3 | |
| 4 | public final class NetworkStats implements java.lang.AutoCloseable { |
| 5 | method public void close(); |
junyulai | b59e542 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 6 | method public boolean getNextBucket(@Nullable android.app.usage.NetworkStats.Bucket); |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 7 | method public boolean hasNextBucket(); |
| 8 | } |
| 9 | |
| 10 | public static class NetworkStats.Bucket { |
| 11 | ctor public NetworkStats.Bucket(); |
| 12 | method public int getDefaultNetworkStatus(); |
| 13 | method public long getEndTimeStamp(); |
| 14 | method public int getMetered(); |
| 15 | method public int getRoaming(); |
| 16 | method public long getRxBytes(); |
| 17 | method public long getRxPackets(); |
| 18 | method public long getStartTimeStamp(); |
| 19 | method public int getState(); |
| 20 | method public int getTag(); |
| 21 | method public long getTxBytes(); |
| 22 | method public long getTxPackets(); |
| 23 | method public int getUid(); |
| 24 | field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff |
| 25 | field public static final int DEFAULT_NETWORK_NO = 1; // 0x1 |
| 26 | field public static final int DEFAULT_NETWORK_YES = 2; // 0x2 |
| 27 | field public static final int METERED_ALL = -1; // 0xffffffff |
| 28 | field public static final int METERED_NO = 1; // 0x1 |
| 29 | field public static final int METERED_YES = 2; // 0x2 |
| 30 | field public static final int ROAMING_ALL = -1; // 0xffffffff |
| 31 | field public static final int ROAMING_NO = 1; // 0x1 |
| 32 | field public static final int ROAMING_YES = 2; // 0x2 |
| 33 | field public static final int STATE_ALL = -1; // 0xffffffff |
| 34 | field public static final int STATE_DEFAULT = 1; // 0x1 |
| 35 | field public static final int STATE_FOREGROUND = 2; // 0x2 |
| 36 | field public static final int TAG_NONE = 0; // 0x0 |
| 37 | field public static final int UID_ALL = -1; // 0xffffffff |
| 38 | field public static final int UID_REMOVED = -4; // 0xfffffffc |
| 39 | field public static final int UID_TETHERING = -5; // 0xfffffffb |
| 40 | } |
| 41 | |
| 42 | public class NetworkStatsManager { |
junyulai | b59e542 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 43 | method @WorkerThread public android.app.usage.NetworkStats queryDetails(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException; |
| 44 | method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUid(int, @Nullable String, long, long, int) throws java.lang.SecurityException; |
| 45 | method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTag(int, @Nullable String, long, long, int, int) throws java.lang.SecurityException; |
| 46 | method @NonNull @WorkerThread public android.app.usage.NetworkStats queryDetailsForUidTagState(int, @Nullable String, long, long, int, int, int) throws java.lang.SecurityException; |
| 47 | method @WorkerThread public android.app.usage.NetworkStats querySummary(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException; |
| 48 | method @WorkerThread public android.app.usage.NetworkStats.Bucket querySummaryForDevice(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException; |
| 49 | method @WorkerThread public android.app.usage.NetworkStats.Bucket querySummaryForUser(int, @Nullable String, long, long) throws android.os.RemoteException, java.lang.SecurityException; |
| 50 | method public void registerUsageCallback(int, @Nullable String, long, @NonNull android.app.usage.NetworkStatsManager.UsageCallback); |
| 51 | method public void registerUsageCallback(int, @Nullable String, long, @NonNull android.app.usage.NetworkStatsManager.UsageCallback, @Nullable android.os.Handler); |
| 52 | method public void unregisterUsageCallback(@NonNull android.app.usage.NetworkStatsManager.UsageCallback); |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | public abstract static class NetworkStatsManager.UsageCallback { |
| 56 | ctor public NetworkStatsManager.UsageCallback(); |
junyulai | b59e542 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 57 | method public abstract void onThresholdReached(int, @Nullable String); |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | } |
| 61 | |
Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 62 | package android.net { |
| 63 | |
Xiao Ma | eaaf7d3 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 64 | public final class EthernetNetworkSpecifier extends android.net.NetworkSpecifier implements android.os.Parcelable { |
| 65 | ctor public EthernetNetworkSpecifier(@NonNull String); |
| 66 | method public int describeContents(); |
| 67 | method @Nullable public String getInterfaceName(); |
| 68 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 69 | field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkSpecifier> CREATOR; |
| 70 | } |
| 71 | |
Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 72 | public final class IpSecAlgorithm implements android.os.Parcelable { |
| 73 | ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[]); |
| 74 | ctor public IpSecAlgorithm(@NonNull String, @NonNull byte[], int); |
| 75 | method public int describeContents(); |
| 76 | method @NonNull public byte[] getKey(); |
| 77 | method @NonNull public String getName(); |
| 78 | method @NonNull public static java.util.Set<java.lang.String> getSupportedAlgorithms(); |
| 79 | method public int getTruncationLengthBits(); |
| 80 | method public void writeToParcel(android.os.Parcel, int); |
| 81 | field public static final String AUTH_AES_CMAC = "cmac(aes)"; |
| 82 | field public static final String AUTH_AES_XCBC = "xcbc(aes)"; |
| 83 | field public static final String AUTH_CRYPT_AES_GCM = "rfc4106(gcm(aes))"; |
| 84 | field public static final String AUTH_CRYPT_CHACHA20_POLY1305 = "rfc7539esp(chacha20,poly1305)"; |
| 85 | field public static final String AUTH_HMAC_MD5 = "hmac(md5)"; |
| 86 | field public static final String AUTH_HMAC_SHA1 = "hmac(sha1)"; |
| 87 | field public static final String AUTH_HMAC_SHA256 = "hmac(sha256)"; |
| 88 | field public static final String AUTH_HMAC_SHA384 = "hmac(sha384)"; |
| 89 | field public static final String AUTH_HMAC_SHA512 = "hmac(sha512)"; |
| 90 | field @NonNull public static final android.os.Parcelable.Creator<android.net.IpSecAlgorithm> CREATOR; |
| 91 | field public static final String CRYPT_AES_CBC = "cbc(aes)"; |
| 92 | field public static final String CRYPT_AES_CTR = "rfc3686(ctr(aes))"; |
| 93 | } |
| 94 | |
Yan Yan | f8063e3 | 2022-02-08 19:26:29 -0800 | [diff] [blame] | 95 | public class IpSecManager { |
Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 96 | method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress) throws android.net.IpSecManager.ResourceUnavailableException; |
| 97 | method @NonNull public android.net.IpSecManager.SecurityParameterIndex allocateSecurityParameterIndex(@NonNull java.net.InetAddress, int) throws android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException; |
| 98 | method public void applyTransportModeTransform(@NonNull java.net.Socket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException; |
| 99 | method public void applyTransportModeTransform(@NonNull java.net.DatagramSocket, int, @NonNull android.net.IpSecTransform) throws java.io.IOException; |
| 100 | method public void applyTransportModeTransform(@NonNull java.io.FileDescriptor, int, @NonNull android.net.IpSecTransform) throws java.io.IOException; |
| 101 | method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket(int) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException; |
| 102 | method @NonNull public android.net.IpSecManager.UdpEncapsulationSocket openUdpEncapsulationSocket() throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException; |
| 103 | method public void removeTransportModeTransforms(@NonNull java.net.Socket) throws java.io.IOException; |
| 104 | method public void removeTransportModeTransforms(@NonNull java.net.DatagramSocket) throws java.io.IOException; |
| 105 | method public void removeTransportModeTransforms(@NonNull java.io.FileDescriptor) throws java.io.IOException; |
| 106 | field public static final int DIRECTION_IN = 0; // 0x0 |
| 107 | field public static final int DIRECTION_OUT = 1; // 0x1 |
| 108 | } |
| 109 | |
| 110 | public static final class IpSecManager.ResourceUnavailableException extends android.util.AndroidException { |
| 111 | } |
| 112 | |
| 113 | public static final class IpSecManager.SecurityParameterIndex implements java.lang.AutoCloseable { |
| 114 | method public void close(); |
| 115 | method public int getSpi(); |
| 116 | } |
| 117 | |
| 118 | public static final class IpSecManager.SpiUnavailableException extends android.util.AndroidException { |
| 119 | method public int getSpi(); |
| 120 | } |
| 121 | |
| 122 | public static final class IpSecManager.UdpEncapsulationSocket implements java.lang.AutoCloseable { |
| 123 | method public void close() throws java.io.IOException; |
| 124 | method public java.io.FileDescriptor getFileDescriptor(); |
| 125 | method public int getPort(); |
| 126 | } |
| 127 | |
| 128 | public final class IpSecTransform implements java.lang.AutoCloseable { |
| 129 | method public void close(); |
| 130 | } |
| 131 | |
| 132 | public static class IpSecTransform.Builder { |
| 133 | ctor public IpSecTransform.Builder(@NonNull android.content.Context); |
| 134 | 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; |
| 135 | method @NonNull public android.net.IpSecTransform.Builder setAuthenticatedEncryption(@NonNull android.net.IpSecAlgorithm); |
| 136 | method @NonNull public android.net.IpSecTransform.Builder setAuthentication(@NonNull android.net.IpSecAlgorithm); |
| 137 | method @NonNull public android.net.IpSecTransform.Builder setEncryption(@NonNull android.net.IpSecAlgorithm); |
| 138 | method @NonNull public android.net.IpSecTransform.Builder setIpv4Encapsulation(@NonNull android.net.IpSecManager.UdpEncapsulationSocket, int); |
| 139 | } |
| 140 | |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 141 | public class TrafficStats { |
| 142 | ctor public TrafficStats(); |
| 143 | method public static void clearThreadStatsTag(); |
| 144 | method public static void clearThreadStatsUid(); |
| 145 | method public static int getAndSetThreadStatsTag(int); |
| 146 | method public static long getMobileRxBytes(); |
| 147 | method public static long getMobileRxPackets(); |
| 148 | method public static long getMobileTxBytes(); |
| 149 | method public static long getMobileTxPackets(); |
| 150 | method public static long getRxBytes(@NonNull String); |
| 151 | method public static long getRxPackets(@NonNull String); |
| 152 | method public static int getThreadStatsTag(); |
| 153 | method public static int getThreadStatsUid(); |
| 154 | method public static long getTotalRxBytes(); |
| 155 | method public static long getTotalRxPackets(); |
| 156 | method public static long getTotalTxBytes(); |
| 157 | method public static long getTotalTxPackets(); |
| 158 | method public static long getTxBytes(@NonNull String); |
| 159 | method public static long getTxPackets(@NonNull String); |
| 160 | method public static long getUidRxBytes(int); |
| 161 | method public static long getUidRxPackets(int); |
| 162 | method @Deprecated public static long getUidTcpRxBytes(int); |
| 163 | method @Deprecated public static long getUidTcpRxSegments(int); |
| 164 | method @Deprecated public static long getUidTcpTxBytes(int); |
| 165 | method @Deprecated public static long getUidTcpTxSegments(int); |
| 166 | method public static long getUidTxBytes(int); |
| 167 | method public static long getUidTxPackets(int); |
| 168 | method @Deprecated public static long getUidUdpRxBytes(int); |
| 169 | method @Deprecated public static long getUidUdpRxPackets(int); |
| 170 | method @Deprecated public static long getUidUdpTxBytes(int); |
| 171 | method @Deprecated public static long getUidUdpTxPackets(int); |
| 172 | method public static void incrementOperationCount(int); |
| 173 | method public static void incrementOperationCount(int, int); |
| 174 | method public static void setThreadStatsTag(int); |
| 175 | method public static void setThreadStatsUid(int); |
junyulai | b59e542 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 176 | method public static void tagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException; |
| 177 | method public static void tagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException; |
| 178 | method public static void tagSocket(@NonNull java.net.Socket) throws java.net.SocketException; |
| 179 | method public static void untagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException; |
| 180 | method public static void untagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException; |
| 181 | method public static void untagSocket(@NonNull java.net.Socket) throws java.net.SocketException; |
Junyu Lai | 2ef865e | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 182 | field public static final int UNSUPPORTED = -1; // 0xffffffff |
| 183 | } |
| 184 | |
Aaron Huang | 68ca373 | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 185 | } |
| 186 | |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 187 | package android.net.nsd { |
| 188 | |
| 189 | public final class NsdManager { |
| 190 | method public void discoverServices(String, int, android.net.nsd.NsdManager.DiscoveryListener); |
Remi NGUYEN VAN | 59145dc | 2022-03-15 16:15:21 +0000 | [diff] [blame] | 191 | method public void discoverServices(@NonNull String, int, @Nullable android.net.Network, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.DiscoveryListener); |
| 192 | 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); |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 193 | method public void registerService(android.net.nsd.NsdServiceInfo, int, android.net.nsd.NsdManager.RegistrationListener); |
Remi NGUYEN VAN | 59145dc | 2022-03-15 16:15:21 +0000 | [diff] [blame] | 194 | method public void registerService(@NonNull android.net.nsd.NsdServiceInfo, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.RegistrationListener); |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 195 | method public void resolveService(android.net.nsd.NsdServiceInfo, android.net.nsd.NsdManager.ResolveListener); |
Remi NGUYEN VAN | 59145dc | 2022-03-15 16:15:21 +0000 | [diff] [blame] | 196 | method public void resolveService(@NonNull android.net.nsd.NsdServiceInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.ResolveListener); |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 197 | method public void stopServiceDiscovery(android.net.nsd.NsdManager.DiscoveryListener); |
| 198 | method public void unregisterService(android.net.nsd.NsdManager.RegistrationListener); |
| 199 | field public static final String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED"; |
| 200 | field public static final String EXTRA_NSD_STATE = "nsd_state"; |
| 201 | field public static final int FAILURE_ALREADY_ACTIVE = 3; // 0x3 |
| 202 | field public static final int FAILURE_INTERNAL_ERROR = 0; // 0x0 |
| 203 | field public static final int FAILURE_MAX_LIMIT = 4; // 0x4 |
| 204 | field public static final int NSD_STATE_DISABLED = 1; // 0x1 |
| 205 | field public static final int NSD_STATE_ENABLED = 2; // 0x2 |
| 206 | field public static final int PROTOCOL_DNS_SD = 1; // 0x1 |
| 207 | } |
| 208 | |
| 209 | public static interface NsdManager.DiscoveryListener { |
| 210 | method public void onDiscoveryStarted(String); |
| 211 | method public void onDiscoveryStopped(String); |
| 212 | method public void onServiceFound(android.net.nsd.NsdServiceInfo); |
| 213 | method public void onServiceLost(android.net.nsd.NsdServiceInfo); |
| 214 | method public void onStartDiscoveryFailed(String, int); |
| 215 | method public void onStopDiscoveryFailed(String, int); |
| 216 | } |
| 217 | |
| 218 | public static interface NsdManager.RegistrationListener { |
| 219 | method public void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int); |
| 220 | method public void onServiceRegistered(android.net.nsd.NsdServiceInfo); |
| 221 | method public void onServiceUnregistered(android.net.nsd.NsdServiceInfo); |
| 222 | method public void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int); |
| 223 | } |
| 224 | |
| 225 | public static interface NsdManager.ResolveListener { |
| 226 | method public void onResolveFailed(android.net.nsd.NsdServiceInfo, int); |
| 227 | method public void onServiceResolved(android.net.nsd.NsdServiceInfo); |
| 228 | } |
| 229 | |
| 230 | public final class NsdServiceInfo implements android.os.Parcelable { |
| 231 | ctor public NsdServiceInfo(); |
| 232 | method public int describeContents(); |
| 233 | method public java.util.Map<java.lang.String,byte[]> getAttributes(); |
| 234 | method public java.net.InetAddress getHost(); |
Remi NGUYEN VAN | 06bdcec | 2021-12-16 15:24:41 +0900 | [diff] [blame] | 235 | method @Nullable public android.net.Network getNetwork(); |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 236 | method public int getPort(); |
| 237 | method public String getServiceName(); |
| 238 | method public String getServiceType(); |
| 239 | method public void removeAttribute(String); |
| 240 | method public void setAttribute(String, String); |
| 241 | method public void setHost(java.net.InetAddress); |
Remi NGUYEN VAN | 06bdcec | 2021-12-16 15:24:41 +0900 | [diff] [blame] | 242 | method public void setNetwork(@Nullable android.net.Network); |
paulhu | 667e8fb | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 243 | method public void setPort(int); |
| 244 | method public void setServiceName(String); |
| 245 | method public void setServiceType(String); |
| 246 | method public void writeToParcel(android.os.Parcel, int); |
| 247 | field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.NsdServiceInfo> CREATOR; |
| 248 | } |
| 249 | |
| 250 | } |
| 251 | |