Skip to content
  • Philip Withnall's avatar
    libmogwai-schedule: Implement initial D-Bus API and dummy scheduler · 6c63d768
    Philip Withnall authored
    
    
    Here’s the initial implementation of the D-Bus API for the scheduling
    daemon, plus a dummy scheduling algorithm which allows everything when
    the network connection is unmetered, and denies everything otherwise. We
    use GLib’s definition of ‘metered’, which is very coarse grained and
    probably wrong most of the time.
    
    The D-Bus API is implemented manually, rather than using gdbus-codegen,
    as that allows us to implement permissions checks for API calls
    (gdbus-codegen doesn’t). In future, we might want to lock down the API
    more finely using polkit, which has similar requirements for not using
    gdbus-codegen.
    
    There are two D-Bus objects implemented to begin with:
     • com.endlessm.DownloadManager1.Scheduler, which exposes the scheduler
       and allows new schedule entries to be created. It can be accessed by
       any peer who has access to the service at all.
     • com.endlessm.DownloadManager1.ScheduleEntry, which represents a
       single schedule entry (download) for the lifetime of that download,
       including any time before the download is first allowed to start. It
       can only be accessed by the peer which created the entry.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    
    https://phabricator.endlessm.com/T20420
    6c63d768