OSDN Git Service

UsageStatsService: Fix app idle issue at rollover time
authorAdam Lesinski <adamlesinski@google.com>
Fri, 8 Jan 2016 02:24:53 +0000 (18:24 -0800)
committerAdam Lesinski <adamlesinski@google.com>
Sat, 9 Jan 2016 05:58:52 +0000 (05:58 +0000)
commitda4a3775735ffc0fa510031f75bc459b764b259d
treed14fbecb3b31f5b58a3ca1c1df37d71c76d7699b
parentc2ec3f1bbe7271be2126b48fc94acc42a37f43f2
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
services/usage/java/com/android/server/usage/UserUsageStatsService.java