ST and Galaxy S6 Aggressive Task Killer

In the dev call last night, I once again brought up the fact that my wife’s S6 Edge continues to lose presence. I remove and re-add the device in ST, and it works again, for a time.

Then @pstuart mentioned that the S6 (and other newer Sammy phones) kill tasks rather aggressively. This is the best possible explanation yet as to what could be causing this issue (ST Support is just going around in circles with possible explanations, with no concrete answers).

The questions for the devs (@Tyler, @slagle, @jody.albritton, et al): Is the app being affected by this? Is there a way for someone in the office to dogfood a S6 Edge in an attempt to replicate the problem? If the app is indeed affected, is there a line of code that can be added that will exclude the app from being included in this very pointless task killing nonsense?

Any insight on this?

2 Likes

I can fix this problem myself by rooting her phone and either editing build.prop or removing the task killer manually - not only should I not have to do that, but my wife won’t want her phone rooted. I also shouldn’t need to install Tasker to work around this.

Here’s a good video explaining what I’m talking about: https://youtu.be/DDWX6qJjY-0

1 Like

Not just st app. Anything running in background.

Looks like Samsung isn’t going to fix it.

Options, root and disable it or extend the number of hidden apps to 25 in build.prop or install alternative ROM.

Lastly, remove Facebook app and Facebook messenger. Use mobile site. That will free up 500+ mb or ram and delay the app killing.

2 Likes

Correct. I’m not expecting Samsung to ‘fix their phones,’ but I would be very interested to find out if the app can be updated to exclude itself from this. Samsung should know better than to use a task killer on a system optimized to do just that, and do it correctly.

Doubt ST can do anything to fix it, besides moving the presence background service to a foreground service, which would drain the battery even longer.

However, I am working on a standalone pressence app (foreground app) that will use only connecting to a specific WiFi AP to mark you as home. Then it will only check gps when WiFi is dropped after X minutes to determine if you are outside an area to mark you as away.

In Proof of Concept stage right now, hopefully will have enough time to get it to beta in the next few weeks.

3 Likes

Does the S6 have the standard choices in “Developer options”? If so, try setting Background process limit to a higher value. Root not required.

1 Like

I’ll bring it up to the Android devs. I ran an S6 for about 3 months and a Note 5 for another 3 months. I didn’t personally have this issue, but I’ve definitely heard about the task management issues on the latest generation of Samsung phones (and the Note 4).[quote=“pstuart, post:4, topic:35786”]
Lastly, remove Facebook app and Facebook messenger. Use mobile site. That will free up 500+ mb or ram and delay the app killing.
[/quote]

This is the first thing I do on a Samsung phone. Here’s a guide. Tinfoil for Facebook is a good alternative as it just loads the web site in a nice app.

1 Like

Thanks for that, @Tyler. Another good article I found is this: http://zapek.com/blog/how-to-make-your-galaxy-note-4-fast-again/

Again, I don’t feel like I should have to root a phone to correct an issue (if this actually is the cause) which is fully internal to Samsung (Samsung phone, Samsung ST). I mean, if I must, I will - but Samsung should be baking this kind of support into their firmware if it can’t be done on the ST app side. There’s no reason two devices built and managed by the same company (albeit through acquisition) should have compatibility issues, especially if one relies on the other to work as intended.

My wife uses her phone to run her business - if I had the ability to dogfood it myself, I totally would. Heck, if someone from ST wants to send me a S6 Edge for a couple weeks, I’d be in Logcat heaven and would properly break the s**t out of ST to correct the problem. :smile:

1 Like

Yeah I have a straight S6 and I don’t have any more or less presence issues than my old Nexus 4 as far as I can tell.

1 Like

I’ve got an S5 and it also loses presence about 2 times a week, which is highly annoying. Support said they knew about this issue, and to delete my phone from ST then re-add, which works, but first I have to delete the apps it’s associated with each time, like "Goodbye! " and “I’m Back!”, then add them again, it’s quite a chore, something I shouldn’t have to do.
Leaving home is no longer a relaxed experience, I have to check my phone to see if it’s triggered “I’m Away” each time to make sure my security cameras are armed. And this is 2016!

Wait, they did?? I was told something different.

@Tyler: any word from the devs?

They did, I had a “Live chat” with them for half an hour, they said it was a known issue and they are working to resolve it, they checked my logs from their end, and told me about this work around of deleting and re-adding to get the geo fencing to work again, which still happens on a regular basis.

1 Like

There’s more than one thing going on here. One is that the latest generation of Samsung phones is very aggressive with task killing. That’s an issue that is widely publicized.

On top of that, there are improvements that we’re making to our app to be more memory efficient. That’s likely what Support mentioned our developers are aware of and working on.

1 Like

Thanks for that. In the meantime, how do I get this Samsung phone to work correctly with ST?

Specifically with Mobile Presence?

My recommendation would be the same as this article:

Specifically expanding the size of your geofence.

Yeah, I’ve been through all of that. The problem is that the S6 Edge just straight up stops reporting. Geofence was expanded, but is (was) working correctly (my Nexus 5X registers flawlessly).

I think I’ve found the issue:

Samsung Smart Manager and App Optimization

I found that my wife’s S6 Edge had SmartThings automatically optimizing every 3 days, which means that if she doesn’t open the app for 3 days, (if my theory is correct) Smart Manager removes the task from memory, effectively killing off the link between location and ST.

What’s concerning about this is that ST is now a Samsung product, and Samsung is now a ST product. As such, the app developer (ST) should be excluding the ST app from being affected by this at the code level. Why is this not the case? ST knows what needs to happen in the background in order for the app to function properly, yet we have an OS (Android) that is built on a platform that is already optimizing memory use, then Samsung puts more crap on top of it (Smart Manager), which only confuses the rest of the ecosystem.

Can we please have the devs look at this? I can’t believe it’s taken me this long to figure it out; I still don’t know if this is the issue, but I have to believe it is. I had her turn off app optimization completely (thank GOD that’s an option).

@Tyler @pstuart @Ben @slagle @tgauchat @liztupper @Jim @jody.albritton

1 Like

Hey Mike,

Thanks for the follow-up. Please try and avoid at-mentioning like that in the future :). It’s spammy.

We certainly have contacts at Samsung Mobile, but it’s very unlikely that you’ll see the SmartThings Mobile app be whitelisted in such a way that causes it to work around the memory/task management in TouchWiz. That’s not good practice in my opinion, even if it causes the mobile presence experience to be more reliable specifically on the S6.

I was having this problem with both mine and my wifes S6’s. Since stopping app optimiseation, both phones report as being away as soon as they leave the geofence.
Has worked perfectly now for the past few days. Also I have not seen any noticable affect on battery life. Happy days :slight_smile: .
Well for now anyway :wink:

1 Like