Skip to content
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

Foreground service closes automatically #10

Open
sxtfv opened this issue Jun 22, 2021 · 0 comments
Open

Foreground service closes automatically #10

sxtfv opened this issue Jun 22, 2021 · 0 comments

Comments

@sxtfv
Copy link

sxtfv commented Jun 22, 2021

Hi, I am new in Android development and your post was very helpful in understanding how to implement foreground services
I am testing this project on Xiaomi Mi 9T but unfortunately service shuts down automatically and notification is removed after 10 minutes or so (Sometimes, it runs for 1 hour and then ends silently).
I tried to modify this example by adding android:process entry in manifest file but it wasn't really helpful

<service
     android:name=".EndlessService"
     android:process=":EndlessService"
     android:enabled="true"
     android:exported="false">
</service>

I tried to remove battery optimization restrictions from this app but it didn't help also. I've noticed that it closes even when I am using phone (so that the phone is not locked and application shouldn't be affected by Doze mode)
Could you please help me figure out how to fix this? If you need more information about my setup, please, let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant