From 367d15ab1a33b6159447fa8542d4fa8ff148371c Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 22 Sep 2011 14:59:51 -0700 Subject: Watch network subtype, tethering teardown, empty. Watch for changes to telephony network subtype, and update iface mapping to persist stats under correct type. Update network stats before removing tethering NAT rules. Skip recording that would create empty historical buckets. Query UID stats before iface stats to always skew positive when counters are actively rolling forward. Bug: 5360042, 5359860, 5335674, 5334448 Change-Id: I8aa37b568e8ffb70647218aa1aff5195d3e44d5a --- services/java/com/android/server/ConnectivityService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'services/java/com/android/server/ConnectivityService.java') diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 86ac296c2c95..8112b1d0d149 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -35,6 +35,7 @@ import android.net.EthernetDataTracker; import android.net.IConnectivityManager; import android.net.INetworkPolicyListener; import android.net.INetworkPolicyManager; +import android.net.INetworkStatsService; import android.net.LinkAddress; import android.net.LinkProperties; import android.net.LinkProperties.CompareResult; @@ -306,8 +307,8 @@ public class ConnectivityService extends IConnectivityManager.Stub { // the set of network types that can only be enabled by system/sig apps List mProtectedNetworks; - public ConnectivityService( - Context context, INetworkManagementService netd, INetworkPolicyManager policyManager) { + public ConnectivityService(Context context, INetworkManagementService netd, + INetworkStatsService statsService, INetworkPolicyManager policyManager) { if (DBG) log("ConnectivityService starting up"); HandlerThread handlerThread = new HandlerThread("ConnectivityServiceThread"); @@ -496,7 +497,7 @@ public class ConnectivityService extends IConnectivityManager.Stub { IBinder b = ServiceManager.getService(Context.NETWORKMANAGEMENT_SERVICE); INetworkManagementService nmService = INetworkManagementService.Stub.asInterface(b); - mTethering = new Tethering(mContext, nmService, mHandler.getLooper()); + mTethering = new Tethering(mContext, nmService, statsService, mHandler.getLooper()); mTetheringConfigValid = ((mTethering.getTetherableUsbRegexs().length != 0 || mTethering.getTetherableWifiRegexs().length != 0 || mTethering.getTetherableBluetoothRegexs().length != 0) && -- cgit v1.2.3