• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

WhatsApp MessageService is always killed shortly after exiting the app

vace117

Lurker
A couple of days ago I noticed that I no longer receive WhatsApp messages until I manually start the app, which is when the pending messages get delivered all at once.

I started my investigation by monitoring the com.whatsapp.messaging.MessageService in the Application Manager.

Here's what it looks like at first, after I exit WhatsApp:
SymrF.png


And here's what it looks like a few minutes later:
naEvx.png


It looks like the MessageService either quit, or it was terminated. To verify this, I checked with adb. I can see the service at first:
Code:
$ adb shell dumpsys activity services | grep wh
  * ServiceRecord{43deec28 u0 com.whatsapp/.messaging.MessageService}
    intent={act=com.whatsapp.messaging.MessageService.START cmp=com.whatsapp/.messaging.MessageService}
    packageName=com.whatsapp
    processName=com.whatsapp
    baseDir=/data/app/com.whatsapp-1.apk
    dataDir=/data/data/com.whatsapp
    app=ProcessRecord{42d19f90 10037:com.whatsapp/u0a10187}

But then this service disappears, even though the main process is still running:
Code:
$ adb shell ps | grep wh
u0_a187   10037 215   988084 78996 ffffffff 00000000 S com.whatsapp

The service does not get terminated at the same time. I have seen it killed as early as 6 minutes after exiting WhatsApp, and as late at 11 minutes. But in the vast majority of cases, it is terminated some time on the 8th minute.

I have carefully examined the logcat during the moment of service termination with the following logcat query, which I believe silences only the stuff I don't care about:
Code:
adb logcat -v time LightSensor:s LightsService:s  SensorService:s SensorManager:s STATUSBAR-BatteryController:s BatteryService:s HeadsetStateMachine:s android.widget.GridLayout:s MP-Decision:s SignalStrength:s McClient:s McDaemon:s QcrilMsgTunnelSocket:s | grep -v ss_tz_mobicore | grep -v ss_daemon

I was not able to see anything in the logs that would hint at what happened to the service. Did it quit? Did something kill it? How can I find out?

I thought that maybe the service was terminated b/c the OS was low on RAM, but this does not appear to be so. Here's the RAM at the moment of termination:
Code:
$ adb shell free -m
             total         used         free       shared      buffers
Mem:          1821         1587          234            0           75
-/+ buffers:               1511          310
Swap:          399          134          265

While working on this issue, I have used Titanium Backup to freeze all apps that might interfere with normal operation of WhatsApp, so these are the apps I froze:
  • Greenify
  • Amplify
  • XPrivacy
I also turned off "Per App Hacking", which is an Xposed Module.

Any ideas on how I can learn more about why MessageService is being terminated?
 
Back
Top Bottom