当前位置: 首页>>代码示例>>Java>>正文


Java TrafficStats.getThreadStatsTag方法代码示例

本文整理汇总了Java中android.net.TrafficStats.getThreadStatsTag方法的典型用法代码示例。如果您正苦于以下问题:Java TrafficStats.getThreadStatsTag方法的具体用法?Java TrafficStats.getThreadStatsTag怎么用?Java TrafficStats.getThreadStatsTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.net.TrafficStats的用法示例。


在下文中一共展示了TrafficStats.getThreadStatsTag方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: JavaUrlRequest

import android.net.TrafficStats; //导入方法依赖的package包/类
/**
 * @param executor The executor used for reading and writing from sockets
 * @param userExecutor The executor used to dispatch to {@code callback}
 */
JavaUrlRequest(Callback callback, final Executor executor, Executor userExecutor, String url,
        String userAgent) {
    if (url == null) {
        throw new NullPointerException("URL is required");
    }
    if (callback == null) {
        throw new NullPointerException("Listener is required");
    }
    if (executor == null) {
        throw new NullPointerException("Executor is required");
    }
    if (userExecutor == null) {
        throw new NullPointerException("userExecutor is required");
    }
    this.mCallbackAsync = new AsyncUrlRequestCallback(callback, userExecutor);
    this.mTrafficStatsTag = TrafficStats.getThreadStatsTag();
    this.mExecutor = new Executor() {
        @Override
        public void execute(final Runnable command) {
            executor.execute(new Runnable() {
                @Override
                public void run() {
                    int oldTag = TrafficStats.getThreadStatsTag();
                    TrafficStats.setThreadStatsTag(mTrafficStatsTag);
                    try {
                        command.run();
                    } finally {
                        TrafficStats.setThreadStatsTag(oldTag);
                    }
                }
            });
        }
    };
    this.mCurrentUrl = url;
    this.mUserAgent = userAgent;
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:41,代码来源:JavaUrlRequest.java

示例2: getThreadStatsTag

import android.net.TrafficStats; //导入方法依赖的package包/类
public static int getThreadStatsTag() {
    return TrafficStats.getThreadStatsTag();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:TrafficStatsCompatIcs.java

示例3: b

import android.net.TrafficStats; //导入方法依赖的package包/类
public static int b()
{
    return TrafficStats.getThreadStatsTag();
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:5,代码来源:o.java

示例4: getThreadStatsTag

import android.net.TrafficStats; //导入方法依赖的package包/类
public static int getThreadStatsTag()
{
    return TrafficStats.getThreadStatsTag();
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:5,代码来源:TrafficStatsCompatIcs.java


注:本文中的android.net.TrafficStats.getThreadStatsTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。