Adjust clock gradually when possible

Use adjtime instead of settimeofday when device time is within 30
seconds of the real time. The clock jumping backwards can make certain
logs difficult to understand, and adjtime preserves clock monotonicity.

TEST=ensure clock doesn't move backwards after boot

Change-Id: I4efd081c456cecd228037aa9f8d0b927baaf2029
Commit-Ready: Christopher Morin <>
Tested-by: Christopher Morin <>
Reviewed-by: Dan Erat <>
4 files changed