mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

DownloadManager doesn't know enough about the Downloader implementations to know that interrupting the thread is the right thing to do. In particular, if a Downloader implementation wants to delegate work to additional worker threads, then it will probably not want its main thread to be interrupted on cancelation. Instead, it will want to cancel/interrupt its worker threads, and keep its main thread blocked until work on those worker threads has stopped (download() must not return whilst the Downloader is still touching the cache). This change moves control over what happens to the individual Downloader implementations. Issue: #5978 PiperOrigin-RevId: 309419177