Domi04151309 / BatteryTool

Battery Tool helps you save battery by stopping apps that are running in the background.
https://f-droid.org/packages/io.github.domi04151309.batterytool
GNU General Public License v3.0
111 stars 12 forks source link

[Bug Report] Auto stop not working #19

Closed k2helix closed 10 months ago

k2helix commented 2 years ago

Description Hello, I've been using this app for months and it has always worked fine. However, I noticed some time ago that it was not auto stopping in background. I don't know what could've caused it.

I've tried with every version in F-droid, but none worked. Stopping manually in the app does work.

Steps I did:

  1. Install the app
  2. Grant root permissions
  3. Disabled the notification from Android settings
  4. Set Auto stop timeout to 15 seconds
  5. Selected apps
  6. The app confirms that some apps will get stopped soon.
  7. Turn off screen for +20 seconds
  8. Turn on screen. The app still says they will get stopped soon

Additional information

When the app was working I would usually get a toast from Magisk saying the app was granted superuser rights when it killed any app in the background. I don't seem to receive these now.

Domi04151309 commented 2 years ago

This seems weird. Which phone do you use? It could be an issue with the foreground service. In this case, there is not a lot that I can change. It might also be Magisk, as you said. However, I can't find any changes that would cause this in the changelog. Do you see the notification for the service (in case you haven't turned it off)? If not, try restarting your device.

k2helix commented 2 years ago

Hello.

My device is a Sony Xperia XA2, and it seems that (ironically) disabling the battery restriction to Battery Tool made it work again.

I have not tested whether it works sometimes or always, I'll let you know.

And yes, I see the notification if I turn it on. In fact I could see it even with the battery optimisation set

k2helix commented 2 years ago

Well, after using it a bit I can say it definitely does not work as intended, it sometimes works and sometimes doesn't. I don't know what could be causing it. According to Running services from developer options Battery Tool is running

Domi04151309 commented 2 years ago

Because of the inconsistencies, I think that this is rather an OS level issue. You can try if this guide helps you out https://dontkillmyapp.com/sony .

k2helix commented 2 years ago

Hmmmm, that's weird, I remember the app working fine on the same setup months ago. I'm not on Stock else, but LOS. I guess I'll continue using the app and just stop manually sometimes

StoyanDimitrov commented 10 months ago

Lineage OS currently does not (officially) support Magisk (or any root). So from time to time my device loses root access too. It's not a problem with the application but the OS.

Edit: Upon opening the BatteryTool app you may observe the Magisks Superuser Notification. If there's none then no access to root acquired.