GrapheneOS / os-issue-tracker

Issue tracker for GrapheneOS Android Open Source Project hardening work. Standalone projects like Auditor, AttestationServer and hardened_malloc have their own dedicated trackers.
https://grapheneos.org/
351 stars 19 forks source link

Notifications not working properly for SMS #400

Closed TriggerDingus closed 3 years ago

TriggerDingus commented 3 years ago

I have the Pixel 4 on Android 11, build number RP1A.201105.002.2020.11.27.15.

I've recently found that SMS notifications aren't working unless I open the SMS app, at which time I will receive the chime for a message received minutes or hours previously. I checked to see what settings might be allowing this behavior but found nothing obvious (to me, anyway). I have the "Automatic Auto-retrieve" for MMS messages enabled. I checked Messaging permissions and no app permissions are currently denied.

Any ideas?

stevie553 commented 3 years ago

I have a Pixel 3a on Android 11, latest stable release, at the moment of writing: RP1A.201105.002.2020.11.27.15.

I can confirm this is the case for me too. I can also confirm that this is not GrapheneOS specific for a few reasons.

Prior to my current Pixel 3a. I've owned multiple Samsung phones that had LineageOS (no gaps, no play services, no microg) on them (I'll be talking about the same Samsung phone for the remainder of this report).

I've noticed this problem when I upgraded my phone from Oreo(LineageOS) to Pie(LineageOS), that's when the issue started. I thought it's just a buggy Pie release since it was a GSI. After multiple attempts of re-flashing, the issue remained the same. Even though that same phone had SMS working perfectly fine when it had both LineageOS (based on Android 7) and (based on Android 8). Starting with LineageOS (based on Android 9), the problem started. Then even after upgrading to LineageOS (based on Android 10), it remained the same.

Also, when I got my current Pixel 3a and flashed GrapheneOS, it was still on AOSP 10. And the first thing I tested and thought would be fixed was the SMS thing, it was still buggy even though it's a completely new phone and OS. I still had hopes that after GrapheneOS moves to AOSP 11, the problem would be fixed but it's not.

So I'm certain that this is not GrapheneOS specific. I've tried everything @TriggerDingus have tried and trying to disable battery optimization(OS didn't even allow me to) and all that stuff but still same result.

I still have my old Samsung phone with and old sim running LineageOS 17.1 (Android 10), specifically latest build of this https://github.com/eremitein/treble-patches/wiki/LOSQ-Project which still suffers from the same problem, even though the phone is just laying around and not being used anyway.

Also, in my case, I don't receive or send MMS at all, it's all SMS.

thestinger commented 3 years ago

This sounds like a carrier-specific issue since it's not happening for most people. Perhaps you're getting a modern more implementation of traditional texts that's based on data and requires a service to have a battery optimization exception (to connect to the network in the background) that does not currently have one.

stevie553 commented 3 years ago

Perhaps you're getting a modern more implementation of traditional texts that's based on data

I tested on a "dumb" phone that only has 2G without installing the carrier internet settings. SMS worked fine.

Is there any way I can get some logs so we can know more about this issue? I know it's not possible with a GrapheneOS release build but I have the old Samsung with TWRP so I can pretty much get any file on the system.

thestinger commented 3 years ago

Is there any way I can get some logs so we can know more about this issue? I know it's not possible with a GrapheneOS release build

You can enable ADB and use adb logcat and other debugging utilities in adb shell in a release build. You don't have much access but you can certainly get nearly all the logs.

ayo-x commented 3 years ago

Pixel 3a RP1A.201105.002.2020.11.27. Kind of similar issue as OP. Sometimes SMS notifications don't work if the screen is off. They pop only when I unlock the phone (turn the screen on).

stevie553 commented 3 years ago

You can enable ADB and use adb logcat and other debugging utilities in adb shell in a release build. You don't have much access but you can certainly get nearly all the logs.

I'm away from home and only have access to my work laptop for the time being and I don't feel safe doing that on it. So, it'll be a while before I'm able to provide logs.

thestinger commented 3 years ago

Please test on the 2020.12.08.08 release.

pocahontasholocaust commented 3 years ago

Pixel 3a RP1A.201105.002.2020.11.27. Kind of similar issue as OP. Sometimes SMS notifications don't work if the screen is off. They pop only when I unlock the phone (turn the screen on).

yep, I get the same problem. For me, it's Signal messages as well as the clock - Alarms and timers. Exactly as you say, the notifications only appear when the screen turns on, without unlocking. At first I assumed it was a problem with Do not Disturb, though the apps that I want notifications for are all allowed to interrupt. I just updated recently, so I will likely post again if the problem persists. (Pixel 4a RQ1A.201205.008.2020.12.08.08)

stevie553 commented 3 years ago

Please test on the 2020.12.08.08 release.

Updated and did a hard reboot just in case (turn phone off, wait a little bit, turn it back on). Issue still remains.

Also, I'm still away for work so I couldn't grab you the logs, sorry.

thestinger commented 3 years ago

This sounds like either a misunderstanding of how things work or a configuration issue.

You can't expect to get notifications after rebooting the device until you've logged into the owner profile.

stevie553 commented 3 years ago

This sounds like either a misunderstanding of how things work or a configuration issue.

You can't expect to get notifications after rebooting the device until you've logged into the owner profile.

I should've been more explicit, sorry.

Here's the full procedure of what I do after my phone notifies me that it finished installing an update for GrapheneOS:

1- Click the reboot button in the notification for the updater.

2- Once the phone finish rebooting, unlock it, wait for the finishing update notification, then wait around 15 minutes or so.

3- Turn off the phone and wait for about 15 more minutes then turn it back on.

4- Unlock the phone.

5- Pay a visit to the messaging app (I use the default one that comes with GrapheneOS) and a visit to Signal.

I understand that if I don't unlock my phone after I turn it on, some things will not function due to some things related to encryption (I hope I am being correct).

thestinger commented 3 years ago

Please confirm that you don't have battery saver enabled. Not getting a response from the person who originally opened this issue and I think it is going to need to be split. Different issues are being reported here.

thestinger commented 3 years ago

Please make sure neither DnD or battery saver are enabled and that you have not messed with notification settings. I recommend a factory reset if you still can't resolve it. It's likely a configuration issue. Issues like this are only happening for a couple people which strongly indicates it is a configuration issue since we know the OS install is identical.

If you have an issue with SMS notifications, please open your own issue providing the appropriate details. The original issue filed here is assumed to be resolved. The other things being reported each sound like different problems.

TriggerDingus commented 3 years ago

OP, here. Since I posted this, I've applied the update and turned off battery saver. Turning off battery saver seems to have been the culprit though I need to let it ride for a few days to see for sure. I have a Pixel 4 and battery life is anemic in the best of circumstances, so I'll prolly need to turn battery saver back on and suffer the consequences of missed SMS messages.

thestinger commented 3 years ago

Battery saver disables receiving notifications promptly.

thestinger commented 3 years ago

If you're getting bad battery life, it sounds like you have applications wasting substantial power. I'd look into that. Look through apps where you've disabled battery optimizations and revert that. Considering using the toggle to further restrict background activity in the Settings Apps & notifications menu for apps that are wasting power. Using battery saver is a much more extreme approach applying blanket restrictions. You should use more specific ones on the apps that are actually the problem. Definitely an issue with your installed apps and configuration.

beerisgood commented 3 years ago

I never use battery saver nor DnD on my Pixel 3a and i can confirm that SMS are mostly delayed to 15 minutes or more if phone isn't used in this time (also screen off). The "received at time" info confirm the missing notification.

But if phone is in usage, no delay exist.

thestinger commented 3 years ago

That's a different issue than what @TriggerDingus reported though, and their issue is battery saver. Need to have separate issues filed for different problems. This one is going to remain closed.

TriggerDingus commented 3 years ago

If you're getting bad battery life, it sounds like you have applications wasting substantial power. I'd look into that. Look through apps where you've disabled battery optimizations and revert that. Considering using the toggle to further restrict background activity in the Settings Apps & notifications menu for apps that are wasting power. Using battery saver is a much more extreme approach applying blanket restrictions. You should use more specific ones on the apps that are actually the problem. Definitely an issue with your installed apps and configuration.

Agreed. I've combed all apps already. I keep GPS off entirely unless navigating, same with Bluetooth. I run the display at a lower power. I have very few apps on my phone, none of which consume background cycles. I've done further research and eventually found the Pixel 4 has a reputation for short battery life...or perhaps a smaller battery capacity.