I would like to use WorkManager to download files from Web, but I’m saddened by the JobScheduler restriction - 10 minutes to work. Perhaps there are alternative ways or you have to use foreground service?
I haven't heard of any 10-minute windows imposed on Work/Jobs per-se, however I did find a reference to a 10 minute restriction on jobs in the Power management restrictions:
If jobs restrictions are in force, the app is granted a window of ten minutes at the specified interval. At the end of the ten minutes, all jobs are postponed until the next window.
Which doesn't really tell us what happens if the job is still executing at that 10 minute mark, however, I would suggest that if your work is taking more than 10 minutes, you should structure it differently.
First thing would be to schedule new work for each file that needs to be downloaded. You probably shouldn't try and download all your files at once. If you need a guarantee that some files get downloaded in a particular order, then look into building a chain of the different download tasks. This strategy also has 2 large benefits: if one file download fails, you can reschedule just that file download and not all X files you might have already downloaded by that point, and - according to the power management docs - all files that then haven't been downloaded will just be postponed to the next 10 minute window.
Secondly, if any given file takes more than 10 minutes to download, or that's a very likely possibility given the size of your files, then you should look into range requests so that you can save portions of a file to disk and every time your work hits the 10 minute limit, you can retry or reschedule more work to continue the download in a future window.
Finally, I would seriously question whether your business logic requires the app to do so much work when battery restrictions apply. It's probably better to specify that this kind of Work must be executed while charging, or at least while not in doze mode (not idle) so as to avoid this 10-minute window altogether.
Hope this answer helps!