Due to wrong battery setting (by user) on the app (eg Android Settings > app > battery) or a bad device OS that doesn't allow the user to have Android correct control, if the OS ends the Service aggressively, the app's FsService code uses onTaskRemoved to start again.
This can sometimes (not always) cause a hard app crash at startForeground() in FsService. Other startForeground()'s elsewhere can also see this crash issue.
A simple way to deal with this is to catch the Exception. But, the app will not come back up automatically at that time where it fails. It will only keep the hard crash from happening.
There might be something else that can be done further. There might not be.
-
(Its possible that there could be something else involved that is in my code and not here, but I don't see that as being the problem.)
-
No longer seeing this happen. Will test a fix and make a pull request to eliminate the possibility. Just won't know why it happened. Edit: It only showed up under certain networking changes / networking firmware bug. Either a great coincidence, or a side effect of a specific networking issue is my best guess.
Due to wrong battery setting (by user) on the app (eg Android Settings > app > battery) or a bad device OS that doesn't allow the user to have Android correct control, if the OS ends the Service aggressively, the app's FsService code uses onTaskRemoved to start again.
This can sometimes (not always) cause a hard app crash at startForeground() in FsService. Other startForeground()'s elsewhere can also see this crash issue.
A simple way to deal with this is to catch the Exception. But, the app will not come back up automatically at that time where it fails. It will only keep the hard crash from happening.
There might be something else that can be done further. There might not be.
(Its possible that there could be something else involved that is in my code and not here, but I don't see that as being the problem.)
No longer seeing this happen. Will test a fix and make a pull request to eliminate the possibility. Just won't know why it happened. Edit: It only showed up under certain networking changes / networking firmware bug. Either a great coincidence, or a side effect of a specific networking issue is my best guess.