Bartuzen / qBitController

Control qBittorrent from your Android device
GNU General Public License v3.0
494 stars 11 forks source link

Battery drainage on Android. #162

Closed TheArgentinian closed 2 weeks ago

TheArgentinian commented 3 weeks ago

Bug description

This app drained my battery overnight.

I don't want it running on the background.

Logs

No response

qBitController version

1.1.0

qBittorrent version

5.0.1

Android version

Android 6

Additional details

20241031_084532

Bartuzen commented 3 weeks ago

Have you set the notification check interval too low? Try increasing it. Or, if you don’t want it running in the background, you can disable notifications.

TheArgentinian commented 3 weeks ago

Have you set the notification check interval too low? Try increasing it. Or, if you don’t want it running in the background, you can disable notifications.

i set it to 240. I thought 0 would disable it but 1 is the minimum.

Bartuzen commented 3 weeks ago

I use WorkManager to check for notifications in the background. Although WorkManager supports periodic tasks, it enforces a minimum interval of 15 minutes. To work around this, I set up a single task with a delay after each notification check. I suspect this may be causing battery drain. Android optimizes background tasks to save battery, so even if a task is set to run every 15 minutes, it might only run daily. Since you’re using an older Android version, this optimization might not exist. I’ll test this by disabling the optimization, and if I notice excessive battery drain, I’ll switch to using a periodic task.