From ab2c35e440584e983f36a203684a3d0e4d525646 Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Tue, 18 Jan 2022 02:46:23 +0000 Subject: [PATCH] [MS63.1] Remove TrafficStats.TAG_SYSTEM_DOWNLOAD dependency Replace with system Api. Test: TH Bug: 204830222 CTS-Coverage-Bug: 215043101 Change-Id: Ic14b26d2862f6fe8bee18fe0c9eaf183052452ee --- framework-t/src/android/net/TrafficStats.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/framework-t/src/android/net/TrafficStats.java b/framework-t/src/android/net/TrafficStats.java index 032bc3f402..1af32bf552 100644 --- a/framework-t/src/android/net/TrafficStats.java +++ b/framework-t/src/android/net/TrafficStats.java @@ -281,6 +281,18 @@ public class TrafficStats { setThreadStatsTag(TAG_SYSTEM_APP); } + /** + * Set active tag to use when accounting {@link Socket} traffic originating + * from the current thread. The tag used internally is well-defined to + * distinguish all download provider traffic. + * + * @hide + */ + @SystemApi + public static void setThreadStatsTagDownload() { + setThreadStatsTag(TAG_SYSTEM_DOWNLOAD); + } + /** * Get the active tag used when accounting {@link Socket} traffic originating * from the current thread. Only one active tag per thread is supported.