Add tagging variants for DatagramSocket.
Oops, we missed these along the way. Bug: 25799174 Change-Id: I4ad368f9faee4b1996d605534dce4c2b23dbe200
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user