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