3af168c834d73487f8f614f0aaafbf6f9a850f0f |
|
26-Jan-2016 |
James Lemieux <jplemieux@google.com> |
Refactor the mechanism for delivering periodic callbacks Bug: 25983208 Bug: 26381960 Periodic timed callbacks are used to update portions of the UI that may change at time boundaries, such as date displays when midnight passes. The old mechanism required the API user to define their own Handler and also compute and schedule each callback. Also, no corrective rescheduling occurred if the device time changed. The new design introduces PeriodicCallbackModel as a delegate to UiDataModel. The delegate removes all of the burdens associated with scheduling and canceling period callbacks. The caller need only supply the Runnable that contains the logic to execute and an offset in millis if they want to be called before or after the period ends. Change-Id: Ibb51b22af081fc4df60ee1c561f2c9aaf1ddef96
/packages/apps/DeskClock/src/com/android/deskclock/MoveScreensaverRunnable.java
|