Commits

Christopher Tate authored b8849c1e858
Align inexact alarms in both time bases; don't pull to wall time The previous implementation failed to properly distinguish between trigger times in the RTC vs the ELAPSED time bases. The pernicious result of this was that sometimes it would decide to align RTC alarms based on, say, 0 rather than on the real current time. This would pull the recurrence into wall-clock alignment, with serious side effects: in particular, periodic tasks that would hit external network resources would, because *all* devices would be pulled into wall-clock alignment, wind up inducing heavy QPS spikes on the backends. The new implementation works completely differently. The basic goal is the same: try to align inexact alarms to "the same" time, avoiding extra wakeups / radio spinups / etc. The way this is done is to divide the timeline into 15-minute quanta, and drift the start time of every inexact alarm onto one of these 15-minute quantum boundaries. The skew between the RTC and ELAPSED time bases is taken into effect; RTC alarms are no longer pulled into wall clock alignment. Fixes bug 3388961 Change-Id: I2a0460e1f5d0e4036f3402f332b642b557b2fc20