update_engine: Force Update + Install uniform logic pattern
The change here is to make the exit points within |CheckForUpdate()| and
|CheckForInstall()| uniform with simpler logic.
When a force update or install is called, it is heavily dependent on the
|forced_update_pending_callback_| and the existence of a scheduled
update in the message loop. The |forced_update_pending_callback_| is the
one that notifies a change hence calling upon |OnUpdateScheduled()| that
was waiting on the message loop.
The call to |ScheduleUpdates()| before forcing the callback is to
guarantee that the |forced_update_pending_callback_| will take effect.
Even if the |forced_update_pending_callback_| is not set, it is not a
failure. Simply, the periodic check will use the set forced variables
when it is scheduled.
BUG=none
TEST=FEATURES="test" emerge-${BOARD} update_engine
Change-Id: Ic97671a70880c8b05d513a8dea93fce3b982bbf6
2 files changed