OSDN Git Service

Hack and ship: NetworkStats edition.
authorJeff Sharkey <jsharkey@android.com>
Mon, 11 Aug 2014 22:22:51 +0000 (15:22 -0700)
committerJeff Sharkey <jsharkey@android.com>
Tue, 12 Aug 2014 01:40:23 +0000 (18:40 -0700)
commiteb2c2c790c4b86c9c09245e0b87a38972713434a
tree28ba49d7a75c281edb06ffc399e522aa05765629
parentfdd78e06a7cb29870377dc8b1dfb918b9c35defa
Hack and ship: NetworkStats edition.

Some devices use clatd for catching raw IPv4 traffic when running on
a pure-IPv6 carrier network.  In those situations, the per-UID
stats are accounted against the clat iface, so framework users need
to combine both the "base" and "stacked" iface usage together.

This also means that policy rules (like restricting background data
or battery saver) need to apply to the stacked ifaces.

Finally, we need to massage stats data slightly:

-- Currently xt_qtaguid double-counts the clatd traffic *leaving*
the device; both against the original UID on the clat iface, and
against UID 0 on the final egress interface.

-- All clatd traffic *arriving* at the device is missing the extra
IPv6 packet header overhead when accounted against the final UID.

Bug: 122496871545924816296564
Change-Id: I0ee59d96831f52782de7a980e4cce9b061902fff
core/java/android/net/LinkProperties.java
core/java/com/android/internal/net/NetworkStatsFactory.java
services/core/java/com/android/server/ConnectivityService.java
services/core/java/com/android/server/net/NetworkPolicyManagerService.java
services/core/java/com/android/server/net/NetworkStatsService.java