Jump to content

Archived

This topic is now archived and is closed to further replies.

markj67

Kitkat Killing Activities and Services

Recommended Posts

There is a known issue with Kitkat not properly restarting services or supporting service notification when removing the service. Here are some details with links to other discussions:

http://www.androidpolice.com/2014/03/07 ... n-the-way/

These discussions center on foreground services being started sticky and the fact that the services are not being restarted and services (through BroadcastRecievers) are not being properly notified to do things like restart themselves. Workarounds proposed (inexplicably) propose using a BroadcastReceiver (broken) to restart services. None proposed seem to work.

In the case of the 1800e, the service and activity are both being stopped by Kitkat after 26 - 36 hours when a screen is connected on HDMI. When no screen is connected, they are still killed, but may run for 3-4 days before being killed.

Because (in theory), Kitkat will only stop services (including sticky foreground services like ours) when resources need to be freed up. Disabling many default apps on the 1800e dramatically improved available resources, but Kitkat still kills our service and activity after (roughly) the same amount of time.

We changed our apk to be a system/app that is persistent, this did not seem to help. Persistent services are supposed to be stopped as an absolute last resort.

We disabled debugging on our 1800e and ensured that we ran a release and signed apk, but this did not help either.

It is critical that our app run continuously for at least 24 hours (we have not, but can restart the device at 3 AM local time). We have not been stopped by Kitkat within 24 hours, but are nervous about this changing due to our limited testing (i.e. maybe we simply have not seen a 22 or 21 hour shutdown yet).

Help is appreciated for this critical issue.

Share this post


Link to post
Share on other sites

The issue was resolved as a thread leak. Our app was using an AWS lib to support upload to and download from S3 and this lib had known issues and workarounds. Applying the lib workarounds fixed our issue.

Share this post


Link to post
Share on other sites

×
×
  • Create New...