PhilippC / kp2a_accservice_autofill

Accessibility service based AutoFill plugin for Keepass2Android
GNU General Public License v3.0
155 stars 20 forks source link

Constant cpu use #17

Open gerroon opened 5 years ago

gerroon commented 5 years ago

Hi

I am using it n LineageOs 14.1 and I realized that this app was constantly using around 3-5 percent of cpu even when Keep2Android or any web thing was not open. I uninstalled it because killing it was not solving my issue either. I still would like to use it but not with this kind of cpu use.

Is it possible to lower the cpu usage?

I use OS Monitor to see running processes, avail on Fdroid.

thanks

lukefor commented 5 years ago

If you watch logcat, you can see the accessibility events it listens for are called extremely often. There's no need for it to act on them so often for the purpose of detecting username/password boxes. I hacked it to act upon events no more often than once a second, which dramatically drops the CPU usage (it doesn't even appear in my battery stats any more): https://github.com/lukefor/kp2a_accservice_autofill/commit/d2d05167e842561d69e8b7fcf6aab16919ad2c0f

(Disregard the Brave browser filtering in the above commit, but as an aside it would be nice to have an option to listen to browser accessibility events only, especially on Oreo)