From 300f08f09432bd6c853177fbf38cb6e7fc9bfc2a Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Fri, 16 Sep 2011 01:52:49 -0700 Subject: [PATCH] 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 --- core/java/android/net/IConnectivityManager.aidl | 6 ++++++ services/java/com/android/server/ConnectivityService.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index eef658e459..70460087ca 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/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 2348d76bb6..e0a2adc0fd 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -2394,6 +2394,12 @@ public class ConnectivityService extends IConnectivityManager.Stub { return mTethering.getTetheredIfaces(); } + @Override + public String[] getTetheredIfacePairs() { + enforceTetherAccessPermission(); + return mTethering.getTetheredIfacePairs(); + } + public String[] getTetheringErroredIfaces() { enforceTetherAccessPermission(); return mTethering.getErroredIfaces();