protiumx / rest

Turn music off after a period off time and rest
MIT License
23 stars 9 forks source link

Services not working on Samsung J2 Android 6 - API Level 23 #1

Open roboticscm opened 5 years ago

roboticscm commented 5 years ago

I Install the Rest application on Samsung J2, start the application, set 5 minutes, click Start and close the application. After that, I played music from Youtube, the music still played for more than 5 minutes. That means rest services do not work

protiumx commented 4 years ago

Hi! Sorry for the long time, this is still an issue? In that is case, some questions:

winwisely99 commented 4 years ago

Same with me.

I downloaded it from the Google play store onto my nexus 5x. Stock android 7.

On starting the app it alerted me to the fact it runs a background vservice and might eat my battery.

I set the timer to 5 minutes. Started some music in Google music. Closed the app and waited.

The music never stopped .....


So I tried again but this time never closed the app.

It worked then and stopped the music.


I wonder why closing the app causes the music stop event to never fire ?

winwisely99 commented 4 years ago

I will try to work out what is going on. I wonder if it has to do with not using the Amarm manager or isolates properly.

winwisely99 commented 4 years ago

It may be that a service coded as part of a flutter app runs in the background which means it still run even if it's not the app your using . So it's not a true service like a desktop service.

If the alarm manager is used it could maybe keep wakingbit up even if the app is closed ,?

protiumx commented 4 years ago

@winwisely99 Hi, thank you for reporting that. You are right, I should add some log to know whether the service has been killed or never started. Unfortunately I don't have time to address this at the moment. If you want, you can drop a PR fixing this. When I build this, the service was working properly in my Xiaomi A1.

winwisely99 commented 4 years ago

i am not sure this architecture works in terms of being able to run a background service on mobiles when the app is closed.

The more i read about it the more i find it to not be possible.