I've recently started using GrapheneOS on a new Pixel 7a and since then had the problem that occasionally calendar reminders (I estimate less than 20%) are very late (on the scale of hours) or do not fire at all.

I'm using multiple calendars synced via DAVx5 and I have tried several calendar apps. I had Etar and aCalendar+ installed at the same time to check whether it is a bug in the app, but reminders always either fire for both apps at the same time or don't show up at all. I also tried the Fossify Calendar, which seems to use a different mechanism to display reminders. It works less accurately timing wise but seems to be 100% reliable. This app unfortunately does not have enough features to be usable for me on a daily basis.

When I remove a calendar in DAVx5 and re-sync, the missing reminders fire instantly, but this is not a solution. It does not improve the situation for future reminders. My calendars have multiple reminders per day.

My current workaround is to keep Fossify Calendar installed only to show reminders I may otherwise miss.

Has anyone seen something similar? Does anyone have any suggestions on how to debug this further?

    birefringence Do the apps that you're talking about have the alarms and reminders permission?

    Settings > Apps > Special app access > Alarms & reminders

    No, they don't seem to be requesting that permission, so I cannot grant it to them.

    I have turned off battery optimization for all involved apps.

    Also, I can't really see a difference related to whether the device is locked or the app is active. The reminders sometimes do not even appear if I have the app open and the screen on at the specified time.

    If found this issue for Etar, which has comments similar to what I see: https://github.com/Etar-Group/Etar-Calendar/issues/1456
    I've also opened a support ticket with the aCalendar+ vendor.
    I find it peculiar that both apps show exactly the same behavior.
    I have installed one more Calendar app and will observe what this is doing.

    6 days later

    Now, I have three apps that show exactly the same problem. All them work very reliably on my old LineageOS phone. The leads me to believe it is most likely an OS-level problem. Still looking for some clues on how to best drill down on this further.

    • de0u replied to this.
      • Edited

      birefringence If three apps have this problem on GrapheneOS, and if at least one of those apps has the issue on a different AOSP variant (based on the issue you cited), and if a fourth app does not have this problem on GrapheneOS, then my random suspicion is that something changed in AOSP which has upset those three apps. If your "old LineageOS phone" is not running Android 14, that would lend support to my wild suspicion.

      I have a faint sense that Google has a history of making it harder for apps to wake up exactly when they want to, in the name of improving battery life, and thus old timing APIs keep "working" (in the sense of not rejecting app requests) but become less accurate.

      Overall, if all of the apps are happy on multiple A12 or A13 variants, but glitchy on multiple A14 variants, the app authors might need to re-work the apps. Or maybe something else entirely is going wrong -- hard to say.

      Indeed, the old phone was LOS 19 (Android 12). What you are saying sounds very plausible.

      After looking into Etar's source code and noticing that the aCalendar+ debug output for reminders is claiming that the missing reminders haven't even been scheduled in the first place, I have a different suspicion that would also explain why all apps are missing out on exactly the same events:
      The problematic apps are probably all relying on the Android Calendar Provider API to find out which reminders need to be scheduled next. So my current hypothesis is that I should be looking for the bug there.

        9 months later

        I was hoping that the update to Android 15 would fix it, but this is not the case. I will need to invest some more time in this. Unfortunately, I haven't really found any additional clues so far, except for some additional assurance through trial and error that the hypothesis stated in my previous post is correct.

        birefringence After looking into Etar's source code and noticing that the aCalendar+ debug output for reminders is claiming that the missing reminders haven't even been scheduled in the first place, I have a different suspicion that would also explain why all apps are missing out on exactly the same events:
        The problematic apps are probably all relying on the Android Calendar Provider API to find out which reminders need to be scheduled next. So my current hypothesis is that I should be looking for the bug there.

        That could be. But if Fossify works it might be worth looking into how.

        I use etar and davx5 and haven't noticed any problems, though I only have one calendar and not to many events. One thing is that I have both adaptive battery and doze mode turned off through adb commands.

        The delayed reminders at least seems like it could be doze mode. If your looking at the code in etar maybe check if they are using setAndAllowWhileIdle() or setExactAndAllowWhileIdle() as the default method won't wake from doze mode until the next allowed wake cycle and so will be delayed. Even with the two above methods, doze mode only allows once per 9 minutes per app while in doze mode(it used to be 15 minutes, this changed in android 15)

        You could try a test with turning off doze mode with adb command and see what happens, doze mode can only be turned off temporarily with adb, rebooting will restore it.

          randallont

          GOS has frequently and from my perspective quite emphatically recommended against using adb in any capacity, as it essentially undoes a massive amount of the security GOS provides.