forrestguice / SuntimesWidget

Android app (and widget collection) that displays sunlight and moonlight times.
GNU General Public License v3.0
341 stars 61 forks source link

High battery usage in background #575

Closed Git-Forked closed 2 years ago

Git-Forked commented 2 years ago

High battery usage in background reported by device, suggests to sleep the app. Please fix. An app with battery drain is not good.

forrestguice commented 2 years ago

I don't experience this issue, but I will make an effort to reproduce it. You can help by providing necessary details.. Please provide app version, Android version, a screenshot of battery use, and a description of your use case.

There shouldn't be any background activity (outside of rescheduling alarms on reboot). In the past there was a bug that caused the notification service to continue idling though, so that is where I'll look first..

forrestguice commented 2 years ago

I've found what is likely the cause. Is your primary use the alarms feature?

a bug that caused the notification service to continue idling

It seems its the same sort of thing. After scheduling an alarm (upon showing the 'upcoming' notification) the service fails to stop itself. It runs (doing nothing) until the alarm is eventually triggered or dismissed.

forrestguice commented 2 years ago

hrm, I'm not sure the bug in the notification service is enough to trigger a battery warning - there are typically a lot of services in the background doing nothing, one more shouldn't really matter.

and a description of your use case.

What I mean by this is, how are you using the app? Do you have a screen full of widgets? If so which ones? Do you use alarms and notifications? one alarm? many alarms? How about the world map dialog?

I'm guessing here.. Having more information would really help narrow down the problem. I've assumed its alarm related, because that's where I expected to find (limited) background activity, but I still haven't been able to reproduce it. That is frustrating.. especially when I've been told to "please fix" (in my opinion this is kind of rude).

So I don't know if its actually fixed or not. Hopefully it was just the device detecting an idle service (now fixed). If anyone else sees a battery warning, please comment with some details.

Git-Forked commented 2 years ago

What I mean by this is, how are you using the app? Do you have a screen full of widgets? If so which ones? Do you use alarms and notifications? one alarm? many alarms? How about the world map dialog?

I only have 1 widget, weather. I have no alarms set. I do not use world map.

That is frustrating.. especially when I've been told to "please fix" (in my opinion this is kind of rude).

It was not rude. It prompted you to find a bug and fix it, improving your code. That seems worthwhile to me.

So I don't know if its actually fixed or not. Hopefully it was just the device detecting an idle service (now fixed). If anyone else sees a battery warning, please comment with some details.

Thank you for fixing the idle service.