blob: 64762b40500e52d62c12b6ff0b5b4ed6a992dc7d [file] [log] [blame]
paulhu667e8fb2021-12-14 01:30:22 +00001// Signature format: 2.0
Junyu Lai2ef865e2022-01-17 11:52:57 +00002package android.app.usage {
3
4 public class NetworkStatsManager {
junyulaib59e5422022-03-01 17:08:01 +08005 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void registerNetworkStatsProvider(@NonNull String, @NonNull android.net.netstats.provider.NetworkStatsProvider);
6 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void unregisterNetworkStatsProvider(@NonNull android.net.netstats.provider.NetworkStatsProvider);
Junyu Lai2ef865e2022-01-17 11:52:57 +00007 }
8
9}
10
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +090011package android.nearby {
12
Wei Wangb15b5a82022-02-01 17:08:08 -080013 public interface BroadcastCallback {
Wei Wang88c48442022-03-05 12:14:12 -080014 method public void onStatusChanged(int);
Wei Wangb15b5a82022-02-01 17:08:08 -080015 field public static final int STATUS_FAILURE = 1; // 0x1
16 field public static final int STATUS_FAILURE_ALREADY_REGISTERED = 2; // 0x2
17 field public static final int STATUS_FAILURE_MISSING_PERMISSIONS = 4; // 0x4
18 field public static final int STATUS_FAILURE_SIZE_EXCEED_LIMIT = 3; // 0x3
19 field public static final int STATUS_OK = 0; // 0x0
20 }
21
Wei Wang24e2cb22022-03-12 12:15:34 -080022 public abstract class BroadcastRequest {
Wei Wangb15b5a82022-02-01 17:08:08 -080023 method @NonNull public java.util.List<java.lang.Integer> getMediums();
24 method @IntRange(from=0xffffff81, to=126) public int getTxPower();
25 method public int getType();
26 method public int getVersion();
Wei Wangb15b5a82022-02-01 17:08:08 -080027 field public static final int BROADCAST_TYPE_NEARBY_PRESENCE = 3; // 0x3
Wei Wang88c48442022-03-05 12:14:12 -080028 field public static final int BROADCAST_TYPE_UNKNOWN = -1; // 0xffffffff
Wei Wangf5bb26f2022-03-25 10:30:06 -070029 field public static final int MEDIUM_BLE = 1; // 0x1
Wei Wang88c48442022-03-05 12:14:12 -080030 field public static final int PRESENCE_VERSION_UNKNOWN = -1; // 0xffffffff
Wei Wangb15b5a82022-02-01 17:08:08 -080031 field public static final int PRESENCE_VERSION_V0 = 0; // 0x0
32 field public static final int PRESENCE_VERSION_V1 = 1; // 0x1
Wei Wang88c48442022-03-05 12:14:12 -080033 field public static final int UNKNOWN_TX_POWER = -127; // 0xffffff81
Wei Wangb15b5a82022-02-01 17:08:08 -080034 }
35
36 public final class CredentialElement implements android.os.Parcelable {
37 ctor public CredentialElement(@NonNull String, @NonNull byte[]);
38 method public int describeContents();
39 method @NonNull public String getKey();
40 method @NonNull public byte[] getValue();
41 method public void writeToParcel(@NonNull android.os.Parcel, int);
42 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.CredentialElement> CREATOR;
43 }
44
45 public final class DataElement implements android.os.Parcelable {
46 ctor public DataElement(int, @NonNull byte[]);
47 method public int describeContents();
48 method public int getKey();
49 method @NonNull public byte[] getValue();
50 method public void writeToParcel(@NonNull android.os.Parcel, int);
51 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.DataElement> CREATOR;
52 }
53
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +090054 public abstract class NearbyDevice {
Wei Wangb15b5a82022-02-01 17:08:08 -080055 method @NonNull public java.util.List<java.lang.Integer> getMediums();
56 method @Nullable public String getName();
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +090057 method @IntRange(from=0xffffff81, to=126) public int getRssi();
58 method public static boolean isValidMedium(int);
59 }
60
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +090061 public class NearbyManager {
Xinyi Zhoub4efda82022-03-15 18:22:35 -070062 method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startBroadcast(@NonNull android.nearby.BroadcastRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.BroadcastCallback);
63 method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int startScan(@NonNull android.nearby.ScanRequest, @NonNull java.util.concurrent.Executor, @NonNull android.nearby.ScanCallback);
64 method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopBroadcast(@NonNull android.nearby.BroadcastCallback);
65 method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopScan(@NonNull android.nearby.ScanCallback);
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +090066 }
67
Wei Wangb15b5a82022-02-01 17:08:08 -080068 public final class PresenceBroadcastRequest extends android.nearby.BroadcastRequest implements android.os.Parcelable {
Wei Wang24e2cb22022-03-12 12:15:34 -080069 method public int describeContents();
Wei Wangb15b5a82022-02-01 17:08:08 -080070 method @NonNull public java.util.List<java.lang.Integer> getActions();
71 method @NonNull public android.nearby.PrivateCredential getCredential();
72 method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties();
73 method @NonNull public byte[] getSalt();
Wei Wang24e2cb22022-03-12 12:15:34 -080074 method public void writeToParcel(@NonNull android.os.Parcel, int);
Wei Wangb15b5a82022-02-01 17:08:08 -080075 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceBroadcastRequest> CREATOR;
76 }
77
78 public static final class PresenceBroadcastRequest.Builder {
Wei Wang88c48442022-03-05 12:14:12 -080079 ctor public PresenceBroadcastRequest.Builder(@NonNull java.util.List<java.lang.Integer>, @NonNull byte[], @NonNull android.nearby.PrivateCredential);
Wei Wangb15b5a82022-02-01 17:08:08 -080080 method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addAction(@IntRange(from=1, to=255) int);
81 method @NonNull public android.nearby.PresenceBroadcastRequest.Builder addExtendedProperty(@NonNull android.nearby.DataElement);
82 method @NonNull public android.nearby.PresenceBroadcastRequest build();
Wei Wangb15b5a82022-02-01 17:08:08 -080083 method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setTxPower(@IntRange(from=0xffffff81, to=126) int);
84 method @NonNull public android.nearby.PresenceBroadcastRequest.Builder setVersion(int);
85 }
86
Wei Wang24e2cb22022-03-12 12:15:34 -080087 public abstract class PresenceCredential {
Wei Wangb15b5a82022-02-01 17:08:08 -080088 method @NonNull public byte[] getAuthenticityKey();
89 method @NonNull public java.util.List<android.nearby.CredentialElement> getCredentialElements();
90 method public int getIdentityType();
91 method @NonNull public byte[] getSecretId();
92 method public int getType();
Wei Wangb15b5a82022-02-01 17:08:08 -080093 field public static final int CREDENTIAL_TYPE_PRIVATE = 0; // 0x0
94 field public static final int CREDENTIAL_TYPE_PUBLIC = 1; // 0x1
95 field public static final int IDENTITY_TYPE_PRIVATE = 1; // 0x1
96 field public static final int IDENTITY_TYPE_PROVISIONED = 2; // 0x2
Wei Wangb15b5a82022-02-01 17:08:08 -080097 field public static final int IDENTITY_TYPE_TRUSTED = 3; // 0x3
98 field public static final int IDENTITY_TYPE_UNKNOWN = 0; // 0x0
99 }
100
101 public final class PresenceDevice extends android.nearby.NearbyDevice implements android.os.Parcelable {
102 method public int describeContents();
103 method @NonNull public String getDeviceId();
104 method @Nullable public String getDeviceImageUrl();
105 method public int getDeviceType();
106 method public long getDiscoveryTimestampMillis();
107 method @NonNull public byte[] getEncryptedIdentity();
108 method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties();
109 method @NonNull public byte[] getSalt();
110 method @NonNull public byte[] getSecretId();
111 method public void writeToParcel(@NonNull android.os.Parcel, int);
112 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceDevice> CREATOR;
113 }
114
115 public static final class PresenceDevice.Builder {
Wei Wang88c48442022-03-05 12:14:12 -0800116 ctor public PresenceDevice.Builder(@NonNull String, @NonNull byte[], @NonNull byte[], @NonNull byte[]);
Wei Wangb15b5a82022-02-01 17:08:08 -0800117 method @NonNull public android.nearby.PresenceDevice.Builder addExtendedProperty(@NonNull android.nearby.DataElement);
118 method @NonNull public android.nearby.PresenceDevice.Builder addMedium(int);
119 method @NonNull public android.nearby.PresenceDevice build();
Wei Wangb15b5a82022-02-01 17:08:08 -0800120 method @NonNull public android.nearby.PresenceDevice.Builder setDeviceImageUrl(@Nullable String);
121 method @NonNull public android.nearby.PresenceDevice.Builder setDeviceType(int);
122 method @NonNull public android.nearby.PresenceDevice.Builder setDiscoveryTimestampMillis(long);
Wei Wangb15b5a82022-02-01 17:08:08 -0800123 method @NonNull public android.nearby.PresenceDevice.Builder setName(@Nullable String);
124 method @NonNull public android.nearby.PresenceDevice.Builder setRssi(int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800125 }
126
127 public final class PresenceScanFilter extends android.nearby.ScanFilter implements android.os.Parcelable {
Wei Wang24e2cb22022-03-12 12:15:34 -0800128 method public int describeContents();
Wei Wangb15b5a82022-02-01 17:08:08 -0800129 method @NonNull public java.util.List<android.nearby.PublicCredential> getCredentials();
130 method @NonNull public java.util.List<android.nearby.DataElement> getExtendedProperties();
131 method @NonNull public java.util.List<java.lang.Integer> getPresenceActions();
Wei Wang24e2cb22022-03-12 12:15:34 -0800132 method public void writeToParcel(@NonNull android.os.Parcel, int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800133 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PresenceScanFilter> CREATOR;
134 }
135
136 public static final class PresenceScanFilter.Builder {
137 ctor public PresenceScanFilter.Builder();
138 method @NonNull public android.nearby.PresenceScanFilter.Builder addCredential(@NonNull android.nearby.PublicCredential);
139 method @NonNull public android.nearby.PresenceScanFilter.Builder addExtendedProperty(@NonNull android.nearby.DataElement);
140 method @NonNull public android.nearby.PresenceScanFilter.Builder addPresenceAction(@IntRange(from=1, to=255) int);
141 method @NonNull public android.nearby.PresenceScanFilter build();
142 method @NonNull public android.nearby.PresenceScanFilter.Builder setMaxPathLoss(@IntRange(from=0, to=127) int);
143 }
144
145 public final class PrivateCredential extends android.nearby.PresenceCredential implements android.os.Parcelable {
Wei Wang24e2cb22022-03-12 12:15:34 -0800146 method public int describeContents();
Wei Wangb15b5a82022-02-01 17:08:08 -0800147 method @NonNull public String getDeviceName();
148 method @NonNull public byte[] getMetadataEncryptionKey();
Wei Wang24e2cb22022-03-12 12:15:34 -0800149 method public void writeToParcel(@NonNull android.os.Parcel, int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800150 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PrivateCredential> CREATOR;
151 }
152
153 public static final class PrivateCredential.Builder {
Wei Wang24e2cb22022-03-12 12:15:34 -0800154 ctor public PrivateCredential.Builder(@NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull String);
Wei Wangb15b5a82022-02-01 17:08:08 -0800155 method @NonNull public android.nearby.PrivateCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement);
156 method @NonNull public android.nearby.PrivateCredential build();
Wei Wangb15b5a82022-02-01 17:08:08 -0800157 method @NonNull public android.nearby.PrivateCredential.Builder setIdentityType(int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800158 }
159
160 public final class PublicCredential extends android.nearby.PresenceCredential implements android.os.Parcelable {
Wei Wang24e2cb22022-03-12 12:15:34 -0800161 method public int describeContents();
Wei Wangb15b5a82022-02-01 17:08:08 -0800162 method @NonNull public byte[] getEncryptedMetadata();
163 method @NonNull public byte[] getEncryptedMetadataKeyTag();
164 method @NonNull public byte[] getPublicKey();
Wei Wang24e2cb22022-03-12 12:15:34 -0800165 method public void writeToParcel(@NonNull android.os.Parcel, int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800166 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.PublicCredential> CREATOR;
167 }
168
169 public static final class PublicCredential.Builder {
Wei Wang24e2cb22022-03-12 12:15:34 -0800170 ctor public PublicCredential.Builder(@NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull byte[], @NonNull byte[]);
Wei Wangb15b5a82022-02-01 17:08:08 -0800171 method @NonNull public android.nearby.PublicCredential.Builder addCredentialElement(@NonNull android.nearby.CredentialElement);
172 method @NonNull public android.nearby.PublicCredential build();
Wei Wangb15b5a82022-02-01 17:08:08 -0800173 method @NonNull public android.nearby.PublicCredential.Builder setIdentityType(int);
Wei Wangb15b5a82022-02-01 17:08:08 -0800174 }
175
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900176 public interface ScanCallback {
177 method public void onDiscovered(@NonNull android.nearby.NearbyDevice);
178 method public void onLost(@NonNull android.nearby.NearbyDevice);
179 method public void onUpdated(@NonNull android.nearby.NearbyDevice);
180 }
181
Wei Wang24e2cb22022-03-12 12:15:34 -0800182 public abstract class ScanFilter {
Wei Wangb15b5a82022-02-01 17:08:08 -0800183 method @IntRange(from=0, to=127) public int getMaxPathLoss();
184 method public int getType();
Wei Wangb15b5a82022-02-01 17:08:08 -0800185 }
186
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900187 public final class ScanRequest implements android.os.Parcelable {
188 method public int describeContents();
Wei Wangb15b5a82022-02-01 17:08:08 -0800189 method @NonNull public java.util.List<android.nearby.ScanFilter> getScanFilters();
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900190 method public int getScanMode();
191 method public int getScanType();
192 method @NonNull public android.os.WorkSource getWorkSource();
Xinyi Zhouff987502022-03-09 17:38:41 -0800193 method public boolean isBleEnabled();
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900194 method public static boolean isValidScanMode(int);
195 method public static boolean isValidScanType(int);
196 method @NonNull public static String scanModeToString(int);
197 method public void writeToParcel(@NonNull android.os.Parcel, int);
198 field @NonNull public static final android.os.Parcelable.Creator<android.nearby.ScanRequest> CREATOR;
199 field public static final int SCAN_MODE_BALANCED = 1; // 0x1
200 field public static final int SCAN_MODE_LOW_LATENCY = 2; // 0x2
201 field public static final int SCAN_MODE_LOW_POWER = 0; // 0x0
202 field public static final int SCAN_MODE_NO_POWER = -1; // 0xffffffff
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900203 field public static final int SCAN_TYPE_FAST_PAIR = 1; // 0x1
Chun Zhange4440de2022-03-24 22:40:56 -0700204 field public static final int SCAN_TYPE_NEARBY_PRESENCE = 2; // 0x2
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900205 }
206
207 public static final class ScanRequest.Builder {
208 ctor public ScanRequest.Builder();
Wei Wangb15b5a82022-02-01 17:08:08 -0800209 method @NonNull public android.nearby.ScanRequest.Builder addScanFilter(@NonNull android.nearby.ScanFilter);
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900210 method @NonNull public android.nearby.ScanRequest build();
Xinyi Zhouff987502022-03-09 17:38:41 -0800211 method @NonNull public android.nearby.ScanRequest.Builder setBleEnabled(boolean);
Remi NGUYEN VAN51935fc2022-01-07 13:18:54 +0900212 method @NonNull public android.nearby.ScanRequest.Builder setScanMode(int);
213 method @NonNull public android.nearby.ScanRequest.Builder setScanType(int);
214 method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public android.nearby.ScanRequest.Builder setWorkSource(@Nullable android.os.WorkSource);
215 }
216
217}
218
Aaron Huang68ca3732022-01-06 19:30:43 +0800219package android.net {
220
Xiao Maeaaf7d32022-01-23 16:14:51 +0000221 public class EthernetManager {
Patrick Rohrfa376a52022-03-16 20:16:09 +0100222 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void disableInterface(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>);
223 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void enableInterface(@NonNull String, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>);
Xiao Maeaaf7d32022-01-23 16:14:51 +0000224 method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public android.net.EthernetManager.TetheredInterfaceRequest requestTetheredInterface(@NonNull java.util.concurrent.Executor, @NonNull android.net.EthernetManager.TetheredInterfaceCallback);
Patrick Rohrc551ebb2022-03-16 20:15:18 +0100225 method @RequiresPermission(anyOf={android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK, android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}) public void updateConfiguration(@NonNull String, @NonNull android.net.EthernetNetworkUpdateRequest, @Nullable java.util.concurrent.Executor, @Nullable android.os.OutcomeReceiver<java.lang.String,android.net.EthernetNetworkManagementException>);
Xiao Maeaaf7d32022-01-23 16:14:51 +0000226 }
227
228 public static interface EthernetManager.TetheredInterfaceCallback {
229 method public void onAvailable(@NonNull String);
230 method public void onUnavailable();
231 }
232
233 public static class EthernetManager.TetheredInterfaceRequest {
234 method public void release();
235 }
236
237 public final class EthernetNetworkManagementException extends java.lang.RuntimeException implements android.os.Parcelable {
238 ctor public EthernetNetworkManagementException(@NonNull String);
239 method public int describeContents();
240 method public void writeToParcel(@NonNull android.os.Parcel, int);
241 field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkManagementException> CREATOR;
242 }
243
244 public final class EthernetNetworkUpdateRequest implements android.os.Parcelable {
245 method public int describeContents();
Patrick Rohr8a910f42022-03-16 20:07:23 +0100246 method @Nullable public android.net.IpConfiguration getIpConfiguration();
Xiao Maeaaf7d32022-01-23 16:14:51 +0000247 method @Nullable public android.net.NetworkCapabilities getNetworkCapabilities();
248 method public void writeToParcel(@NonNull android.os.Parcel, int);
249 field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkUpdateRequest> CREATOR;
250 }
251
252 public static final class EthernetNetworkUpdateRequest.Builder {
253 ctor public EthernetNetworkUpdateRequest.Builder();
254 ctor public EthernetNetworkUpdateRequest.Builder(@NonNull android.net.EthernetNetworkUpdateRequest);
255 method @NonNull public android.net.EthernetNetworkUpdateRequest build();
Patrick Rohr8a910f42022-03-16 20:07:23 +0100256 method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setIpConfiguration(@Nullable android.net.IpConfiguration);
Xiao Maeaaf7d32022-01-23 16:14:51 +0000257 method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setNetworkCapabilities(@Nullable android.net.NetworkCapabilities);
258 }
259
Yan Yanf8063e32022-02-08 19:26:29 -0800260 public class IpSecManager {
Aaron Huang68ca3732022-01-06 19:30:43 +0800261 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void applyTunnelModeTransform(@NonNull android.net.IpSecManager.IpSecTunnelInterface, int, @NonNull android.net.IpSecTransform) throws java.io.IOException;
262 method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecManager.IpSecTunnelInterface createIpSecTunnelInterface(@NonNull java.net.InetAddress, @NonNull java.net.InetAddress, @NonNull android.net.Network) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException;
Yan Yan81c21602022-10-20 22:23:15 +0000263 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void startTunnelModeTransformMigration(@NonNull android.net.IpSecTransform, @NonNull java.net.InetAddress, @NonNull java.net.InetAddress);
Aaron Huang68ca3732022-01-06 19:30:43 +0800264 }
265
266 public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable {
267 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
268 method public void close();
269 method @NonNull public String getInterfaceName();
270 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
271 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void setUnderlyingNetwork(@NonNull android.net.Network) throws java.io.IOException;
272 }
273
274 public static class IpSecTransform.Builder {
275 method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public android.net.IpSecTransform buildTunnelModeTransform(@NonNull java.net.InetAddress, @NonNull android.net.IpSecManager.SecurityParameterIndex) throws java.io.IOException, android.net.IpSecManager.ResourceUnavailableException, android.net.IpSecManager.SpiUnavailableException;
276 }
277
Junyu Lai2ef865e2022-01-17 11:52:57 +0000278 public final class NetworkStats implements java.lang.Iterable<android.net.NetworkStats.Entry> android.os.Parcelable {
279 ctor public NetworkStats(long, int);
280 method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats);
281 method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry);
282 method public int describeContents();
junyulai68016902022-03-28 15:39:12 +0800283 method @NonNull public java.util.Iterator<android.net.NetworkStats.Entry> iterator();
Junyu Lai2ef865e2022-01-17 11:52:57 +0000284 method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats);
285 method public void writeToParcel(@NonNull android.os.Parcel, int);
286 field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR;
287 field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff
288 field public static final int DEFAULT_NETWORK_NO = 0; // 0x0
289 field public static final int DEFAULT_NETWORK_YES = 1; // 0x1
290 field public static final String IFACE_VT = "vt_data0";
291 field public static final int METERED_ALL = -1; // 0xffffffff
292 field public static final int METERED_NO = 0; // 0x0
293 field public static final int METERED_YES = 1; // 0x1
294 field public static final int ROAMING_ALL = -1; // 0xffffffff
295 field public static final int ROAMING_NO = 0; // 0x0
296 field public static final int ROAMING_YES = 1; // 0x1
297 field public static final int SET_ALL = -1; // 0xffffffff
298 field public static final int SET_DEFAULT = 0; // 0x0
299 field public static final int SET_FOREGROUND = 1; // 0x1
300 field public static final int TAG_NONE = 0; // 0x0
301 field public static final int UID_ALL = -1; // 0xffffffff
302 field public static final int UID_TETHERING = -5; // 0xfffffffb
303 }
304
305 public static class NetworkStats.Entry {
306 ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long);
junyulai68016902022-03-28 15:39:12 +0800307 method public int getDefaultNetwork();
308 method public int getMetered();
309 method public long getOperations();
310 method public int getRoaming();
311 method public long getRxBytes();
312 method public long getRxPackets();
313 method public int getSet();
314 method public int getTag();
315 method public long getTxBytes();
316 method public long getTxPackets();
317 method public int getUid();
Junyu Lai2ef865e2022-01-17 11:52:57 +0000318 }
319
320 public class TrafficStats {
321 method public static void setThreadStatsTagApp();
322 method public static void setThreadStatsTagBackup();
Junyu Lai2ef865e2022-01-17 11:52:57 +0000323 method public static void setThreadStatsTagRestore();
324 field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f
325 field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80
326 field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff
327 field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00
328 field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f
329 field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00
330 }
331
332}
333
334package android.net.netstats.provider {
335
336 public abstract class NetworkStatsProvider {
337 ctor public NetworkStatsProvider();
338 method public void notifyAlertReached();
339 method public void notifyLimitReached();
340 method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
341 method public void notifyWarningReached();
342 method public abstract void onRequestStatsUpdate(int);
343 method public abstract void onSetAlert(long);
344 method public abstract void onSetLimit(@NonNull String, long);
345 method public void onSetWarningAndLimit(@NonNull String, long, long);
346 field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
347 }
348
Aaron Huang68ca3732022-01-06 19:30:43 +0800349}
350
Yuyang Huang00cf7ed2023-05-15 10:54:07 +0900351package android.net.nsd {
352
353 public final class NsdManager {
354 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void registerOffloadEngine(@NonNull String, long, long, @NonNull java.util.concurrent.Executor, @NonNull android.net.nsd.OffloadEngine);
355 method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK, android.Manifest.permission.NETWORK_STACK}) public void unregisterOffloadEngine(@NonNull android.net.nsd.OffloadEngine);
356 }
357
358 public interface OffloadEngine {
359 method public void onOffloadServiceRemoved(@NonNull android.net.nsd.OffloadServiceInfo);
360 method public void onOffloadServiceUpdated(@NonNull android.net.nsd.OffloadServiceInfo);
361 field public static final int OFFLOAD_CAPABILITY_BYPASS_MULTICAST_LOCK = 1; // 0x1
362 field public static final int OFFLOAD_TYPE_FILTER_QUERIES = 2; // 0x2
363 field public static final int OFFLOAD_TYPE_FILTER_REPLIES = 4; // 0x4
364 field public static final int OFFLOAD_TYPE_REPLY = 1; // 0x1
365 }
366
367 public final class OffloadServiceInfo implements android.os.Parcelable {
368 ctor public OffloadServiceInfo(@NonNull android.net.nsd.OffloadServiceInfo.Key, @NonNull java.util.List<java.lang.String>, @NonNull String, @Nullable byte[], @IntRange(from=0, to=java.lang.Integer.MAX_VALUE) int, long);
369 method public int describeContents();
370 method @NonNull public String getHostname();
371 method @NonNull public android.net.nsd.OffloadServiceInfo.Key getKey();
372 method @Nullable public byte[] getOffloadPayload();
373 method public long getOffloadType();
374 method public int getPriority();
375 method @NonNull public java.util.List<java.lang.String> getSubtypes();
376 method public void writeToParcel(@NonNull android.os.Parcel, int);
377 field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.OffloadServiceInfo> CREATOR;
378 }
379
380 public static final class OffloadServiceInfo.Key implements android.os.Parcelable {
381 ctor public OffloadServiceInfo.Key(@NonNull String, @NonNull String);
382 method public int describeContents();
383 method @NonNull public String getServiceName();
384 method @NonNull public String getServiceType();
385 method public void writeToParcel(@NonNull android.os.Parcel, int);
386 field @NonNull public static final android.os.Parcelable.Creator<android.net.nsd.OffloadServiceInfo.Key> CREATOR;
387 }
388
389}
390