Closed drathier closed 1 year ago
I could use more information to reproduce. Could you give a ballpark for how often "every once in a while" is? Do you have the widget on your home screen? If you could figure out what triggers it, that would be a huge help.
The suspend feature was added in 2013 with commit 46cd6e1, so I doubt that has anything to do with it.
Do you mean it wasn't a problem when permissions were requested at install instead of runtime? That was done in early 2022 with commit 870b1a3 because the old way was deprecated. A whole bunch of other behind-the-scenes changes happened with that release (v1.2.0), so I'm not surprised if the regression happened somewhere in that mess.
Edit: Nevermind, I think I see what's going on. The suspended state is not stored and defaults to false (active), meaning if the background process dies for any reason, it's unsuspended when the process restarts. The trigger could be something as obvious as force stopping the app or rebooting, or as confusing as Android automatically terminating processes due to low memory. I suspect in your case, most of what you're seeing is a result of the latter. This doesn't appear to be a regression, but more likely something changed on your device to cause it to run low on memory more often.
I think I intentionally did it that way under some faulty assumptions and overlooked the memory issue. The fix would be pretty simple: storing it in preferences.
I haven't figured out when it happens yet, but voice notify definitely turns itself on by itself every once in a while. It wasn't a problem back when the permission was handled by android, which makes sense, but it has been since the "suspended" feature was added.