summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/usage
Commit message (Collapse)AuthorAgeFilesLines
* Don't change screen on time on time changesAdam Lesinski2016-01-281-2/+6
| | | | | | | | | | | | | | | Screen on time should be measured in elapsed realtime, not wallclock. Cause a checkIdleStates to occur when reloading stats (on rollover and on time change). When time changes occur in the negative direction, the new stats file we create can overlap the previous one with regards to its end timestamp. Use the begin timestamp to determine which of the latest stats to merge. (b/22716352) Bug: 26488100 Change-Id: If31b29bbbee9e98401205b5e26bce86e181286e7
* Fix issue #25357209: Could not send SMS or MMS messages, had to rebootDianne Hackborn2015-11-021-1/+2
| | | | | | | | | | | | | | | | I think what probably happened is that since we only report an app going in to the "interaction" state as an interaction event to usage stats, apps that sit around in that state forever will only see one interaction at the start and never again. So usage stats could start thinking they are idle. Fix this by having the activity manager report an interaction event for such long running applications at least once a day. Also, because it is correct and for paranoia by protected us another way, system uids should never go in to standby. Change-Id: I8a3805bfca86cbe78560488a649ecd07427da99a
* Remove uids with empty history from NetworkStats uid enumerationZoltan Szatmary-Ban2015-08-141-6/+20
| | | | | Bug: 23018174 Change-Id: I1a482280599e0f5da18a208e727653d4bd4107ec
* Fix issue #22989030: Separate battery whitelistsDianne Hackborn2015-08-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | We now have a new whitelist you can put apps in, which opts them out of the old battery saver mode and new app idle, but doesn't keep them from going in to doze. This is for a few special cases that we had previously whitelisted for battery saver, and inherited to the new modes... ultimately we should figure out how to get these apps out of the whitelist completely, but this will help for now. Apps in this new whitelist are not shown in the UI, because they are still significantly restricted by not being able to operate normally in doze. This also means they are still visible in the list of all apps for the user to be able to put them on/off the complete whitelist if that is what they really want. In the course of doing this, I needed to clean up code in the network policy manager to better separate management of the two firewall rules that now have different whitelists applied to them. This also hopefully just generally simplifies and cleans up that code. Hopefully! Change-Id: I92e15f2f85899571dd8b049b5e3eb1354f55f353
* Expose time-interval detail query on INetworkStatsSessionZoltan Szatmary-Ban2015-07-072-17/+20
| | | | | | | | Also, force polling when a session is opened for NetworkStatsManager. Bug: 21864554 Bug: 21754685 Change-Id: I24ea822c2d5bc1421ec7ee65d0cfe27cf02dd69e
* Frameworks/base: Remove UsageEvents finalizerAndreas Gampe2015-06-291-9/+0
| | | | | | | | | | | The order of finalization between the parcel and the UsageEvents objects is not defined. In the bad case, the parcel will be finalized first and destroy its native pointer, after which the UsageEvents object will recycle it, putting it back into one of the Parcel pools. This will violate the pool invariant. Bug: 22088355 Change-Id: Ifbe7822990cdfc31855d6742dcdea9d9dd0daf1b
* system_server: optimize app idle parole state changeXiaohui Chen2015-06-221-2/+9
| | | | | | | | | | | Currently when app idle parole state changes, all idle apps' states are updated one by one including firewall modifications which are very expensive. This optimization gets rid of individual firewall rule changes and makes sure we only modify the firewall once at child chain level. BUG: 21446713 Change-Id: Iafc415fe0bc127826fe17894d4fedcf1755cb17d
* App Standby : Association between content providers and their sync adapterAmith Yamasani2015-06-191-0/+8
| | | | | | | | | | | | | Set sync adapters to active if the associated content providers are used at foreground process state. Minimize how frequently published content providers are reported by keeping track of last reported time. Also cache sync adapters associated with an authority in SyncManager. Bug: 21785111 Change-Id: Ic2c8cb6a27f005d1a1d0aad21d36b1510160753a
* UsageStats: Change INTERACTION to SYSTEM_INTERACTIONAdam Lesinski2015-06-112-2/+30
| | | | | | | | | | | SYSTEM_INTERACTION events are signals to the system for a package's implicit actions (service bound, etc). These should not affect the API visible stats like lastTimeUsed, etc. USER_INTERACTION is for user initiated actions (notification interaction, etc). Bug:21761781 Change-Id: I4585cf35fbb158612a3c737710108bec34e89183
* Replace renamed reference to NetworkStats in javadocZoltan Szatmary-Ban2015-06-041-2/+2
| | | | | Bug: 21572680 Change-Id: Iad43af4d8a6d178f3396f23a74f1568e6faed311
* Temporarily whitelist an app for network during dozeAmith Yamasani2015-06-022-0/+23
| | | | | | | | | | | | | | | API to allow an app to be whitelisted for network and wakelock access for a short period. So even if the device is in idle mode, such apps can be given a chance to download the payload related to a high priority cloud-to-device message. This API is meant for system apps only. A new permission CHANGE_DEVICE_IDLE_TEMP_WHITELIST is required to make this call. Bug: 21525864 Change-Id: Id7a761a664f21af5d7ff55aa56e8df98d15511ca
* Merge "Rename NetworkUsageStats -> NetworkStats" into mnc-devZoltan Szatmary-Ban2015-05-142-35/+56
|\
| * Rename NetworkUsageStats -> NetworkStatsZoltan Szatmary-Ban2015-05-132-35/+56
| | | | | | | | | | | | | | Also making other changes to Data Usage API as requested by API review. Bug: 20823478 Change-Id: Id766c5a725c856da9d8883d73ae788fc1472440a
* | Allow settings to change app inactive stateAmith Yamasani2015-05-131-0/+11
| | | | | | | | Change-Id: I57efb4b5fa69c9a268025fb1ef83de36c4cc83ca
* | Idle timebaseAmith Yamasani2015-05-112-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use screen on time as timebase for idling out apps that have been inactive. Store the time when an app was last active as an additional package state in UsageStats. Compare it to screenOnTime to decide if it's inactive. Exclude device idle whitelist from apps that can go inactive. Bug: 20066058 Change-Id: I709f9f31a9affa7ca6e1ae3e4c5729c5fb221669
* | Rename *AppIdle to *AppInactive per api-councilAmith Yamasani2015-05-082-6/+6
|/ | | | | | | Change to setAppInactive and isAppInactive in a few places. Bug: 20823737 Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
* Add ability to get and set idle state of appsAmith Yamasani2015-04-242-0/+19
| | | | | | | | | Add am shell command to set and get idle Add public API to check if an app is idle Bug: 20534955 Bug: 20493806 Change-Id: Ib48b3fe847c71f05ef3905563f6e903cf060c498
* Throttle jobs for idle appsAmith Yamasani2015-04-031-0/+37
| | | | | | | | | | | | | | | | | | | First pass at delaying jobs from apps that are idle. TODO: Throttle syncs TODO: Provide a periodic point at which apps are checked for idleness. Apps that switch to foreground process state are tracked by UsageStats as an INTERACTION event that affects the last-used timestamp. JobScheduler's logic for when an app is ready is trumped by the idleness of the app, and only if the battery is not charging. When charging state changes, we update the idle state of all the tracked jobs. android package is whitelisted. Bug: 20066058 Change-Id: I0a0acb517b100a5c7b11e3f435f4141375f3451f
* Data Usage public APIZoltan Szatmary-Ban2015-03-252-0/+712
| | | | | | | | | | 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
* Add generic "INTERACTION" event type to UsageStatsManagerAdam Lesinski2015-03-022-0/+15
| | | | | | | | This will allow for updating a package's last time used property for packages that are interacted in ways other than launching their activities (interacting with notifications, etc.) Change-Id: Ic6f9519f46fa04abd37ea6fc9475bcd9ea721003
* Remove UsageEvents#resetToStart() as it doesn't workAdam Lesinski2014-10-081-9/+3
| | | | | | | | After completely iterating over a UsageEvents object, the internal parcel is recycled. If resetToStart is called then, it does nothing. Bug:17909428 Change-Id: I7bc68d3429e4621a50dedbfc1789576d44dbb3be
* Add Configuration changes to UsageStatsAdam Lesinski2014-09-045-45/+284
| | | | | Bug:17354208 Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
* Make UsageStats API comply with API CouncilAdam Lesinski2014-08-293-11/+19
| | | | | | | | - Fix documentation to mention units of time in APIs. - Return a Map instead of an ArrayMap Bug:17289531 Change-Id: I0a2cfdc0bc003eeeb65a16e37bb7b991624b2853
* Split up ComponentName in UsageEvents.EventAdam Lesinski2014-08-261-15/+64
| | | | | | | | Some events in the future may not have originated from a class, so we shouldn't be using ComponentName. Bug:17259858 Change-Id: Id7fe3245b91596cf27ae4ec51655602f01665622
* Second iteration of the UsageStats APIAdam Lesinski2014-08-088-299/+508
| | | | | | | Based on feedback from API council, updated the API. Also added support for querying the event log. Change-Id: Ibaa008b9e5bd145acdfe8e20c25c2ed2d96be123
* Add Per-User logging of UsageStatsAdam Lesinski2014-07-251-1/+3
| | | | Change-Id: I4518c5d3c56b3821292accb886f9fb21f3a8b25f
* Sort ResolverActivity items based on UsageStatsAdam Powell2014-07-201-0/+1
| | | | | | | | | Sort targets by the total amount of time the user has spent with their containing package in the foreground. Bug 15694906 Change-Id: I63c956424f78eb22911517674dfefd96901d19f8
* First iteration of a public UsageStats APIAdam Lesinski2014-07-188-0/+641
UsageStats API that allows apps to get a list of packages that have been recently used, along with basic stats like how long they have been in the foreground and the most recent time they were running. Bug: 15165667 Change-Id: I2a2d1ff69bd0b5703ac3d9de1780df42ad90d439