• chriadam's avatar
    [msyncd] Ensure we allow device suspend after sync is triggered. Contributes to JB#34349 · f7561ea0
    chriadam authored
    This commit ensures that the onBackgroundSyncCompleted() handler is
    invoked when the sync status for an active background sync transitions
    to a finished (error/done/cancelled) state.  This handler will stop
    the background activity which prevents device suspend.
    
    It also ensures that if no scheduled-sync-alarm can be set (e.g., if
    no next scheduled time exists) that the background activity is also
    stopped.  This can occur if the profile has peak (rush) schedule but
    no off-peak (non-rush) schedule.
    
    Together, these changes should ensure that msyncd doesn't prevent
    device suspend for longer than it takes to complete its sync actions.
    
    Contributes to JB#34349
    f7561ea0