• Jeff Sharkey's avatar
    Move DownloadManager to use JobScheduler. · 3a5f5eaf
    Jeff Sharkey authored
    JobScheduler is in a much better position to coordinate tasks across
    the platform to optimize battery and RAM usage.  This change removes
    a bunch of manual scheduling logic by representing each download as
    a separate job with relevant scheduling constraints.  Requested
    network types, retry backoff timing, and newly added charging and
    idle constraints are plumbed through as job parameters.
    
    When a job times out, we halt the download and schedule it to resume
    later.  The majority of downloads should have ETag values to enable
    resuming like this.
    
    Remove local wakelocks, since the platform now acquires and blames
    our jobs on the requesting app.
    
    When an active download is pushing updates to the database, check for
    both paused and cancelled state to quickly halt an ongoing download.
    
    Shift DownloadNotifier to update directly based on a Cursor, since we
    no longer have the overhead of fully-parsed DownloadInfo objects.
    
    Unify a handful of worker threads into a single sh...
    3a5f5eaf
AndroidManifest.xml 6.38 KB