blob: bc9c1b44b46c862cedf8fef749a1f544fe1b3c3d [file] [log] [blame]
paulhu802ab972021-12-14 01:30:22 +00001// Signature format: 2.0
Junyu Laieb6f4be2022-01-17 11:52:57 +00002package android.app.usage {
3
4 public class NetworkStatsManager {
5 method @NonNull @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public android.net.NetworkStats getMobileUidStats();
6 method @NonNull @RequiresPermission(android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK) public android.net.NetworkStats getWifiUidStats();
7 method @NonNull @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);
8 method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STATS_PROVIDER, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public void unregisterNetworkStatsProvider(@NonNull android.net.netstats.provider.NetworkStatsProvider);
9 }
10
11}
12
Aaron Huang2e778ee2022-01-06 19:30:43 +080013package android.net {
14
15 public class IpSecManager {
16 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;
17 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;
18 }
19
20 public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable {
21 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
22 method public void close();
23 method @NonNull public String getInterfaceName();
24 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException;
25 method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void setUnderlyingNetwork(@NonNull android.net.Network) throws java.io.IOException;
26 }
27
28 public static class IpSecTransform.Builder {
29 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;
30 }
31
Junyu Laieb6f4be2022-01-17 11:52:57 +000032 public final class NetworkStats implements java.lang.Iterable<android.net.NetworkStats.Entry> android.os.Parcelable {
33 ctor public NetworkStats(long, int);
34 method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats);
35 method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry);
36 method public int describeContents();
37 method @NonNull public java.util.Iterator<android.net.NetworkStats.Entry> iterator();
38 method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats);
39 method public void writeToParcel(@NonNull android.os.Parcel, int);
40 field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR;
41 field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff
42 field public static final int DEFAULT_NETWORK_NO = 0; // 0x0
43 field public static final int DEFAULT_NETWORK_YES = 1; // 0x1
44 field public static final String IFACE_VT = "vt_data0";
45 field public static final int METERED_ALL = -1; // 0xffffffff
46 field public static final int METERED_NO = 0; // 0x0
47 field public static final int METERED_YES = 1; // 0x1
48 field public static final int ROAMING_ALL = -1; // 0xffffffff
49 field public static final int ROAMING_NO = 0; // 0x0
50 field public static final int ROAMING_YES = 1; // 0x1
51 field public static final int SET_ALL = -1; // 0xffffffff
52 field public static final int SET_DEFAULT = 0; // 0x0
53 field public static final int SET_FOREGROUND = 1; // 0x1
54 field public static final int TAG_NONE = 0; // 0x0
55 field public static final int UID_ALL = -1; // 0xffffffff
56 field public static final int UID_TETHERING = -5; // 0xfffffffb
57 }
58
59 public static class NetworkStats.Entry {
60 ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long);
61 method public int getDefaultNetwork();
62 method public int getMetered();
63 method public long getOperations();
64 method public int getRoaming();
65 method public long getRxBytes();
66 method public long getRxPackets();
67 method public int getSet();
68 method public int getTag();
69 method public long getTxBytes();
70 method public long getTxPackets();
71 method public int getUid();
72 }
73
74 public class TrafficStats {
75 method public static void setThreadStatsTagApp();
76 method public static void setThreadStatsTagBackup();
77 method public static void setThreadStatsTagDownload();
78 method public static void setThreadStatsTagRestore();
79 field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f
80 field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80
81 field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff
82 field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00
83 field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f
84 field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00
85 }
86
87}
88
89package android.net.netstats.provider {
90
91 public abstract class NetworkStatsProvider {
92 ctor public NetworkStatsProvider();
93 method public void notifyAlertReached();
94 method public void notifyLimitReached();
95 method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats);
96 method public void notifyWarningReached();
97 method public abstract void onRequestStatsUpdate(int);
98 method public abstract void onSetAlert(long);
99 method public abstract void onSetLimit(@NonNull String, long);
100 method public void onSetWarningAndLimit(@NonNull String, long, long);
101 field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff
102 }
103
Aaron Huang2e778ee2022-01-06 19:30:43 +0800104}
105