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
|