當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。