skipTrackLongPressVolume icon indicating copy to clipboard operation
skipTrackLongPressVolume copied to clipboard

Idea: disable battery optimization to run without a foreground service

Open grishka opened this issue 5 years ago • 5 comments

There is a documented way to bypass "battery optimization" as they call it by asking the user to whitelist the app. Supposedly, this allows apps to run regular, non-foreground services indefinitely. I haven't tested this myself, but Google's own Android Wear app uses this to run the service that communicates with the watch.

grishka avatar Apr 11 '19 22:04 grishka

Thank you for that idea. I'm working on it

Supposedly, this allows apps to run regular, non-foreground services indefinitely.

Do you have any more information about that? The linked documentation only points out WakeLocks... Anybody ones to work on this please see the background_optimization branch.

Cilenco avatar Apr 14 '19 21:04 Cilenco

This may be helpful? https://github.com/alexstyl/Memento-Calendar/issues/151#issuecomment-326736192

Otherwise you can check on the dev branch where I have put a power exclude setting(However it's kotlin)

indianpoptart avatar Apr 15 '19 15:04 indianpoptart

Thank you @indianpoptart. I will have a look on that!

Yeah I saw your code. Actually I edited that in the background_optimization branch by removing the NotificationListenerService but since then the execution in the background does not work any longer.

If you wanna test it yourself make sure the Activity is removed from the recent apps.

Cilenco avatar Apr 15 '19 15:04 Cilenco

I'll definitely test the background branch and see if it changes anything, or if I can find a solution.

Cheers!

indianpoptart avatar Apr 15 '19 15:04 indianpoptart

Maybe the DeviceAdminService is a better alternative but I'm not 100% sure about that...

Cilenco avatar Apr 23 '19 07:04 Cilenco