| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 1 | // Signature format: 2.0 | 
| Junyu Lai | eb6f4be | 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 | dd1d024 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 6 | method public boolean getNextBucket(@Nullable android.app.usage.NetworkStats.Bucket); | 
| Junyu Lai | eb6f4be | 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 | dd1d024 | 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 | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 53 | } | 
|  | 54 |  | 
|  | 55 | public abstract static class NetworkStatsManager.UsageCallback { | 
|  | 56 | ctor public NetworkStatsManager.UsageCallback(); | 
| junyulai | dd1d024 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 57 | method public abstract void onThresholdReached(int, @Nullable String); | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 58 | } | 
|  | 59 |  | 
|  | 60 | } | 
|  | 61 |  | 
| Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 62 | package android.net { | 
|  | 63 |  | 
| Xiao Ma | 0a171c0 | 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 | 2e778ee | 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 |  | 
|  | 95 | public class IpSecManager { | 
|  | 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(); | 
| Yan Yan | 3976e49 | 2023-11-15 23:53:33 +0000 | [diff] [blame] | 130 | method @FlaggedApi("com.android.net.flags.ipsec_transform_state") public void getIpSecTransformState(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.net.IpSecTransformState,java.lang.RuntimeException>); | 
| Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 131 | } | 
|  | 132 |  | 
|  | 133 | public static class IpSecTransform.Builder { | 
|  | 134 | ctor public IpSecTransform.Builder(@NonNull android.content.Context); | 
|  | 135 | 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; | 
|  | 136 | method @NonNull public android.net.IpSecTransform.Builder setAuthenticatedEncryption(@NonNull android.net.IpSecAlgorithm); | 
|  | 137 | method @NonNull public android.net.IpSecTransform.Builder setAuthentication(@NonNull android.net.IpSecAlgorithm); | 
|  | 138 | method @NonNull public android.net.IpSecTransform.Builder setEncryption(@NonNull android.net.IpSecAlgorithm); | 
|  | 139 | method @NonNull public android.net.IpSecTransform.Builder setIpv4Encapsulation(@NonNull android.net.IpSecManager.UdpEncapsulationSocket, int); | 
|  | 140 | } | 
|  | 141 |  | 
| Yan Yan | 3976e49 | 2023-11-15 23:53:33 +0000 | [diff] [blame] | 142 | @FlaggedApi("com.android.net.flags.ipsec_transform_state") public final class IpSecTransformState implements android.os.Parcelable { | 
|  | 143 | method public int describeContents(); | 
|  | 144 | method public long getByteCount(); | 
|  | 145 | method public long getPacketCount(); | 
|  | 146 | method @NonNull public byte[] getReplayBitmap(); | 
|  | 147 | method public long getRxHighestSequenceNumber(); | 
|  | 148 | method public long getTimestamp(); | 
|  | 149 | method public long getTxHighestSequenceNumber(); | 
|  | 150 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 151 | field @NonNull public static final android.os.Parcelable.Creator<android.net.IpSecTransformState> CREATOR; | 
|  | 152 | } | 
|  | 153 |  | 
|  | 154 | @FlaggedApi("com.android.net.flags.ipsec_transform_state") public static final class IpSecTransformState.Builder { | 
|  | 155 | ctor public IpSecTransformState.Builder(); | 
|  | 156 | method @NonNull public android.net.IpSecTransformState build(); | 
|  | 157 | method @NonNull public android.net.IpSecTransformState.Builder setByteCount(long); | 
|  | 158 | method @NonNull public android.net.IpSecTransformState.Builder setPacketCount(long); | 
|  | 159 | method @NonNull public android.net.IpSecTransformState.Builder setReplayBitmap(@NonNull byte[]); | 
|  | 160 | method @NonNull public android.net.IpSecTransformState.Builder setRxHighestSequenceNumber(long); | 
|  | 161 | method @NonNull public android.net.IpSecTransformState.Builder setTimestamp(long); | 
|  | 162 | method @NonNull public android.net.IpSecTransformState.Builder setTxHighestSequenceNumber(long); | 
|  | 163 | } | 
|  | 164 |  | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 165 | public class TrafficStats { | 
|  | 166 | ctor public TrafficStats(); | 
|  | 167 | method public static void clearThreadStatsTag(); | 
|  | 168 | method public static void clearThreadStatsUid(); | 
|  | 169 | method public static int getAndSetThreadStatsTag(int); | 
|  | 170 | method public static long getMobileRxBytes(); | 
|  | 171 | method public static long getMobileRxPackets(); | 
|  | 172 | method public static long getMobileTxBytes(); | 
|  | 173 | method public static long getMobileTxPackets(); | 
|  | 174 | method public static long getRxBytes(@NonNull String); | 
|  | 175 | method public static long getRxPackets(@NonNull String); | 
|  | 176 | method public static int getThreadStatsTag(); | 
|  | 177 | method public static int getThreadStatsUid(); | 
|  | 178 | method public static long getTotalRxBytes(); | 
|  | 179 | method public static long getTotalRxPackets(); | 
|  | 180 | method public static long getTotalTxBytes(); | 
|  | 181 | method public static long getTotalTxPackets(); | 
|  | 182 | method public static long getTxBytes(@NonNull String); | 
|  | 183 | method public static long getTxPackets(@NonNull String); | 
|  | 184 | method public static long getUidRxBytes(int); | 
|  | 185 | method public static long getUidRxPackets(int); | 
|  | 186 | method @Deprecated public static long getUidTcpRxBytes(int); | 
|  | 187 | method @Deprecated public static long getUidTcpRxSegments(int); | 
|  | 188 | method @Deprecated public static long getUidTcpTxBytes(int); | 
|  | 189 | method @Deprecated public static long getUidTcpTxSegments(int); | 
|  | 190 | method public static long getUidTxBytes(int); | 
|  | 191 | method public static long getUidTxPackets(int); | 
|  | 192 | method @Deprecated public static long getUidUdpRxBytes(int); | 
|  | 193 | method @Deprecated public static long getUidUdpRxPackets(int); | 
|  | 194 | method @Deprecated public static long getUidUdpTxBytes(int); | 
|  | 195 | method @Deprecated public static long getUidUdpTxPackets(int); | 
|  | 196 | method public static void incrementOperationCount(int); | 
|  | 197 | method public static void incrementOperationCount(int, int); | 
|  | 198 | method public static void setThreadStatsTag(int); | 
|  | 199 | method public static void setThreadStatsUid(int); | 
| junyulai | dd1d024 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 200 | method public static void tagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException; | 
|  | 201 | method public static void tagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException; | 
|  | 202 | method public static void tagSocket(@NonNull java.net.Socket) throws java.net.SocketException; | 
|  | 203 | method public static void untagDatagramSocket(@NonNull java.net.DatagramSocket) throws java.net.SocketException; | 
|  | 204 | method public static void untagFileDescriptor(@NonNull java.io.FileDescriptor) throws java.io.IOException; | 
|  | 205 | method public static void untagSocket(@NonNull java.net.Socket) throws java.net.SocketException; | 
| Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 206 | field public static final int UNSUPPORTED = -1; // 0xffffffff | 
|  | 207 | } | 
|  | 208 |  | 
| Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 209 | } | 
|  | 210 |  | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 211 | package android.net.nsd { | 
|  | 212 |  | 
| Kangping Dong | 97d6aeb | 2023-12-08 15:51:09 +0800 | [diff] [blame] | 213 | @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") public final class DiscoveryRequest implements android.os.Parcelable { | 
|  | 214 | method public int describeContents(); | 
|  | 215 | method @Nullable public android.net.Network getNetwork(); | 
|  | 216 | method @NonNull public String getServiceType(); | 
|  | 217 | method @Nullable public String getSubtype(); | 
|  | 218 | method public void writeToParcel(@NonNull android.os.Parcel, int); | 
|  | 219 | field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.DiscoveryRequest> CREATOR; | 
|  | 220 | } | 
|  | 221 |  | 
|  | 222 | public static final class DiscoveryRequest.Builder { | 
|  | 223 | ctor public DiscoveryRequest.Builder(@NonNull String); | 
|  | 224 | method @NonNull public android.net.nsd.DiscoveryRequest build(); | 
|  | 225 | method @NonNull public android.net.nsd.DiscoveryRequest.Builder setNetwork(@Nullable android.net.Network); | 
|  | 226 | method @NonNull public android.net.nsd.DiscoveryRequest.Builder setSubtype(@Nullable String); | 
|  | 227 | } | 
|  | 228 |  | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 229 | public final class NsdManager { | 
|  | 230 | method public void discoverServices(String, int, android.net.nsd.NsdManager.DiscoveryListener); | 
| Remi NGUYEN VAN | 59145dc | 2022-03-15 16:15:21 +0000 | [diff] [blame] | 231 | method public void discoverServices(@NonNull String, int, @Nullable android.net.Network, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.DiscoveryListener); | 
| Kangping Dong | 97d6aeb | 2023-12-08 15:51:09 +0800 | [diff] [blame] | 232 | method @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") public void discoverServices(@NonNull android.net.nsd.DiscoveryRequest, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.DiscoveryListener); | 
| Remi NGUYEN VAN | 59145dc | 2022-03-15 16:15:21 +0000 | [diff] [blame] | 233 | 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 | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 234 | 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] | 235 | method public void registerService(@NonNull android.net.nsd.NsdServiceInfo, int, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.RegistrationListener); | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 236 | method public void registerServiceInfoCallback(@NonNull android.net.nsd.NsdServiceInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.ServiceInfoCallback); | 
|  | 237 | method @Deprecated public void resolveService(android.net.nsd.NsdServiceInfo, android.net.nsd.NsdManager.ResolveListener); | 
|  | 238 | method @Deprecated public void resolveService(@NonNull android.net.nsd.NsdServiceInfo, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.NsdManager.ResolveListener); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 239 | method public void stopServiceDiscovery(android.net.nsd.NsdManager.DiscoveryListener); | 
| Paul Hu | b58deb7 | 2022-12-26 09:24:42 +0000 | [diff] [blame] | 240 | method public void stopServiceResolution(@NonNull android.net.nsd.NsdManager.ResolveListener); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 241 | method public void unregisterService(android.net.nsd.NsdManager.RegistrationListener); | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 242 | method public void unregisterServiceInfoCallback(@NonNull android.net.nsd.NsdManager.ServiceInfoCallback); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 243 | field public static final String ACTION_NSD_STATE_CHANGED = "android.net.nsd.STATE_CHANGED"; | 
|  | 244 | field public static final String EXTRA_NSD_STATE = "nsd_state"; | 
|  | 245 | field public static final int FAILURE_ALREADY_ACTIVE = 3; // 0x3 | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 246 | field public static final int FAILURE_BAD_PARAMETERS = 6; // 0x6 | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 247 | field public static final int FAILURE_INTERNAL_ERROR = 0; // 0x0 | 
|  | 248 | field public static final int FAILURE_MAX_LIMIT = 4; // 0x4 | 
| Paul Hu | b58deb7 | 2022-12-26 09:24:42 +0000 | [diff] [blame] | 249 | field public static final int FAILURE_OPERATION_NOT_RUNNING = 5; // 0x5 | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 250 | field public static final int NSD_STATE_DISABLED = 1; // 0x1 | 
|  | 251 | field public static final int NSD_STATE_ENABLED = 2; // 0x2 | 
|  | 252 | field public static final int PROTOCOL_DNS_SD = 1; // 0x1 | 
|  | 253 | } | 
|  | 254 |  | 
|  | 255 | public static interface NsdManager.DiscoveryListener { | 
|  | 256 | method public void onDiscoveryStarted(String); | 
|  | 257 | method public void onDiscoveryStopped(String); | 
|  | 258 | method public void onServiceFound(android.net.nsd.NsdServiceInfo); | 
|  | 259 | method public void onServiceLost(android.net.nsd.NsdServiceInfo); | 
|  | 260 | method public void onStartDiscoveryFailed(String, int); | 
|  | 261 | method public void onStopDiscoveryFailed(String, int); | 
|  | 262 | } | 
|  | 263 |  | 
|  | 264 | public static interface NsdManager.RegistrationListener { | 
|  | 265 | method public void onRegistrationFailed(android.net.nsd.NsdServiceInfo, int); | 
|  | 266 | method public void onServiceRegistered(android.net.nsd.NsdServiceInfo); | 
|  | 267 | method public void onServiceUnregistered(android.net.nsd.NsdServiceInfo); | 
|  | 268 | method public void onUnregistrationFailed(android.net.nsd.NsdServiceInfo, int); | 
|  | 269 | } | 
|  | 270 |  | 
|  | 271 | public static interface NsdManager.ResolveListener { | 
| Paul Hu | b2c0f34 | 2023-01-30 08:53:15 +0000 | [diff] [blame] | 272 | method public default void onResolutionStopped(@NonNull android.net.nsd.NsdServiceInfo); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 273 | method public void onResolveFailed(android.net.nsd.NsdServiceInfo, int); | 
|  | 274 | method public void onServiceResolved(android.net.nsd.NsdServiceInfo); | 
| Paul Hu | b58deb7 | 2022-12-26 09:24:42 +0000 | [diff] [blame] | 275 | method public default void onStopResolutionFailed(@NonNull android.net.nsd.NsdServiceInfo, int); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 276 | } | 
|  | 277 |  | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 278 | public static interface NsdManager.ServiceInfoCallback { | 
|  | 279 | method public void onServiceInfoCallbackRegistrationFailed(int); | 
|  | 280 | method public void onServiceInfoCallbackUnregistered(); | 
|  | 281 | method public void onServiceLost(); | 
|  | 282 | method public void onServiceUpdated(@NonNull android.net.nsd.NsdServiceInfo); | 
|  | 283 | } | 
|  | 284 |  | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 285 | public final class NsdServiceInfo implements android.os.Parcelable { | 
|  | 286 | ctor public NsdServiceInfo(); | 
|  | 287 | method public int describeContents(); | 
|  | 288 | method public java.util.Map<java.lang.String,byte[]> getAttributes(); | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 289 | method @Deprecated public java.net.InetAddress getHost(); | 
|  | 290 | method @NonNull public java.util.List<java.net.InetAddress> getHostAddresses(); | 
| Remi NGUYEN VAN | 06bdcec | 2021-12-16 15:24:41 +0900 | [diff] [blame] | 291 | method @Nullable public android.net.Network getNetwork(); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 292 | method public int getPort(); | 
|  | 293 | method public String getServiceName(); | 
|  | 294 | method public String getServiceType(); | 
| Kangping Dong | 6d618d7 | 2023-12-08 15:49:00 +0800 | [diff] [blame] | 295 | method @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") @NonNull public java.util.Set<java.lang.String> getSubtypes(); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 296 | method public void removeAttribute(String); | 
|  | 297 | method public void setAttribute(String, String); | 
| Paul Hu | 18aeccc | 2022-12-27 08:48:48 +0000 | [diff] [blame] | 298 | method @Deprecated public void setHost(java.net.InetAddress); | 
|  | 299 | method public void setHostAddresses(@NonNull java.util.List<java.net.InetAddress>); | 
| Remi NGUYEN VAN | 06bdcec | 2021-12-16 15:24:41 +0900 | [diff] [blame] | 300 | method public void setNetwork(@Nullable android.net.Network); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 301 | method public void setPort(int); | 
|  | 302 | method public void setServiceName(String); | 
|  | 303 | method public void setServiceType(String); | 
| Kangping Dong | 6d618d7 | 2023-12-08 15:49:00 +0800 | [diff] [blame] | 304 | method @FlaggedApi("com.android.net.flags.nsd_subtypes_support_enabled") public void setSubtypes(@NonNull java.util.Set<java.lang.String>); | 
| paulhu | 802ab97 | 2021-12-14 01:30:22 +0000 | [diff] [blame] | 305 | method public void writeToParcel(android.os.Parcel, int); | 
|  | 306 | field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.NsdServiceInfo> CREATOR; | 
|  | 307 | } | 
|  | 308 |  | 
|  | 309 | } | 
|  | 310 |  |