History log of /frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
423244469797cbaccd66f5ed210841647d7072e8 02-Nov-2015 Dianne Hackborn <hackbod@google.com> Fix issue #25357209: Could not send SMS or MMS messages, had to reboot

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
5ded7af622539ded176f81951843c3c52c89a6d1 15-Sep-2015 Jeff Sharkey <jsharkey@android.com> Fix parole scheduling bugs.

There were a few subtle bugs in app idle parole scheduling that
would cause us to never end a parole period we had entered. The
updated logic in this change concentrates the registration for the
next event in one place in setAppIdleParoled().

Bug: 24050462
Change-Id: I1efe43cd6e00a547f70c4a4a37e1f3ef52a7e706
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
af75c17bca8b2f017e254131393cd72e2fe7c6e8 18-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #23270878: NPE in UsageStatsService while running UserManagementTest

Change-Id: I34d4fcdc103b3a6ea5c4ed78895f2fe18597237a
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
4a503b1ece485d44c15eb02ec2bcd464b46e6f7f 07-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22989030: Separate battery whitelists

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
7cc902bea78dd16488d367e8ed0ccf25d4d825c2 22-Jul-2015 Wenchao Tong <tongwenchao@google.com> Ignore the active network scorer when checking for idleness

Bug: 22667334
Change-Id: I97085e653c146eff148458440bbac0a2ac64d6d2
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
fd854ee58c5d56f84047007ead9f88a767ae956f 14-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21626564: MMS should be receivied while Dozing

We now place whoever is receiving the MMS on the temporary
whitelist while doing so, so they can get network access to
download it.

There was also an issue that needed to be fixed where we
were no longer updating the list of allowed uids while
dozing based on their proc states... we now do that.

Also did a bit of optimization of the temp white list update
path do the network policy manager, instead of going through
a broadcast we now directly call in to the network policy
manager. This also allows us to have a synchronous version
of updating the list, so we can know the app has network access
before we tell it to do anything.

Finally added battery stats events for things going on and off
the whitelist so we can diagnose the behavior there.

Change-Id: Ic7fe010af680034d9f8cb014bb135b2addef7455
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
8dca36dc8a5d17315775ce216689addc5bd9be00 19-Jun-2015 Xiaohui Chen <xiaohuic@google.com> system_server: optimize app idle parole state change

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
92617036fcc9b25378c8448c923d6346a012346b 20-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21930140: Add config to turn off auto power features

Doze and app standby are now off in the default platform config.
The Google overlay turns them on. Other people can do that as
well, if they are feeling like it.

Change-Id: Ic8a87f696df94f2d8354fe0772d03b672f464e32
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
37a40c24deb02bca3868a8085069afae112f22e4 17-Jun-2015 Amith Yamasani <yamasani@google.com> App Standby : Association between content providers and their sync adapter

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
a750a63d639f6936af456df904fa6b9ba941885e 17-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21814207 and issue #21814212 (alarm manager)

Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions. There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController. Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
1958e5e7870579337f1d1d3e6c6fae096ba3abb9 13-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21813831: Need API for asking to be added to power whitelist

Add the API. Clean up a few related things.

Change-Id: I190adad1812f36f6095b98a1001fedb94874e8b5
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
a6232df053cdc2df9d8a1d97a5c81d55cce7a1e2 12-Jun-2015 Adam Lesinski <adamlesinski@google.com> App Standby: Convert constants to Settings.Global

Use settings instead of hardcoded constants, and listen for their changes.

Bug:21640379
Change-Id: Id8305bb234f93f7c64c1a5e82e26b31504624324
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
6776849dc5ff851a225745393f082b702754e278 09-Jun-2015 Amith Yamasani <yamasani@google.com> Report app standby state to batterystats

Also reduce idle checks to the target user if possible.
Optimized calls to some internal methods

Bug: 21639147
Change-Id: If1faf26f862e5c4ca905f2603a4ba52a8d1af954
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
c8e8729244d75584ce71a74d29c452fe538a22c5 11-Jun-2015 Adam Lesinski <adamlesinski@google.com> UsageStats: Change INTERACTION to SYSTEM_INTERACTION

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
b4b9ca7580c75f07330e5222cbd9ccc93b12935e 19-May-2015 Zach Johnson <zachoverflow@google.com> Ignore carrier apps when checking for idleness

Also introduce a way to check if a package has
carrier privileges for any active phone.

Change-Id: If5c5fe07f05ffc90fc21431eb27cf48030c0175b
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
af575b9f8e1b59be9c8862b6a65c0dcb88145a23 30-May-2015 Amith Yamasani <yamasani@google.com> Temporarily whitelist an app for network during doze

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
547116ea62bde21012dbda1531cb58dfe61026a7 20-May-2015 Amith Yamasani <yamasani@google.com> Use screen-on time and wallclock time for idleness calc

12 hours of screen-on time and 2 days of wallclock time
must elapse before considering an app idle.

Bug: 20066058
Change-Id: Ie7b584b40e644d868aa2708876723c3391fd432e
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
901e924392dd79c6d1b61c3bb92461585f7b3204 14-May-2015 Amith Yamasani <yamasani@google.com> Allow settings to change app inactive state

Change-Id: I57efb4b5fa69c9a268025fb1ef83de36c4cc83ca
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
0a11e69428d4c00dfcb368c1eb4e60ad8e0dc918 09-May-2015 Amith Yamasani <yamasani@google.com> Track app idle history and dump it

"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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
520d8f2ac6ad2c3cd244e1f710103b3a43a41725 09-May-2015 Amith Yamasani <yamasani@google.com> Allow exemption to idle apps at periodic intervals

Triggers are device idle mode changing as well as
internal delayed message handlers.

Bug: 20066058
Change-Id: I0627cfbcc16cfc2b8ac7d298fd2c681a5a6571dd
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
06bf824628c118fbd5ad6756913d7fd63a6f4ce5 09-May-2015 Amith Yamasani <yamasani@google.com> Idle timebase

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
e5f330456bdf5e138485ee117929fc4337866132 08-May-2015 Amith Yamasani <yamasani@google.com> Rename *AppIdle to *AppInactive per api-council

Change to setAppInactive and isAppInactive in a few places.

Bug: 20823737
Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
e4a8da8ea241858b52d8122480316db79582c44d 01-May-2015 Amith Yamasani <yamasani@google.com> Exclude bound app widgets from idle app list

Track package names of bound app widgets and use the list when
querying for idle apps.

Bug: 20066058
Change-Id: If8039397a061ef04bb13aa38d57cd7f0221f5fc7
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
15e47235c055495ec0ccc24768a6746a960d3a61 25-Apr-2015 Amith Yamasani <yamasani@google.com> Remove network access for idle apps

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
f47e51ec605fccf7fed9e50d1adc98fbd4e8b340 17-Apr-2015 Amith Yamasani <yamasani@google.com> More usage tracking

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
cf76872a62075abf9008e99ca08413fb70761dc2 24-Apr-2015 Amith Yamasani <yamasani@google.com> Add ability to get and set idle state of apps

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
96a0fd65e18e5b9a0eaed3c24fd8a60a1fac1c3a 11-Apr-2015 Amith Yamasani <yamasani@google.com> Delay syncs for idle apps

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
55717a613c23fc6b05cab86c3b0de283a027e9f6 04-Apr-2015 Amith Yamasani <yamasani@google.com> Mark apps as not-idle at least once

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
b0ff32245cb6b51e43dd3ee40b86d683c62de2b9 04-Mar-2015 Amith Yamasani <yamasani@google.com> Throttle jobs for idle apps

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
978a1ed5aa2752cd36ff51df91d2d2d8be2171d9 02-Mar-2015 Adam Lesinski <adamlesinski@google.com> Add generic "INTERACTION" event type to UsageStatsManager

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
720a5c51beb5beab442832ea8d169aa5b4edb43f 30-Oct-2014 Adam Lesinski <adamlesinski@google.com> Merge "Add dumpsys output to UsageStatsService, along with --checkin support" into lmp-mr1-dev
1bb18c435dbf967f3a9bc9d680411471b8bab4ac 18-Aug-2014 Adam Lesinski <adamlesinski@google.com> Add dumpsys output to UsageStatsService, along with --checkin support

Bug:17814138
Change-Id: If414ae5f4b8e4a2838f63f52d80e764915cee934
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
7eb599b267d00cbde891c0a87924f2f5086f4497 23-Oct-2014 Jeff Hao <jeffhao@google.com> Get UsageStats if no PackageUsage is available for boot dexopt filtering.

Bug: 17191977
Change-Id: I33e18459e49afa42b8e8218574a2434e5205a6da
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
3bab7c188d5e823484eda5c0f3df7759ce4a6c98 12-Sep-2014 Adam Lesinski <adamlesinski@google.com> Merge "UsageStats should deal with changing time" into lmp-dev
66143fa5b34eea7413335111838fb692987b611a 11-Sep-2014 Adam Lesinski <adamlesinski@google.com> UsageStats should deal with changing time

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
8cd28b57ed732656d002d97879e15c5695b54fff 09-Jun-2014 Amith Yamasani <yamasani@google.com> Apply cross-user restrictions to Shell

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
37a46b48dcb7e34ee3669cfb2ed78af08bfca3c7 06-Sep-2014 Adam Lesinski <adamlesinski@google.com> Store time offsets for UsageStats XML

This will make adjusting for time changes easier
in the future.

Change-Id: I49d2dda4cc6dcb1378a58c814849924f585e0417
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
d26bea3a1498d1b327ae37cc796fb8cd67e9c977 04-Sep-2014 Adam Lesinski <adamlesinski@google.com> Returns UsageEvents from previous days

- Avoid writing to disk when querying UsageStats.
- Use new UnixCalendar to avoid issues with Locale and TimeZone.

Bug: 16951313

Change-Id: I2473b8ef8dc1e2f6be22d4c689b96e346bdcafd5
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
7f61e96db7c90c1f4418359672aa4656aebee500 03-Sep-2014 Adam Lesinski <adamlesinski@google.com> Add Configuration changes to UsageStats

Bug:17354208
Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
9d9607527f5bbf49c96565b63b90e36276b0dda7 25-Aug-2014 Adam Lesinski <adamlesinski@google.com> Split up ComponentName in UsageEvents.Event

Some events in the future may not have originated
from a class, so we shouldn't be using ComponentName.

Bug:17259858
Change-Id: Id7fe3245b91596cf27ae4ec51655602f01665622
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
9a0b289f060e68e42d3db0b843d55cf920f3da12 12-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix NPE in UsageStats for new User

Bug:16946585

Change-Id: Ibd0d674681f3f49087305cea33ce7292f5d2229d
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
3516800b611a79339a3c188332d13a26e9086b09 22-Jul-2014 Adam Lesinski <adamlesinski@google.com> Second iteration of the UsageStats API

Based on feedback from API council, updated the API.
Also added support for querying the event log.

Change-Id: Ibaa008b9e5bd145acdfe8e20c25c2ed2d96be123
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
3c153519ca5f2b66b88901374383f943c9d77df7 24-Jul-2014 Adam Lesinski <adamlesinski@google.com> Add Per-User logging of UsageStats

Change-Id: I4518c5d3c56b3821292accb886f9fb21f3a8b25f
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
e159e2e0b83f9ea9d48f4c8666f9536e9338a70c 23-Jul-2014 Adam Lesinski <adamlesinski@google.com> Add test UsageStats App

Also fixed UsageStatsService to do the right thing
when AppOps returns MODE_DEFAULT.

Change-Id: I0bdb28350fb2528daf2859cdcbbf9ca48d96dde9
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
53ab92d89069fb0178ba98eb641a6fc87145543a 21-Jul-2014 Adam Lesinski <adamlesinski@google.com> Change UsageStatsService to check uses-permission

Have UsageStatsService check permission grants when AppOps
returns the default MODE_IGNORED mode for a package.

Change-Id: I784a708451a56863b13fc5f178e10bba6ce37a2f
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java
0debc9aff4c0cbc28e083a948081d91b0f171319 17-Jul-2014 Adam Lesinski <adamlesinski@google.com> First iteration of a public UsageStats API

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
/frameworks/base/services/usage/java/com/android/server/usage/UsageStatsService.java