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 class NetworkStatsManager { |
junyulai | dd1d024 | 2022-03-01 17:08:01 +0800 | [diff] [blame] | 5 | 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 Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 7 | } |
| 8 | |
| 9 | } |
| 10 | |
Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 11 | package android.net { |
| 12 | |
Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 13 | public class EthernetManager { |
Patrick Rohr | a873f58 | 2022-03-16 20:16:09 +0100 | [diff] [blame] | 14 | 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>); |
| 15 | 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 Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 16 | 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 Rohr | 2cef8f1 | 2022-03-17 19:19:21 +0000 | [diff] [blame] | 17 | 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 Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | public static interface EthernetManager.TetheredInterfaceCallback { |
| 21 | method public void onAvailable(@NonNull String); |
| 22 | method public void onUnavailable(); |
| 23 | } |
| 24 | |
| 25 | public static class EthernetManager.TetheredInterfaceRequest { |
| 26 | method public void release(); |
| 27 | } |
| 28 | |
| 29 | public final class EthernetNetworkManagementException extends java.lang.RuntimeException implements android.os.Parcelable { |
| 30 | ctor public EthernetNetworkManagementException(@NonNull String); |
| 31 | method public int describeContents(); |
| 32 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 33 | field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkManagementException> CREATOR; |
| 34 | } |
| 35 | |
| 36 | public final class EthernetNetworkUpdateRequest implements android.os.Parcelable { |
| 37 | method public int describeContents(); |
Patrick Rohr | 8a910f4 | 2022-03-16 20:07:23 +0100 | [diff] [blame] | 38 | method @Nullable public android.net.IpConfiguration getIpConfiguration(); |
Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 39 | method @Nullable public android.net.NetworkCapabilities getNetworkCapabilities(); |
| 40 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 41 | field @NonNull public static final android.os.Parcelable.Creator<android.net.EthernetNetworkUpdateRequest> CREATOR; |
| 42 | } |
| 43 | |
| 44 | public static final class EthernetNetworkUpdateRequest.Builder { |
| 45 | ctor public EthernetNetworkUpdateRequest.Builder(); |
| 46 | ctor public EthernetNetworkUpdateRequest.Builder(@NonNull android.net.EthernetNetworkUpdateRequest); |
| 47 | method @NonNull public android.net.EthernetNetworkUpdateRequest build(); |
Patrick Rohr | 8a910f4 | 2022-03-16 20:07:23 +0100 | [diff] [blame] | 48 | method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setIpConfiguration(@Nullable android.net.IpConfiguration); |
Xiao Ma | 0a171c0 | 2022-01-23 16:14:51 +0000 | [diff] [blame] | 49 | method @NonNull public android.net.EthernetNetworkUpdateRequest.Builder setNetworkCapabilities(@Nullable android.net.NetworkCapabilities); |
| 50 | } |
| 51 | |
Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 52 | public class IpSecManager { |
| 53 | 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; |
| 54 | 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; |
| 55 | } |
| 56 | |
| 57 | public static final class IpSecManager.IpSecTunnelInterface implements java.lang.AutoCloseable { |
| 58 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void addAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; |
| 59 | method public void close(); |
| 60 | method @NonNull public String getInterfaceName(); |
| 61 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void removeAddress(@NonNull java.net.InetAddress, int) throws java.io.IOException; |
| 62 | method @RequiresPermission(android.Manifest.permission.MANAGE_IPSEC_TUNNELS) public void setUnderlyingNetwork(@NonNull android.net.Network) throws java.io.IOException; |
| 63 | } |
| 64 | |
| 65 | public static class IpSecTransform.Builder { |
| 66 | 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; |
| 67 | } |
| 68 | |
Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 69 | public final class NetworkStats implements java.lang.Iterable<android.net.NetworkStats.Entry> android.os.Parcelable { |
| 70 | ctor public NetworkStats(long, int); |
| 71 | method @NonNull public android.net.NetworkStats add(@NonNull android.net.NetworkStats); |
| 72 | method @NonNull public android.net.NetworkStats addEntry(@NonNull android.net.NetworkStats.Entry); |
| 73 | method public int describeContents(); |
junyulai | 0f54d64 | 2022-03-28 15:39:12 +0800 | [diff] [blame] | 74 | method @NonNull public java.util.Iterator<android.net.NetworkStats.Entry> iterator(); |
Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 75 | method @NonNull public android.net.NetworkStats subtract(@NonNull android.net.NetworkStats); |
| 76 | method public void writeToParcel(@NonNull android.os.Parcel, int); |
| 77 | field @NonNull public static final android.os.Parcelable.Creator<android.net.NetworkStats> CREATOR; |
| 78 | field public static final int DEFAULT_NETWORK_ALL = -1; // 0xffffffff |
| 79 | field public static final int DEFAULT_NETWORK_NO = 0; // 0x0 |
| 80 | field public static final int DEFAULT_NETWORK_YES = 1; // 0x1 |
| 81 | field public static final String IFACE_VT = "vt_data0"; |
| 82 | field public static final int METERED_ALL = -1; // 0xffffffff |
| 83 | field public static final int METERED_NO = 0; // 0x0 |
| 84 | field public static final int METERED_YES = 1; // 0x1 |
| 85 | field public static final int ROAMING_ALL = -1; // 0xffffffff |
| 86 | field public static final int ROAMING_NO = 0; // 0x0 |
| 87 | field public static final int ROAMING_YES = 1; // 0x1 |
| 88 | field public static final int SET_ALL = -1; // 0xffffffff |
| 89 | field public static final int SET_DEFAULT = 0; // 0x0 |
| 90 | field public static final int SET_FOREGROUND = 1; // 0x1 |
| 91 | field public static final int TAG_NONE = 0; // 0x0 |
| 92 | field public static final int UID_ALL = -1; // 0xffffffff |
| 93 | field public static final int UID_TETHERING = -5; // 0xfffffffb |
| 94 | } |
| 95 | |
| 96 | public static class NetworkStats.Entry { |
| 97 | ctor public NetworkStats.Entry(@Nullable String, int, int, int, int, int, int, long, long, long, long, long); |
junyulai | 0f54d64 | 2022-03-28 15:39:12 +0800 | [diff] [blame] | 98 | method public int getDefaultNetwork(); |
| 99 | method public int getMetered(); |
| 100 | method public long getOperations(); |
| 101 | method public int getRoaming(); |
| 102 | method public long getRxBytes(); |
| 103 | method public long getRxPackets(); |
| 104 | method public int getSet(); |
| 105 | method public int getTag(); |
| 106 | method public long getTxBytes(); |
| 107 | method public long getTxPackets(); |
| 108 | method public int getUid(); |
Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | public class TrafficStats { |
| 112 | method public static void setThreadStatsTagApp(); |
| 113 | method public static void setThreadStatsTagBackup(); |
Junyu Lai | eb6f4be | 2022-01-17 11:52:57 +0000 | [diff] [blame] | 114 | method public static void setThreadStatsTagRestore(); |
| 115 | field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_END = -113; // 0xffffff8f |
| 116 | field public static final int TAG_NETWORK_STACK_IMPERSONATION_RANGE_START = -128; // 0xffffff80 |
| 117 | field public static final int TAG_NETWORK_STACK_RANGE_END = -257; // 0xfffffeff |
| 118 | field public static final int TAG_NETWORK_STACK_RANGE_START = -768; // 0xfffffd00 |
| 119 | field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_END = -241; // 0xffffff0f |
| 120 | field public static final int TAG_SYSTEM_IMPERSONATION_RANGE_START = -256; // 0xffffff00 |
| 121 | } |
| 122 | |
| 123 | } |
| 124 | |
| 125 | package android.net.netstats.provider { |
| 126 | |
| 127 | public abstract class NetworkStatsProvider { |
| 128 | ctor public NetworkStatsProvider(); |
| 129 | method public void notifyAlertReached(); |
| 130 | method public void notifyLimitReached(); |
| 131 | method public void notifyStatsUpdated(int, @NonNull android.net.NetworkStats, @NonNull android.net.NetworkStats); |
| 132 | method public void notifyWarningReached(); |
| 133 | method public abstract void onRequestStatsUpdate(int); |
| 134 | method public abstract void onSetAlert(long); |
| 135 | method public abstract void onSetLimit(@NonNull String, long); |
| 136 | method public void onSetWarningAndLimit(@NonNull String, long, long); |
| 137 | field public static final int QUOTA_UNLIMITED = -1; // 0xffffffff |
| 138 | } |
| 139 | |
Aaron Huang | 2e778ee | 2022-01-06 19:30:43 +0800 | [diff] [blame] | 140 | } |
| 141 | |