Loading core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -30273,6 +30273,7 @@ package android.net { method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); method public static long getMobileTxPackets(); method public static long getRxBytes(@NonNull String); method public static long getRxPackets(@NonNull String); method public static int getThreadStatsTag(); method public static int getThreadStatsUid(); Loading @@ -30280,6 +30281,7 @@ package android.net { method public static long getTotalRxPackets(); method public static long getTotalTxBytes(); method public static long getTotalTxPackets(); method public static long getTxBytes(@NonNull String); method public static long getTxPackets(@NonNull String); method public static long getUidRxBytes(int); method public static long getUidRxPackets(int); core/java/android/net/TrafficStats.java +50 −10 Original line number Diff line number Diff line Loading @@ -597,10 +597,17 @@ public class TrafficStats { } /** * Return the number of packets transmitted on the specified interface since * device boot. Statistics are measured at the network layer, so both TCP and * Return the number of packets transmitted on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP and * UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of transmitted packets. */ Loading @@ -613,10 +620,17 @@ public class TrafficStats { } /** * Return the number of packets received on the specified interface since * device boot. Statistics are measured at the network layer, so both TCP * Return the number of packets received on the specified interface since the interface was * created. Statistics are measured at the network layer, so both TCP * and UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of received packets. */ Loading @@ -628,9 +642,22 @@ public class TrafficStats { } } /** {@hide} */ @UnsupportedAppUsage public static long getTxBytes(String iface) { /** * Return the number of bytes transmitted on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP and * UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of transmitted bytes. */ public static long getTxBytes(@NonNull String iface) { try { return getStatsService().getIfaceStats(iface, TYPE_TX_BYTES); } catch (RemoteException e) { Loading @@ -638,9 +665,22 @@ public class TrafficStats { } } /** {@hide} */ @UnsupportedAppUsage public static long getRxBytes(String iface) { /** * Return the number of bytes received on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP * and UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of received bytes. */ public static long getRxBytes(@NonNull String iface) { try { return getStatsService().getIfaceStats(iface, TYPE_RX_BYTES); } catch (RemoteException e) { Loading Loading
core/api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -30273,6 +30273,7 @@ package android.net { method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); method public static long getMobileTxPackets(); method public static long getRxBytes(@NonNull String); method public static long getRxPackets(@NonNull String); method public static int getThreadStatsTag(); method public static int getThreadStatsUid(); Loading @@ -30280,6 +30281,7 @@ package android.net { method public static long getTotalRxPackets(); method public static long getTotalTxBytes(); method public static long getTotalTxPackets(); method public static long getTxBytes(@NonNull String); method public static long getTxPackets(@NonNull String); method public static long getUidRxBytes(int); method public static long getUidRxPackets(int);
core/java/android/net/TrafficStats.java +50 −10 Original line number Diff line number Diff line Loading @@ -597,10 +597,17 @@ public class TrafficStats { } /** * Return the number of packets transmitted on the specified interface since * device boot. Statistics are measured at the network layer, so both TCP and * Return the number of packets transmitted on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP and * UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of transmitted packets. */ Loading @@ -613,10 +620,17 @@ public class TrafficStats { } /** * Return the number of packets received on the specified interface since * device boot. Statistics are measured at the network layer, so both TCP * Return the number of packets received on the specified interface since the interface was * created. Statistics are measured at the network layer, so both TCP * and UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of received packets. */ Loading @@ -628,9 +642,22 @@ public class TrafficStats { } } /** {@hide} */ @UnsupportedAppUsage public static long getTxBytes(String iface) { /** * Return the number of bytes transmitted on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP and * UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of transmitted bytes. */ public static long getTxBytes(@NonNull String iface) { try { return getStatsService().getIfaceStats(iface, TYPE_TX_BYTES); } catch (RemoteException e) { Loading @@ -638,9 +665,22 @@ public class TrafficStats { } } /** {@hide} */ @UnsupportedAppUsage public static long getRxBytes(String iface) { /** * Return the number of bytes received on the specified interface since the interface * was created. Statistics are measured at the network layer, so both TCP * and UDP usage are included. * * Note that the returned values are partial statistics that do not count data from several * sources and do not apply several adjustments that are necessary for correctness, such * as adjusting for VPN apps, IPv6-in-IPv4 translation, etc. These values can be used to * determine whether traffic is being transferred on the specific interface but are not a * substitute for the more accurate statistics provided by the {@link NetworkStatsManager} * APIs. * * @param iface The name of the interface. * @return The number of received bytes. */ public static long getRxBytes(@NonNull String iface) { try { return getStatsService().getIfaceStats(iface, TYPE_RX_BYTES); } catch (RemoteException e) { Loading