summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/ConnectivityService.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-09-22 14:59:51 -0700
committerJeff Sharkey <jsharkey@android.com>2011-09-22 16:19:06 -0700
commit367d15ab1a33b6159447fa8542d4fa8ff148371c (patch)
treeef079cca799aa0e2c68f9a158cfd0a1d533cc253 /services/java/com/android/server/ConnectivityService.java
parent745f1e3a06eb504c9e4465afc987854a6269220d (diff)
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
Diffstat (limited to 'services/java/com/android/server/ConnectivityService.java')
-rw-r--r--services/java/com/android/server/ConnectivityService.java7
1 files changed, 4 insertions, 3 deletions
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) &&