0

I went to check my system and found that it had stopped. Checking the logcat I found that it was closed by Android because of an excessive wake lock issue.

This is a permanently powered embedded device and I need the application to be always running and never closed by the OS.

I added the wakelock as I found that when it switched to battery power it stopped the app before the battery reached the limit of 50% that I was monitoring for.

Should I run without wakelock when on external power and only set the wakelock when the system switches to battery? I've found that it seems to keep running as long as I don't have the wakelock. The screen powers down after a few minutes but I can see that the serial communications and uploading to the server is still running and touching the LCD brings the display back on.

Is there a way around this wakelock issue or is the above the best solution?

  • Talk to whoever created this device and its Android firmware, and ask them your questions. Your device is not running standard Android, based upon your description (on normal devices, touching the LCD does not power on the display). Only the people who created your device and firmware can tell you what the rules of the game are for that device and firmware. – CommonsWare May 04 '14 at 13:25
  • Thanks. I created it from the open source that is available for the board. I was just curious if there was a way around it but looks like I may have to delve into the OS and sort this out myself, if I can. The display only does this when on DC power. On battery it powers off as per normal Android devices and you have to press the power button. I've modified the code to only apply the wakelock when on battery and testing this overnight. Thanks anyway. – Dave McLaughlin May 04 '14 at 15:02

0 Answers0