endless-service
endless-service copied to clipboard
Foreground service closes automatically
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