9042b0b548db623f7f465767008a27d305299aa9 |
|
18-Feb-2016 |
James Lemieux <jplemieux@google.com> |
Introduce StopwatchListener to gracefully handle BOOT_COMPLETE After a device reboot, there is a window of opportunity (about 15 seconds) in which the user may open the Clock app and view the stopwatch. They will see the stopwatch in a non-operational state. When BOOT_COMPLETE is finally broadcast, the stopwatch is reset and the laps are cleared. Prior to this change, the stale lap data would continue to be displayed because no mechanism existed to notify StopwatchFragment of changes to the stopwatch data by an external entity. This change introduces StopwatchListener, which is notified of changes to the stopwatch and its laps. The StopwatchFragment uses this listener to react to stopwatch changes from external entities, such as the BOOT_COMPLETE receiver. Clearing laps is now a byproduct of resetting the stopwatch instead of an independent update to the model. Change-Id: Ie1aa3d3e5006d8a28947cb3cd6343175d1c3644c
/packages/apps/DeskClock/src/com/android/deskclock/data/StopwatchListener.java
|