History log of /frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ad623015a119efe9b63f594af9c4703f40a0c27b 15-May-2017 Makoto Onuki <omakoto@google.com> Restrict access to instant app data in usage stats

- Events are obfuscated based on whether the app was instant or not at
the time each event was logged.

- UsageStats are obfuscated based on whether each app is instant or
not at the moment.

Bug 38202133
Test: Manual test using UsageStatsTest and instant apps

Change-Id: I3c74309196b88d010d317cb0dd6749bf4624e876
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
61d5fd7fee3250bdf4b6ddfbccbd6bceae9436c6 24-Feb-2017 Amith Yamasani <yamasani@google.com> Reduce screen on delay during UsageStats rollover

Decoupled the app idle book-keeping from usage stats lock, by
introducing an mAppIdleLock. This is used for all state related
to app idle. In some cases, the locks will be nested, with
mLock being acquired first and then mAppIdleLock.

This should fix the situation where a rollover, which writes to
disk and could take several seconds when the system is swamped,
like when the device just came out of idle and the screen was
turned on (like this run-on sentence), causes calls from other
services for app-idle status to be blocked. This was resulting
in a long time to turn on the screen.

Also fixed a dump indentation issue.

Bug: 34627115
Bug: 34961340
Test: Manual, force into idle, increased rollover frequency,
and tested screen on time.

Change-Id: Ie8b44e6f07f82d8a31f1b733a403dd9b6dc310f6
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
9fa2a2cd46e11be0ea50ad7be0d3dd2c9273f55a 06-Jan-2017 Kang Li <kanlig@google.com> Adds annotations to Intent, and enables ChooserActivity to rank apps
according to annotations.

Test: Unit tests and manul tests. More unit tests to be added.
Change-Id: I3cbfd0cc10007290585fa3e7e3c92e1731f1f7b8
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
53b4314ad9b43b1890cbd765b896ccb0f005fdeb 14-Nov-2016 Kang Li <kanlig@google.com> Add Sharing Histories to UsageStatsManager.

This CL is for Android O Smart-Sharing (b/30982298). By this CL, sharing
counts are logged with UsageStatsManager.

Bug: 30982298
Test: manual - shared images in Camera and texts in Chrome using a mobile device.

Change-Id: I0b4aa0506f99b3083d140a48f7b4bdd5b1c5afb6
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
ac042501c816fa9a65aed005060ebdcfc0a0f3b2 21-May-2016 Makoto Onuki <omakoto@google.com> ShortcutManager: Implement usage report API

Bug 28536054

Change-Id: I293e8eaad523e3b0d76d562fc381601633451ed3
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
a93542f9d341897f3206f775fd5720663b17504f 04-Feb-2016 Amith Yamasani <yamasani@google.com> Rewrite app standby stats

Don't mix up with usage stats. Keep a separate db and history
based on elapsed time and screen on time.

Unit tests for AppIdleHistory class.

Bug: 26989006
Change-Id: If343785b46da1db67f7c1c1263854c2732a232c6
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
63668e8ab04c1eb05b8d63371c3547677129f1b9 28-Jan-2016 Adam Lesinski <adamlesinski@google.com> Merge commit '5142a2d5b3f70c2017792ce04d3f254221ab3d21' into manual_merge_5142a2d5b3

Change-Id: I6681b0e132e95bd7e861e183e7369b4da07738eb
b2d3ffaa208e341b67285e761e58ea39df89f906 27-Jan-2016 Adam Lesinski <adamlesinski@google.com> Don't change screen on time on time changes

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
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
8a6ce2cb64f4d61ee426240c539dc8b00dac857f 17-Dec-2015 Ritesh Reddy <riteshr@google.com> Enabled Backup/Restore of Package UsageStatistics

Backing up UsageStatistics using a new API in
UsageStatsService like the Notifications backup.
The backup logic is in the same package as UsageStatsDatabase
while the BackupAgentHelper resides in the android package
alongside SystemBackupAgent.

Bug: 26179323
Change-Id: I022d85fbcd4abb763230bec6eea50a7e723b5152
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
89a697a7e78de121a228b5a8d08a86ee76a40f1c 14-Jan-2016 Adam Lesinski <adamlesinski@google.com> Merge "UsageStats: Use new settings key idle_duration2 for app idle" into mnc-dr1.5-dev am: d2e215978b am: a5c7106017
am: 6a8c328d73

* commit '6a8c328d7386d19f4590dfbfc71338b1ec208fb7':
UsageStats: Use new settings key idle_duration2 for app idle
f0ef3c112683e4e04406f0355de34f4f1ac20386 13-Jan-2016 Adam Lesinski <adamlesinski@google.com> UsageStats: Use new settings key idle_duration2 for app idle

Ignores the old, re-appropriated key "idle_duration" which is now
set to a high value in order to force disable app idle on devices
with bug b/26355386

Bug:26355386
Change-Id: Iff9de843ad6e547d29c1583687fc7f7ce7e15090
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
7856f3c283e6332c22d5cee41d2e673e1dfe09f8 13-Jan-2016 Adam Lesinski <adamlesinski@google.com> UsageStats: Fix issue where initializing data for first time would cause crash

With the updated rolling window of stats for app idleness, we need to make sure
it is populated before we initialize some defaults.

Now that we look at older entries to figure out idleness, if those
entries are in the future (due to time change), set them to the current
screen on time.

Bug:26504153
Change-Id: I4c21e8f094a1a6727373368d043f523053280d7d
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
76e9d76c22fe164f301e85ebbcbdd4cae26fca71 12-Jan-2016 Adam Lesinski <adamlesinski@google.com> UsageStats: Fix issue where initializing data for first time would cause crash

With the updated rolling window of stats for app idleness, we need to make sure
it is populated before we initialize some defaults.

Now that we look at older entries to figure out idleness, if those
entries are in the future (due to time change), set them to the current
screen on time.
Bug:26504153

Change-Id: Ia22add0e8eaf0f137002bbe3e91d747fef5b7d69
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
881f6f9266ca15e7c6302d659b07d06ecfe40300 13-Jan-2016 Adam Lesinski <adamlesinski@google.com> resolve merge conflicts of 551fc6823a to master.

Change-Id: I2778bf2a364c103fc0d351f2afc4fc73bede2f19
da4a3775735ffc0fa510031f75bc459b764b259d 08-Jan-2016 Adam Lesinski <adamlesinski@google.com> UsageStatsService: Fix app idle issue at rollover time

App Idle queries are very frequent and so they only check in memory stats.
However, in memory stats can be missing some entries, especially after a rollover, but also
due to a larger bug fixed in master (too risky to take now).

The fix is to do a deep query (reading older files from disk) and maintain a parallel cache
of stats for app idle. That way the rolling window of data required to serve app idle queries
stays in memory.

Bug:26355386
Change-Id: I2dd3946b45d7d893410715bb0534b2b48694ced6
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
e06b4d1d9f718b9fe02980fea794a36831a16db2 06-Jan-2016 Jeff Sharkey <jsharkey@android.com> Consistent naming for PackageManager methods.

When hidden PackageManager methods take a userId argument, they
should be named explicitly with the "AsUser" suffix. This fixes
several lagging examples so that we can pave the way to safely
start passing flags to new methods without scary overloading.

Also fix spacing issues in various logging statements.

Change-Id: I1e42f7f66427410275df713bea04f6e0445fba28
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.java
7cba1d46d37b2d1ef85a67d8cfab6b37ce0c4eb3 05-Aug-2015 Adam Lesinski <adamlesinski@google.com> UsageStats: Fix time change handling

When the time changed, we would end up creating a new stats file, even if we could
reuse an old one. On systems where the time toggled a lot, this would generate
hundreds of files and slow down other IO operations on this set.

Now we properly reuse stats files after time changes. The time at which a particular
file began recording was always clamped to the start of the interval (day, month, year).
However, this makes no sense when the time changes, and clamping to the start of the interval
would always cause a new file to be created, since the current time no longer fell into that
time interval. So now the time is just offset from the last file's end time.

Bug:22716352
Change-Id: I6cec156e2e93b4402116600fa09c1018f3b870fe
/frameworks/base/services/usage/java/com/android/server/usage/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.java
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/UserUsageStatsService.java
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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.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/UserUsageStatsService.java