Example usage for android.net TrafficStats clearThreadStatsTag

List of usage examples for android.net TrafficStats clearThreadStatsTag

Introduction

In this page you can find the example usage for android.net TrafficStats clearThreadStatsTag.

Prototype

public static void clearThreadStatsTag() 

Source Link

Document

Clear any active tag set to account Socket traffic originating from the current thread.

Usage

From source file:org.gdg.frisbee.android.api.OkStack.java

@Override
public HttpResponse performRequest(Request<?> request, Map<String, String> additionalHeaders)
        throws IOException, AuthFailureError {
    if (Const.DEVELOPER_MODE && Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        TrafficStats.setThreadStatsTag(0xF00D);
        try {/*from  w w w . j a  va  2s  . co m*/
            HttpResponse res = super.performRequest(request, additionalHeaders);
            return res;
        } finally {
            TrafficStats.clearThreadStatsTag();
        }
    } else {
        return super.performRequest(request, additionalHeaders);
    }
}