1b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey/*
2b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * Copyright (C) 2012 The Android Open Source Project
3b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey *
4b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License");
5b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * you may not use this file except in compliance with the License.
6b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * You may obtain a copy of the License at
7b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey *
8b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey *      http://www.apache.org/licenses/LICENSE-2.0
9b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey *
10b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * Unless required by applicable law or agreed to in writing, software
11b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS,
12b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * See the License for the specific language governing permissions and
14b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey * limitations under the License.
15b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey */
16b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
17b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkeypackage android.net;
18b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
19b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkeyimport android.net.NetworkStats;
20b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkeyimport android.net.NetworkStatsHistory;
21b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkeyimport android.net.NetworkTemplate;
22b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
23b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey/** {@hide} */
24b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkeyinterface INetworkStatsSession {
25b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
269c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban    /** Return device aggregated network layer usage summary for traffic that matches template. */
279c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban    NetworkStats getDeviceSummaryForNetwork(in NetworkTemplate template, long start, long end);
289c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban
29b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    /** Return network layer usage summary for traffic that matches template. */
30b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    NetworkStats getSummaryForNetwork(in NetworkTemplate template, long start, long end);
31b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    /** Return historical network layer stats for traffic that matches template. */
32b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    NetworkStatsHistory getHistoryForNetwork(in NetworkTemplate template, int fields);
33b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
34b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    /** Return network layer usage summary per UID for traffic that matches template. */
35b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    NetworkStats getSummaryForAllUid(in NetworkTemplate template, long start, long end, boolean includeTags);
36b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    /** Return historical network layer stats for specific UID traffic that matches template. */
37b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    NetworkStatsHistory getHistoryForUid(in NetworkTemplate template, int uid, int set, int tag, int fields);
3872027d2e424a94f002452d1e16310d00f3696d00Zoltan Szatmary-Ban    /** Return historical network layer stats for specific UID traffic that matches template. */
3972027d2e424a94f002452d1e16310d00f3696d00Zoltan Szatmary-Ban    NetworkStatsHistory getHistoryIntervalForUid(in NetworkTemplate template, int uid, int set, int tag, int fields, long start, long end);
40b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
419c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban    /** Return array of uids that have stats and are accessible to the calling user */
429c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban    int[] getRelevantUids();
439c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9bZoltan Szatmary-Ban
44b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey    void close();
45b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey
46b52e3e55098c4a6e3dbfe19885895411cfb38911Jeff Sharkey}
47