summaryrefslogtreecommitdiffstats
path: root/core/java/android/net
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-09-16 01:52:49 -0700
committerJeff Sharkey <jsharkey@android.com>2011-09-16 16:05:51 -0700
commitcdd02c5d76d3dd4e21b5bb922d7fcfb86efec85f (patch)
tree32344e84c187ea5234a6bc3b50a9287b3155ffc8 /core/java/android/net
parentf79ec360984011c49c52b7a19b96cbbc932df4be (diff)
downloadframeworks_base-cdd02c5d76d3dd4e21b5bb922d7fcfb86efec85f.zip
frameworks_base-cdd02c5d76d3dd4e21b5bb922d7fcfb86efec85f.tar.gz
frameworks_base-cdd02c5d76d3dd4e21b5bb922d7fcfb86efec85f.tar.bz2
Collect and persist tethering stats.
Use new "gettetherstats" netd command to retrieve statistics for active tethering connections. Keep tethering poll events separate from UID poll, even though they end up same historical structures. Bug: 5244846 Change-Id: Ia0c5165f6712c12b51586f86c331a2aad4ad6afb
Diffstat (limited to 'core/java/android/net')
-rw-r--r--core/java/android/net/IConnectivityManager.aidl6
-rw-r--r--core/java/android/net/TrafficStats.java18
2 files changed, 21 insertions, 3 deletions
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index eef658e..7046008 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -83,6 +83,12 @@ interface IConnectivityManager
String[] getTetheredIfaces();
+ /**
+ * Return list of interface pairs that are actively tethered. Even indexes are
+ * remote interface, and odd indexes are corresponding local interfaces.
+ */
+ String[] getTetheredIfacePairs();
+
String[] getTetheringErroredIfaces();
String[] getTetherableUsbRegexs();
diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java
index 47cfa73..18eb9f6 100644
--- a/core/java/android/net/TrafficStats.java
+++ b/core/java/android/net/TrafficStats.java
@@ -53,25 +53,33 @@ public class TrafficStats {
public static final int UID_REMOVED = -4;
/**
+ * Special UID value used when collecting {@link NetworkStatsHistory} for
+ * tethering traffic.
+ *
+ * @hide
+ */
+ public static final int UID_TETHERING = -5;
+
+ /**
* Default tag value for {@link DownloadManager} traffic.
*
* @hide
*/
- public static final int TAG_SYSTEM_DOWNLOAD = 0xFFFF0001;
+ public static final int TAG_SYSTEM_DOWNLOAD = 0xFFFFFF01;
/**
* Default tag value for {@link MediaPlayer} traffic.
*
* @hide
*/
- public static final int TAG_SYSTEM_MEDIA = 0xFFFF0002;
+ public static final int TAG_SYSTEM_MEDIA = 0xFFFFFF02;
/**
* Default tag value for {@link BackupManager} traffic.
*
* @hide
*/
- public static final int TAG_SYSTEM_BACKUP = 0xFFFF0003;
+ public static final int TAG_SYSTEM_BACKUP = 0xFFFFFF03;
/**
* Snapshot of {@link NetworkStats} when the currently active profiling
@@ -90,6 +98,10 @@ public class TrafficStats {
* <p>
* Changes only take effect during subsequent calls to
* {@link #tagSocket(Socket)}.
+ * <p>
+ * Tags between {@code 0xFFFFFF00} and {@code 0xFFFFFFFF} are reserved and
+ * used internally by system services like {@link DownloadManager} when
+ * performing traffic on behalf of an application.
*/
public static void setThreadStatsTag(int tag) {
NetworkManagementSocketTagger.setThreadSocketStatsTag(tag);