Add tagging variants for DatagramSocket.

Oops, we missed these along the way.

Bug: 25799174
Change-Id: I4ad368f9faee4b1996d605534dce4c2b23dbe200
This commit is contained in:
Jeff Sharkey
2015-12-04 15:21:52 -07:00
parent dbccfac26f
commit 7b124cb8e6

View File

@@ -28,6 +28,7 @@ import com.android.server.NetworkManagementSocketTagger;
import dalvik.system.SocketTagger;
import java.net.DatagramSocket;
import java.net.Socket;
import java.net.SocketException;
@@ -225,6 +226,27 @@ public class TrafficStats {
SocketTagger.get().untag(socket);
}
/**
* Tag the given {@link DatagramSocket} with any statistics parameters
* active for the current thread. Subsequent calls always replace any
* existing parameters. When finished, call
* {@link #untagDatagramSocket(DatagramSocket)} to remove statistics
* parameters.
*
* @see #setThreadStatsTag(int)
* @see #setThreadStatsUid(int)
*/
public static void tagDatagramSocket(DatagramSocket socket) throws SocketException {
SocketTagger.get().tag(socket);
}
/**
* Remove any statistics parameters from the given {@link DatagramSocket}.
*/
public static void untagDatagramSocket(DatagramSocket socket) throws SocketException {
SocketTagger.get().untag(socket);
}
/**
* Start profiling data usage for current UID. Only one profiling session
* can be active at a time.