History log of /frameworks/base/services/usage/java/com/android/server/usage/UnixCalendar.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/UnixCalendar.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/UnixCalendar.java