abertschi / sailfish-wlan-keyboard

Use your computer keyboard as input device on SailfishOS
http://wlankeyboard.abertschi.ch
GNU General Public License v3.0
21 stars 7 forks source link

Improve resource management of app that remains running in background even if not active #15

Closed abertschi closed 8 years ago

abertschi commented 9 years ago

The last harbour store app submission pointed out higher resource consumption of the app.

The app remains running in the background even if the server is not running. It is important for apps to go to idle state (i.e. do not cause power consumption) within 1-2min. But it also depends on what the application is doing while it is idle. Since the app seems it is not doing any thing while the server is not running, so we expect it to go to idle state. Pleas invedtigate this and try to fix it. Here are the steps I used to check whether the app goes to idle state or not. 1) Install the application (preferably on a clean/flashed device with the latest update), but don't run it 2) In terminal, become root using 'devel-su', and run: 3) ssu ar mer-tools 4) pkcon refresh 5) pkcon install powertop 6) Lock the device/Wait until it goes to idle state(the screen turns off) 7) In terminal again: 8) powertop 9) Wait for about 1 minute, and check the number of wakeups shown in summary (On a clean device with no application running, it should be around 20) 10) Unlock the device and run the application, check that the number of wakeups has changed to something around 200 or more, and also that your app is shown on the list like this: /usr/bin/harbour-wlan-keyboard. 11)Then lock the device and check the output again after ~1min; this time the app should go to idle state and disappear from the list after ~1minute (or a bit longer) and wakeups are under 60.

Hop you will find the above information useful and if you have any questions please don't hesitate to contact us at developer-care@jolla.com.

That seems reasonable because of this piece of code which keeps running even though the app may not be active anymore.

abertschi commented 8 years ago

Pause all connectivity checks if app is not running in foreground 9c4111da8551db0e983ee99a06b589938e289d04