Always download apks in foreground service
Right now, apk downloads are only done in a foreground service if Preferences.get().isUpdateNotificationEnabled()
. However, this means that starting a large donwload such as Firefox, then putting the phone in your pocket while you wait for it to download, has the potential for the service to be killed by Android before completion.
I suggest that downloads for .apk files are always in the foreground.
This means that a notification must always be shown, but such is the Android way.
Another, more-correct-but-difficult-to-implement solution would be to only have it in the foreground if the AppDetails
activity for that particular apk is visible. However I'm not sure how to achieve this, or even if it is in fact the best solution.