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/NetworkStatsAccess.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/NetworkStatsAccess.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/NetworkStatsAccess.java
|