-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not stop service if task removed : #1783 #1784
base: develop
Are you sure you want to change the base?
Conversation
Thanks @brvier for the pull request. Could you elaborate why this is needed? |
Why commenting it ? Bad habits. I don't understand why you want killing service and testing it when app is closed. One example, if you have a Bluetooth connection in your service, you lost it, need to rescan, which could not be done at any moment in a background service, especially on some devices which prevent Bluetooth scan in background. All other background service do the same. I'll found other example and try to understand why this was introduced in #1374 |
From my own tests if the system kills the app at any point to preserve battery the service will actually continue to run. From this it appears that this service stop only happens if the user explicitly stops the app either via some integrated button calling And isn't it kind of expected that everything stops when the user shuts down the app explicitly? Can you elaborate why you would want to not have that happen? |
Not exactly, you should close user interface, but you should also keep background service communicating with external device working. There are many example of service running in background while user kill the app but it s mandatory to keep a permanent notification :
There are many examples :) |
In our app, we are trying to have a service that runs in the background regardless of user interaction. Can we get this merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful
Comment the stopSelf(); in onTaskRemoved.