summaryrefslogtreecommitdiffstats
path: root/services/usage/java/com/android/server
Commit message (Collapse)AuthorAgeFilesLines
* Temporarily whitelist an app for network during dozeAmith Yamasani2015-06-021-8/+14
| | | | | | | | | | | | | | | 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
* Use screen-on time and wallclock time for idleness calcAmith Yamasani2015-05-203-25/+62
| | | | | | | | 12 hours of screen-on time and 2 days of wallclock time must elapse before considering an app idle. Bug: 20066058 Change-Id: Ie7b584b40e644d868aa2708876723c3391fd432e
* Allow settings to change app inactive stateAmith Yamasani2015-05-131-1/+2
| | | | Change-Id: I57efb4b5fa69c9a268025fb1ef83de36c4cc83ca
* Track app idle history and dump itAmith Yamasani2015-05-132-8/+116
| | | | | | | | | "dumpsys usagestats history" will show the active state of each app for the last 100 hours, if the device hasn't rebooted. Bug: 20066058 Change-Id: I703e5bc121298e4363c202da56fffb0b8534bcaf
* Allow exemption to idle apps at periodic intervalsAmith Yamasani2015-05-122-10/+115
| | | | | | | | Triggers are device idle mode changing as well as internal delayed message handlers. Bug: 20066058 Change-Id: I0627cfbcc16cfc2b8ac7d298fd2c681a5a6571dd
* Idle timebaseAmith Yamasani2015-05-114-63/+192
| | | | | | | | | | | | | | | 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-081-3/+3
| | | | | | | Change to setAppInactive and isAppInactive in a few places. Bug: 20823737 Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
* Exclude bound app widgets from idle app listAmith Yamasani2015-05-011-0/+9
| | | | | | | | Track package names of bound app widgets and use the list when querying for idle apps. Bug: 20066058 Change-Id: If8039397a061ef04bb13aa38d57cd7f0221f5fc7
* Remove network access for idle appsAmith Yamasani2015-04-291-11/+95
| | | | | | | | | | | | | | | | | | Track apps going in and out of idle in the NetworkPolicyManagerService. Apply DROP rules in firewall controller if app is to be blacklisted for network access. Firewall can now be in whitelist (old) or blacklist mode. When in blacklist, it allows all by default and we can selectively DENY some uids. Track app idle in UsageStats and update periodically. Track charging/discharging states. TODO: Check for appidle temporary parole state Bug: 20066058 Change-Id: Ia65d7544204b3bcb78a517310ef4adcc05aac6fb
* More usage trackingAmith Yamasani2015-04-241-3/+2
| | | | | | | | | Notification listeners can now report that a notification has been seen by the user and that package is then marked as active. Bug: 20066058 Change-Id: I336040a52c44c21fd0d78b02ec9a19d448c64b40
* Add ability to get and set idle state of appsAmith Yamasani2015-04-242-0/+111
| | | | | | | | | 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
* Delay syncs for idle appsAmith Yamasani2015-04-131-0/+4
| | | | | | | | Apps that haven't been in use for a while and are considered idle are not synced until the device is charging or the app is used. Bug: 20066058 Change-Id: I3471e3a11edae04777163b0dbd74e86495743caa
* Mark apps as not-idle at least onceAmith Yamasani2015-04-063-4/+78
| | | | | | | | | | | | On a fresh boot or update to M, mark existing apps as being used if there is no existing entry in the usage stats. On subsequent OTAs, make sure that at least the new system apps are marked as used. Reduce idle threshold to 1 day. Bug: 20066058 Change-Id: I9a273c051d04432877bacd381c85bf6e721c1a85
* Throttle jobs for idle appsAmith Yamasani2015-04-032-2/+148
| | | | | | | | | | | | | | | | | | | 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
* Merge "Fix issue where pruned UsageStats files would not be removed from index"Adam Lesinski2015-03-021-12/+17
|\
| * Fix issue where pruned UsageStats files would not be removed from indexAdam Lesinski2015-03-021-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This would cause an exception to be thrown when querying stats that included a deleted file and cause only in-memory stats to be returned. This change now re-indexes after deleting files. Furthermore, we continue reading UsageStats files in order to return more useful data if some other issue (file corruption) leads us to fail reading a file. Change-Id: I4a52739624d68e719e3d7d324a0b16709a62ac7a
* | Merge "Add generic "INTERACTION" event type to UsageStatsManager"Adam Lesinski2015-03-023-1/+35
|\ \ | |/
| * Add generic "INTERACTION" event type to UsageStatsManagerAdam Lesinski2015-03-023-1/+35
| | | | | | | | | | | | | | | | 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
* | Fix UsageStats to report correct endTime from XMLEdward Cunningham2015-02-271-1/+1
|/ | | | | Bug: 19529542 Change-Id: Iacb1a245a40c6b88ae15740797217f59d5fca1e6
* UsageStatsService: Update file index to prevent double checkinAdam Lesinski2014-11-072-14/+31
| | | | | | | | | We seem to have renamed a file as checked-in twice, which means we checked it in twice and created a malformed name with the suffix "-c-c" instead of the correct suffix "-c". Bug:18280677 Change-Id: Ie3164010898a333e5d9b97151d285ea376de799e
* Fix bug where checking-in more than once would cause an infinite loop in ↵Adam Lesinski2014-11-041-0/+1
| | | | | | | | | UsageStatsService - Forgot to increment loop variable :S Bug:18239732 Change-Id: Ie37a83584d7849108dbfd3bd4cbb595520d488b1
* Merge "Add dumpsys output to UsageStatsService, along with --checkin ↵Adam Lesinski2014-10-294-14/+240
|\ | | | | | | support" into lmp-mr1-dev
| * Add dumpsys output to UsageStatsService, along with --checkin supportAdam Lesinski2014-10-244-14/+240
| | | | | | | | | | Bug:17814138 Change-Id: If414ae5f4b8e4a2838f63f52d80e764915cee934
* | Get UsageStats if no PackageUsage is available for boot dexopt filtering.Jeff Hao2014-10-231-1/+6
|/ | | | | Bug: 17191977 Change-Id: I33e18459e49afa42b8e8218574a2434e5205a6da
* Use VMRuntime.isBootClassPathOnDiskBrian Carlstrom2014-09-301-0/+4
| | | | | Bug: 17679443 Change-Id: If53c236058a7237d735c2344a715cf0a36301f9b
* Merge "UsageStats should deal with changing time" into lmp-devAdam Lesinski2014-09-123-83/+175
|\
| * UsageStats should deal with changing timeAdam Lesinski2014-09-113-83/+175
| | | | | | | | | | | | | | | | | | When the system time is changed, the UsageStats API will modify all existing entries to correspond with the new time change. If the time changed when the device was off, stats in the future will be deleted. Change-Id: Ica3e9917d4d1a180f97700e52ab390e3673e1e82
* | Apply cross-user restrictions to ShellAmith Yamasani2014-09-101-0/+1
|/ | | | | | | | | | | | | | Even though Shell user is allowed to perform cross-user actions, lock that path down if the target user has restrictions imposed by the profile owner device admin that prevents access via adb. If the profile owner has imposed DISALLOW_DEBUGGING_FEATURES, don't allow the shell user to make the following types of calls: start activities, make service calls, access content providers, send broadcasts, block/unblock packages, clear user data, etc. Bug: 15086577 Change-Id: I9669fc165953076f786ed51cbc17d20d6fa995c3
* Store time offsets for UsageStats XMLAdam Lesinski2014-09-056-87/+122
| | | | | | | This will make adjusting for time changes easier in the future. Change-Id: I49d2dda4cc6dcb1378a58c814849924f585e0417
* Returns UsageEvents from previous daysAdam Lesinski2014-09-055-173/+301
| | | | | | | | - Avoid writing to disk when querying UsageStats. - Use new UnixCalendar to avoid issues with Locale and TimeZone. Bug: 16951313 Change-Id: I2473b8ef8dc1e2f6be22d4c689b96e346bdcafd5
* Add Configuration changes to UsageStatsAdam Lesinski2014-09-045-105/+346
| | | | | Bug:17354208 Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
* Split up ComponentName in UsageEvents.EventAdam Lesinski2014-08-264-36/+57
| | | | | | | | Some events in the future may not have originated from a class, so we shouldn't be using ComponentName. Bug:17259858 Change-Id: Id7fe3245b91596cf27ae4ec51655602f01665622
* Fix NPE in UsageStats for new UserAdam Lesinski2014-08-122-3/+7
| | | | | | Bug:16946585 Change-Id: Ibd0d674681f3f49087305cea33ce7292f5d2229d
* Second iteration of the UsageStats APIAdam Lesinski2014-08-087-222/+605
| | | | | | | 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-252-233/+401
| | | | Change-Id: I4518c5d3c56b3821292accb886f9fb21f3a8b25f
* Add test UsageStats AppAdam Lesinski2014-07-221-2/+2
| | | | | | | Also fixed UsageStatsService to do the right thing when AppOps returns MODE_DEFAULT. Change-Id: I0bdb28350fb2528daf2859cdcbbf9ca48d96dde9
* Change UsageStatsService to check uses-permissionAdam Lesinski2014-07-211-4/+16
| | | | | | | Have UsageStatsService check permission grants when AppOps returns the default MODE_IGNORED mode for a package. Change-Id: I784a708451a56863b13fc5f178e10bba6ce37a2f
* First iteration of a public UsageStats APIAdam Lesinski2014-07-184-0/+860
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