Notifications stop when connected to WiFi 10 minutes after screen is turned off

Search This thread

zurjskj

Member
May 31, 2018
25
13
While I saw this problem on several other devices (this thread, for example), I haven't seen a post about this problem on this device on XDA, hence starting a new thread. My problem is that I stop receiving notifications from apps that rely on Internet connection. Below are the details:

After 10 minutes of turning off the the phone screen (my device is set to immediately lock after screen turning off), I stop receiving notifications from Messenger, WhatsApp, Gmail and so on. This happens only when the phone is connected to WiFi and NOT charging. On cellular data, notifications arrive timely, as is the case with WiFi when the phone is charging. I discovered this "solution" after months of missing important calls and messages.

The phone came with Android 4.4 Sense, which I didn't use for more than a few days, hence can't really confirm if the problem was present there (it most likely wasn't; those few days I did get timely notifications, as far as I remember). I switched to LineageOS 14.1, Android 7.1.2, and noticed this problem for the first time. After quite some time of thinking it's a bug in LineageOS, I converted the device to GPE, installed stock Android 6.0 (the last version of Android shipped by Google for this device), only to see the problem was worse there. At least in LineageOS 14.1 notifications would stop after 10 minutes. In GPE Marshmallow, it would stop after 2-4 minutes, and the problem persisted even while charging. Now I'm using LineageOS 15.1 from this thread. Notifications STILL stop arriving timely when not charging and connected to WiFi.

To make it clear, I tried pretty much everything suggested by people for similar problems in other devices. I have battery optimization turned off for EVERY app on the list (this DOES seem to be a power management issue, since while charging, notifications work fine). WiFi was set to be active "Always" in Android 6.0 and 7.1.2 (didn't find that option on LineageOS 15.1/Android 8.1). Made unrestricted data access available for all apps. Battery is set to "Performance". All apps allowed to notify. Installed "WiFi Keep Alive" kind of apps. No use!

Yes, every ROM installation was "clean". Yes, the device firmware is the latest one shipped by Google (from here). The device is S-OFF. I only have Google Apps installed, never rooted it. This making me go nuts. If anyone can provide me with a solution, I'll be grateful beyond words.
 

redpoint73

Inactive Recognized Contributor
Oct 24, 2007
15,251
6,964
Please do fastboot getvar all, and post the results (delete IMEI and serial number before posting).

You sure youconverted to GPE using the RUU, and not just flashing the ROM in TWRP?
 

zurjskj

Member
May 31, 2018
25
13
Please do fastboot getvar all, and post the results (delete IMEI and serial number before posting).

You sure youconverted to GPE using the RUU, and not just flashing the ROM in TWRP?

Thank you for your reply. Here's the output of fastboot getvar all:
Code:
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: 1.23.213311491.A13G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main: 5.07.1700.15
(bootloader) version-misc: PVT SHIP S-OFF
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B11000
(bootloader) cidnum: 11111111
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: off
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: 11459804
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0
all: Done!
finished. total time: 0.017s

And yes, I am sure. First I flashed the firmware, then the RUU. It wiped everything on my phone, and the date on the bootloader changed to Jul 20 2016.
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
i have exactly the same problem but its only with 7.x.x ROMs, in 6 it works fine, i test using WhatsApp web and as soon as the screen goes off it will work for a minute or 2 then say phone not connected, its like it kills all data connection once the screen goes off, i will add it ONLY does it when on wifi and not charging if i turn wifi off it works fine with screen off, i think i did cure it for a while by messing with the WCNSS_qcom_cfg.ini file in the data folder but it caused a huge battery drain.
 
  • Like
Reactions: zurjskj

zurjskj

Member
May 31, 2018
25
13
i have exactly the same problem but its only with 7.x.x ROMs, in 6 it works fine, i test using WhatsApp web and as soon as the screen goes off it will work for a minute or 2 then say phone not connected, its like it kills all data connection once the screen goes off, i will add it ONLY does it when on wifi and not charging if i turn wifi off it works fine with screen off, i think i did cure it for a while by messing with the WCNSS_qcom_cfg.ini file in the data folder but it caused a huge battery drain.

That's exactly the kind of thing I was looking for--if the settings can be applied in a config file to keep the WiFi always active. Can you please tell me which options need to be tweaked to achieve this?
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
That's exactly the kind of thing I was looking for--if the settings can be applied in a config file to keep the WiFi always active. Can you please tell me which options need to be tweaked to achieve this?

Im not sure if it did cure it 100% but this was what i did:

1. Open the file WCNSS_qcom_cfg.ini in text editor.
2. Change the line gEnableBmps = 1 to gEnableBmps = 0
3. Save and reboot

dont know what this setting does but i found it on another forum that fixed it on a different phone.

Edit: also found this which may also work, i would try this if the top one doesnt, then try both together if neither work alone

Make sure your phone is rooted
Remount /system as RW
Make a backup of file /system/etc/wifi/WCNSS_qcom_cfg.ini
Edit the file /system/etc/wifi/WCNSS_qcom_cfg.ini
Change the line "McastBcastFilter=3" to "McastBcastFilter=0"
Save the file and double check file permissions (-rw-r--r-- root root)
Reboot the phone


your config file might be in a different location, i'm on Oreo and mine was in /data/misc/wifi
 
Last edited:
  • Like
Reactions: zurjskj

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
"McastBcastFilter=0" setting seems to have worked for me, i havent messed with the "gEnableBmps=" setting this time as last time it drained my battery, only a day or so with this new setting changed will tell if this is the same or not, but whatsapp web still connected after 30~ mins
 
  • Like
Reactions: zurjskj

zurjskj

Member
May 31, 2018
25
13
Im not sure if it did cure it 100% but this was what i did:

1. Open the file WCNSS_qcom_cfg.ini in text editor.
2. Change the line gEnableBmps = 1 to gEnableBmps = 0
3. Save and reboot

dont know what this setting does but i found it on another forum that fixed it on a different phone.

Edit: also found this which may also work, i would try this if the top one doesnt, then try both together if neither work alone

Make sure your phone is rooted
Remount /system as RW
Make a backup of file /system/etc/wifi/WCNSS_qcom_cfg.ini
Edit the file /system/etc/wifi/WCNSS_qcom_cfg.ini
Change the line "McastBcastFilter=3" to "McastBcastFilter=0"
Save the file and double check file permissions (-rw-r--r-- root root)
Reboot the phone


your config file might be in a different location, i'm on Oreo and mine was in /data/misc/wifi

"McastBcastFilter=0" setting seems to have worked for me, i havent messed with the "gEnableBmps=" setting this time as last time it drained my battery, only a day or so with this new setting changed will tell if this is the same or not, but whatsapp web still connected after 30~ mins

That, sir, is pure gold. Also, I couldn't have done it without your elaborate instructions. This problem has bugged me SO much that I couldn't at first believe it was working. But tested with WhatsApp Web for about 40 minutes. It was connected! I changed McastBcastFilter value to 0, and didn't touch gEnableBmps, like you suggested. However, I did make one additional change. I saw here that the option "isAndroidPsEn" is set to 0, i.e. it was disabled. It was said when this option is disabled, the driver controls power saving mechanism on its own, separate from Android's power saving. This, however, was set to 1 (enabled) on my file. It seemed reasonable to change it. I know, like you said, it takes a day or two to realise if the solution really worked, but I am going to mark this post solved nonetheless.

Thank you SO much!
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
Glad I could help, it too has bugged me ever since ive used a 7.x.x ROM, I had given up trying to fix it but your post gave me renewed spirit to try and fix it, also the second option you mentioned was also enabled on mine but I left it as it and battery usage seems normal up to now.
 

zurjskj

Member
May 31, 2018
25
13
Glad I could help, it too has bugged me ever since ive used a 7.x.x ROM, I had given up trying to fix it but your post gave me renewed spirit to try and fix it, also the second option you mentioned was also enabled on mine but I left it as it and battery usage seems normal up to now.

So far, battery usage is quite normal on my end. By the way, I really feel these things should be better documented by AOSP/Google. Quite a lot of people seem to suffer from this issue. People blame battery optimization, bugs in push notification... whatnot.
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
Same here too, it looks like we have finally cured it :) I know what you mean about it affecting loads of other I tried all sorts to cure it but to no avail.
 

zurjskj

Member
May 31, 2018
25
13
Same here too, it looks like we have finally cured it :) I know what you mean about it affecting loads of other I tried all sorts to cure it but to no avail.

Yes! :D Again, thank you! By the way, I have one question. Will the WCNSS_qcom_cfg.ini file be overwritten with LineageOS OTA upgrades? I'm currently using the official 14.1 branch.
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
Unsure but i wouldnt think so as i doubt that would have to be updated? if it does you can always change back the options :) (or make the file read only but i dont know if that would mess anything up?)
 

zurjskj

Member
May 31, 2018
25
13
Unsure but i wouldnt think so as i doubt that would have to be updated? if it does you can always change back the options :) (or make the file read only but i dont know if that would mess anything up?)

Yeah, I thought updates shouldn't affect it, but just wanted to be sure. I'll check after next week's update and post here. Also, I submitted a bug report on LineageOS, now only hoping they'd permanently fix it. After Google stopped supporting this device, LineageOS is the only thing that I can rely on for updates. Besides, this OS runs just too smooth.
 

JaffaTB

Senior Member
Oct 22, 2010
163
24
Sheffield
well i ended up flashing a different ROM last night as i always get bored and like a change and the first thing i did was change the "McastBcastFilter=0" and nothing else, it 100% fixes it :)
 

zurjskj

Member
May 31, 2018
25
13
well i ended up flashing a different ROM last night as i always get bored and like a change and the first thing i did was change the "McastBcastFilter=0" and nothing else, it 100% fixes it :)

Hope you're enjoying your new ROM! I myself will shift to Android 8.1. And that McastBcastFilter really is the trick :D By the way, OTA updates DO overwrite the file. Also, my bug report in LineageOS has been rejected, on the basis of not being able to be reproduced. The developer also said that they won't disable multicast and broadcast filtering. This is overall a VERY strange issue. I don't think a lot of people with HTC One M8 other than you and I suffer from this problem. Also, at my home other devices work just fine without disabling this option, so it's not a router issue, either. I did some more digging and saw that mcast and bcast filtering CAN cause WiFi to drop. It just doesn't happen all the time. It's all very strange, really... Anyway, as long we keep using this device, we just have to keep setting "McastBcastFilter=0". Again, really thank you for your help.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    i have exactly the same problem but its only with 7.x.x ROMs, in 6 it works fine, i test using WhatsApp web and as soon as the screen goes off it will work for a minute or 2 then say phone not connected, its like it kills all data connection once the screen goes off, i will add it ONLY does it when on wifi and not charging if i turn wifi off it works fine with screen off, i think i did cure it for a while by messing with the WCNSS_qcom_cfg.ini file in the data folder but it caused a huge battery drain.
    1
    That's exactly the kind of thing I was looking for--if the settings can be applied in a config file to keep the WiFi always active. Can you please tell me which options need to be tweaked to achieve this?

    Im not sure if it did cure it 100% but this was what i did:

    1. Open the file WCNSS_qcom_cfg.ini in text editor.
    2. Change the line gEnableBmps = 1 to gEnableBmps = 0
    3. Save and reboot

    dont know what this setting does but i found it on another forum that fixed it on a different phone.

    Edit: also found this which may also work, i would try this if the top one doesnt, then try both together if neither work alone

    Make sure your phone is rooted
    Remount /system as RW
    Make a backup of file /system/etc/wifi/WCNSS_qcom_cfg.ini
    Edit the file /system/etc/wifi/WCNSS_qcom_cfg.ini
    Change the line "McastBcastFilter=3" to "McastBcastFilter=0"
    Save the file and double check file permissions (-rw-r--r-- root root)
    Reboot the phone


    your config file might be in a different location, i'm on Oreo and mine was in /data/misc/wifi
    1
    "McastBcastFilter=0" setting seems to have worked for me, i havent messed with the "gEnableBmps=" setting this time as last time it drained my battery, only a day or so with this new setting changed will tell if this is the same or not, but whatsapp web still connected after 30~ mins