shill: defer resume actions until after completion of ongoing suspend actions
After powerd notifies shill that a suspend is imminent via a
SuspendImminent D-Bus signal, shill performs suspend actions, and then
upon the completion of these actions, notifies powerd that it's ready to
suspend via powerd's SuspendReadiness D-Bus method. Later, powerd
notifies that shill a suspend attempt is completed or cancelled via a
SuspendDone signal and shill performs resume actions.
However, powerd may notify shill the completion of a suspend attempt
before shill reports its readiness to suspend (e.g. when the suspend
attempt is cancelled while shill is performing the suspend actions).
It's problematic if shill performs the resume actions before it
completes the ongoing suspend actions. This CL addresses this problem by
deferring the actions taken in response to powerd's SuspendDone signal
if shill is still performing suspend actions and hasn't yet reported its
readiness to suspend.
TEST=Run unit tests.
TEST=Run network_MobileSuspendResume test on a DUT with a modem.
TEST=Manually close the lid of a DUT and then quickly reopen the lid.
Verify that shill performs resumes actions after completing suspend
Commit-Ready: ChromeOS CL Exonerator Bot <firstname.lastname@example.org>
Commit-Ready: Ben Chan <email@example.com>
Tested-by: Ben Chan <firstname.lastname@example.org>
Reviewed-by: Dan Erat <email@example.com>
3 files changed