Bugfix for widget PendingIntents on Android Oreo and higher #957
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When attempting to play music from the home screen widgets on Android 8 and higher, if the DownloadService has been stopped by the OS due to its idle state, the service fails to start and this message is logged:
W/ActivityManager: Background start not allowed: service Intent { act=github.daneren2005.dsub.CMD_TOGGLEPAUSE flg=0x10000000 cmp=github.daneren2005.dsub/.service.DownloadService bnds=[697,1868][1059,2010] } to github.daneren2005.dsub/.service.DownloadService from pid=-1 uid=10316 pkg=github.daneren2005.dsub startFg?=false
Instead, the service needs to be started as a foreground service. I have created that fix in this PR.
Interestingly, the notifications didn't need to be fixed because notifications are exempted from this limitation. Note the whitelisted intents here: https://developer.android.com/about/versions/oreo/background
This is related to #880.