Merge "[ipsec-qtaguid] Tag sockets upon creation of encap sockets" am: cd534c6990 am: 8caa274ade
am: 073572a677
Change-Id: I4140f386687c579044f9b5fe59dd7e05f86000fe
This commit is contained in:
@@ -19,6 +19,7 @@ package android.net;
|
||||
import android.annotation.RequiresPermission;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.app.DownloadManager;
|
||||
import android.app.backup.BackupManager;
|
||||
import android.app.usage.NetworkStatsManager;
|
||||
@@ -154,6 +155,8 @@ public class TrafficStats {
|
||||
|
||||
private static Object sProfilingLock = new Object();
|
||||
|
||||
private static final String LOOPBACK_IFACE = "lo";
|
||||
|
||||
/**
|
||||
* Set active tag to use when accounting {@link Socket} traffic originating
|
||||
* from the current thread. Only one active tag per thread is supported.
|
||||
@@ -542,6 +545,30 @@ public class TrafficStats {
|
||||
return nativeGetIfaceStat(iface, TYPE_RX_BYTES);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static long getLoopbackTxPackets() {
|
||||
return nativeGetIfaceStat(LOOPBACK_IFACE, TYPE_TX_PACKETS);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static long getLoopbackRxPackets() {
|
||||
return nativeGetIfaceStat(LOOPBACK_IFACE, TYPE_RX_PACKETS);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static long getLoopbackTxBytes() {
|
||||
return nativeGetIfaceStat(LOOPBACK_IFACE, TYPE_TX_BYTES);
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static long getLoopbackRxBytes() {
|
||||
return nativeGetIfaceStat(LOOPBACK_IFACE, TYPE_RX_BYTES);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return number of packets transmitted since device boot. Counts packets
|
||||
* across all network interfaces, and always increases monotonically since
|
||||
|
||||
Reference in New Issue
Block a user