History log of /frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b6587eac06c00c964b6f541e18d307df8c4a9a50 22-Jun-2016 Jack Yu <jackyu@google.com> Added a virtual interface for Video Telephony call usage counting

1. Added a virtual VT interface.
2. Qeury VT usage from telephony service.

bug: 20888836
Change-Id: I3df0c22922f8394554230b53f8ae091e17c95595
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
4ff3bcfa0c143ad14c81d07f90ed6dc375701ab1 15-Jun-2016 Jeff Davidson <jpd@google.com> Fix runtime restart when using aggregated net observers.

When observing network traffic on a per-iface basis (as opposed to a
per-iface+uid basis), do not attempt to redistribute VPN traffic,
because it is unnecessary and will lead to a crash further down the
stack.

This is a one-line functional change, but some comments have been
added throughout to clarify behavior.

Bug: 29390363
Change-Id: Icca13f181d7698ca3ddc92aa9248f06f130d49a3
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
6965c1869aa8499706522d057b5143bbc240178b 30-Mar-2016 Antonio Cansado <acansado@google.com> Addressing API council comments on NetworkStatsManager.

Callbacks
- DataUsageCallback renamed to UsageCallback
- DataUsagePolicy removed; passing in params directly to register method
- making it an abstract class
- passing in (networkType, subscriberId) that reached its threshold
- renaming onLimitReached to onThresholdReached to match existing naming
- only monitor single network,subscriberId
- no monitoring of specific uids; using device or user wide instead

Tags
- only owner uid can read its tags
- exposing only TAG_NONE to match service side

BUG: 27530098

Change-Id: I2b2664da71806868a1e937d2bf4d1f234637509b
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
cd42acd9515bdce89d4f1401ee2888d684bf1918 17-Feb-2016 Antonio Cansado <acansado@google.com> Implementation of data usage callbacks.

NetworkStatsService will register data usage requests
and keep data usage stats scoped to the request.

There are different types of data usage requests
- scoped to a set of NetworkTemplate; these are restrictred to
device owners and carrier apps and allow the caller to monitor
all activity on the specified interfaces.
- scoped to all uids visible to the user, if the user has
android.Manifest.permission#PACKAGE_USAGE_STATS permission.
The set of uids may change over time, so we keep track of that.
- scoped to a set of uids given by the caller, granted that
the caller has access to those uids.
- scoped to the caller's own data usage. This doesn't require
PACKAGE_USAGE_STATS.

Bug: 25812785
Change-Id: Ie11f35fc1f29d0dbe82f7fc924b169bb55c76708
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
3a8b343ce5220086c4f71e63f5d42f2d28434c4b 21-Jan-2016 Zoltan Szatmary-Ban <szatmz@google.com> Introduce DEVICESUMMARY access level to NetworkStatsAccess.

Apps with PACKAGE_USAGE_STATS app op or READ_NETWORK_USAGE_HISTORY
granted can query the summarized device data usage (but not individual
uids running in other users or profiles).

Bug:26677052
Change-Id: Id51631638f338a8cf48172c9b41746228a335084
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
1efb1335814aea8ee0696144ca0ab24159b86e54 10-Dec-2015 Jeff Davidson <jpd@google.com> Relax permissions around NetworkStatsManager APIs.

Currently, access to network usage history and statistics requires a
signature|privileged permission, an AppOps bit (associated with the
PACKAGE_USAGE_STATS permission), or device/profile ownership. Once
access is granted via one of these mechanisms, it generally applies to
any UID running in the same user as the caller.

This CL expands access as follows:

-Any app can access its own usage history with no extra requirements.
-Carrier-privileged applications can access usage history for the
entire device.
-Device owners can access per-UID breakdowns for usage. Previously
they could access the summary for the whole device, but not the
individual breakdowns.

We simplify the permission model by defining three access levels -
DEFAULT (own app only), USER (all apps in the same user), and DEVICE
(all apps on the device), and propagate these levels throughout.

Finally, this CL fixes an apparent bug in
NetworkStatsSerice#hasAppOpsPermissions - if the AppOp bit was in
MODE_DEFAULT, hasAppOpsPermission would always return false instead of
falling back to the PackageManager permission check.

Bug: 25812859
Bug: 25813856
Change-Id: Ic96e0776e2a4215a400163872acea1ededfaced9
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
72027d2e424a94f002452d1e16310d00f3696d00 16-Jun-2015 Zoltan Szatmary-Ban <szatmz@google.com> Expose time-interval detail query on INetworkStatsSession

Also, force polling when a session is opened for NetworkStatsManager.

Bug: 21864554
Bug: 21754685
Change-Id: I24ea822c2d5bc1421ec7ee65d0cfe27cf02dd69e
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
cccbe885b94f2dca088c01b2f38addac3054c402 30-Apr-2015 Zoltan Szatmary-Ban <szatmz@google.com> Fix potential NPE on devices without DPMS

Bug: 20563108
Change-Id: Ie2bda65c834ddad9db8753f7616c2754072551cd
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
9c5dfa5c79fff17f96bf977b86c0c9ceb8c3cf9b 23-Feb-2015 Zoltan Szatmary-Ban <szatmz@google.com> Data Usage public API

Added new API consisting of android.app.usage.NetworkUsageManager and
android.app.usage.NetworkUsageStats. Through them data usage on a
network interface can be programmatically queried. Both summary and
details are available.

Bug: 19208876
Change-Id: I0e0c4b37ae23ad1e589d4b0c955b93f28ba4333e
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
f5ea340aabee6e290448c8cc9fb0925da8b7db5e 04-Mar-2015 Wenchao Tong <tongwenchao@google.com> NetworkStatsService to adjust VPN stats before recording.

* Creates a new Parcelable class VpnInfo to hold required
parameters for VPN stats adjustments.
* ConnectivityService to collect infomation and provide
a list of VpnInfo, one for each user.
* NetworkStatsService passes the VpnInfo array to
NetworkStatsRecorder.
* NetworkStatsRecorder calls NetworkStats.migrateTun()
to do the math.
* Poll NetworkStats when the vpn application calls
setUnderlyingNetworks().

Bug: 19536273
Change-Id: I7a4c7726b8243fead10416f7ec6eb5cf95f20183
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
6973634ce61ab7d4c1d51c70be6d51725b89e7b9 08-Dec-2014 Jeff Sharkey <jsharkey@android.com> Direct notification of network interface changes.

Connectivity broadcasts recently changed and are no longer sent for
certain types of network changes. For example, when stacked network
interfaces change for a mobile network. To ensure that we pick up
all these details, directly wire the two services together.

Also remove some unused code for split network types.

Bug: 18666753
Change-Id: I0467bd5b330c0e0cb51af2306d821b41ad16337a
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
55a442e58262e253df965d652bd8219c8d1e72d3 19-Nov-2014 Jeff Sharkey <jsharkey@android.com> Lightweight checkin output for network stats.

Define and print a compact version of network statistics when dump
is requested with the "--checkin" flag. Defaults to last 24 hours,
but included data can be tweaked with various flags.

Groups together detailed network identities into larger umbrella
terms like "mobile" and "wifi."

Bug: 18415963
Change-Id: I70cf9c828ea5c6e5bb6884837d3608f66fbad2e6
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
5274dcc85dc18b524b729ae9a2148c651dc1a654 24-Oct-2014 Jeff Sharkey <jsharkey@android.com> Drop DEV network stats to save RAM.

We migrated to pure XT stats a long time ago, so we no longer need
to keep the DEV stats cached in RAM. This saves ~250KB on a typical
device.

Bug: 18118003
Change-Id: I3d84ba47073fa3500454784afc956c8e53404492
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
92d141fbc2f6bfc85dca1056e40512cba6d1dddb 11-Sep-2014 Vinit Deshpande <vinitd@google.com> Don't require CONNECTIVITY_INTERNAL check for protected broadcasts

This change removes requirement that sender has this permission for
protected broadcasts (since they can only come from framework)

Bug: 17409667

Change-Id: I3431c20a4ed28b3ba2bfc3cf53772e63a3424a2c
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
9da2f1e007268a42248a1778aa9b560e3ce3b704 14-Aug-2014 Jeff Sharkey <jsharkey@android.com> Some networks may have null ifaces, I guess?

Seems like a bug further upstream, but guard ourselves against it
for now.

Bug: 17033841
Change-Id: Id0e5895c3389b63d4e34b1fb064efef8b72cd609
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
eb2c2c790c4b86c9c09245e0b87a38972713434a 12-Aug-2014 Jeff Sharkey <jsharkey@android.com> 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: 12249687, 15459248, 16296564
Change-Id: I0ee59d96831f52782de7a980e4cce9b061902fff
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java
49782e46c0eb85a25ae2abcf80880c48dbab5aea 20-Dec-2013 Amith Yamasani <yamasani@google.com> am 9158825f: Move some system services to separate directories

* commit '9158825f9c41869689d6b1786d7c7aa8bdd524ce':
Move some system services to separate directories
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/net/NetworkStatsService.java