Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -24497,6 +24497,7 @@ package android.net { public class TrafficStats { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -30078,6 +30079,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure(); api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -26484,6 +26484,7 @@ package android.net { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static void clearThreadStatsUid(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -32730,6 +32731,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure(); api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -24587,6 +24587,7 @@ package android.net { public class TrafficStats { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -30190,6 +30191,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure(); core/java/android/net/SntpClient.java +2 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class SntpClient { public boolean requestTime(InetAddress address, int port, int timeout) { DatagramSocket socket = null; final int oldTag = TrafficStats.getAndSetThreadStatsTag(TrafficStats.TAG_SYSTEM_NTP); try { socket = new DatagramSocket(); socket.setSoTimeout(timeout); Loading Loading @@ -161,6 +162,7 @@ public class SntpClient { if (socket != null) { socket.close(); } TrafficStats.setThreadStatsTag(oldTag); } return true; Loading core/java/android/net/TrafficStats.java +18 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,24 @@ public class TrafficStats { NetworkManagementSocketTagger.setThreadSocketStatsTag(tag); } /** * Set active tag to use when accounting {@link Socket} traffic originating * from the current thread. Only one active tag per thread is supported. * <p> * Changes only take effect during subsequent calls to * {@link #tagSocket(Socket)}. * <p> * Tags between {@code 0xFFFFFF00} and {@code 0xFFFFFFFF} are reserved and * used internally by system services like {@link DownloadManager} when * performing traffic on behalf of an application. * * @return the current tag for the calling thread, which can be used to * restore any existing values after a nested operation is finished */ public static int getAndSetThreadStatsTag(int tag) { return NetworkManagementSocketTagger.setThreadSocketStatsTag(tag); } /** * Set active tag to use when accounting {@link Socket} traffic originating * from the current thread. The tag used internally is well-defined to Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -24497,6 +24497,7 @@ package android.net { public class TrafficStats { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -30078,6 +30079,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure();
api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -26484,6 +26484,7 @@ package android.net { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static void clearThreadStatsUid(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -32730,6 +32731,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure();
api/test-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -24587,6 +24587,7 @@ package android.net { public class TrafficStats { ctor public TrafficStats(); method public static void clearThreadStatsTag(); method public static int getAndSetThreadStatsTag(int); method public static long getMobileRxBytes(); method public static long getMobileRxPackets(); method public static long getMobileTxBytes(); Loading Loading @@ -30190,6 +30191,7 @@ package android.os { method public android.os.StrictMode.VmPolicy.Builder detectLeakedClosableObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedRegistrationObjects(); method public android.os.StrictMode.VmPolicy.Builder detectLeakedSqlLiteObjects(); method public android.os.StrictMode.VmPolicy.Builder detectUntaggedSockets(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeath(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnCleartextNetwork(); method public android.os.StrictMode.VmPolicy.Builder penaltyDeathOnFileUriExposure();
core/java/android/net/SntpClient.java +2 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ public class SntpClient { public boolean requestTime(InetAddress address, int port, int timeout) { DatagramSocket socket = null; final int oldTag = TrafficStats.getAndSetThreadStatsTag(TrafficStats.TAG_SYSTEM_NTP); try { socket = new DatagramSocket(); socket.setSoTimeout(timeout); Loading Loading @@ -161,6 +162,7 @@ public class SntpClient { if (socket != null) { socket.close(); } TrafficStats.setThreadStatsTag(oldTag); } return true; Loading
core/java/android/net/TrafficStats.java +18 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,24 @@ public class TrafficStats { NetworkManagementSocketTagger.setThreadSocketStatsTag(tag); } /** * Set active tag to use when accounting {@link Socket} traffic originating * from the current thread. Only one active tag per thread is supported. * <p> * Changes only take effect during subsequent calls to * {@link #tagSocket(Socket)}. * <p> * Tags between {@code 0xFFFFFF00} and {@code 0xFFFFFFFF} are reserved and * used internally by system services like {@link DownloadManager} when * performing traffic on behalf of an application. * * @return the current tag for the calling thread, which can be used to * restore any existing values after a nested operation is finished */ public static int getAndSetThreadStatsTag(int tag) { return NetworkManagementSocketTagger.setThreadSocketStatsTag(tag); } /** * Set active tag to use when accounting {@link Socket} traffic originating * from the current thread. The tag used internally is well-defined to Loading