Etar-Group / Etar-Calendar

Android open source calendar
https://f-droid.org/packages/ws.xsoh.etar/
GNU General Public License v3.0
2.05k stars 393 forks source link

No notifications at all #1026

Open lzambarda opened 3 years ago

lzambarda commented 3 years ago

Hello there, I am using Etar v1.0.26 on a Huawei P-Smart running Emui 9.1 and Android 9.

The app has all permissions enabled and I disabled the battery manager to try and avoid it being randomly killed while in the background.

I can't seem to get any notifications and reminders. Any idea on how to inspect the issue?

Upon inspecting the logs via adb logcat | grep etar and setting up an event to fire a notifications, I got the following:

ActivityManager: App 10108/ws.xsoh.etar targets O+, restricted
BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.EVENT_REMINDER dat=content://com.android.calendar/1635719100000 flg=0x14 hwFlg=0x900 (has extras) } to ws.xsoh.etar/com.android.calendar.alerts.AlertReceiver
Gitsaibot commented 2 years ago

No idea why this does not work. According to Google docs(https://developer.android.com/guide/components/broadcast-exceptions) the broadcast ACTION_EVENT_REMINDER should be received in the background. By feel, I would say that mainly Huawei phones are affected by it.

deafboy commented 2 years ago

Pixel 3XL GrapheneOS (android12), no event notification here as well. I'm using etars offline calendar account.

Gitsaibot commented 2 years ago

@deafboy Which version of Etar? Perhaps the same cause as in #1085

KushGene commented 2 years ago

I have the same issue with GrapheneOS on Pixel 6. Etar 1.0.29.

Saroumane commented 2 years ago

Same issue (since a few weeks ? Can't tell exactly) : GrapheneOS on Pixel 3a, with Etar 1.0.29 from F-droid.

Gitsaibot commented 2 years ago

Does turning off the battery optimization for Etar help?

Saroumane commented 2 years ago

Yes indeed. But it was not needed before. So I assume the settings "allow settings alarms and reminders" was enough for etar. Do you think I should I open a bug report about that in GrapheneOS ? Or the problem may be with etar ?

Is it safe to downgrade to the oldest version of etar available on fdroid (1.0.27) ? I mean : safe for my calendars integrity.

Gitsaibot commented 2 years ago

Yes, google has introduced new restrictions with android 12 which mean that Etar can no longer run certain functions in the background.

Downgrading has the same effect as turning off the power saving feature for Etar. In the short term there will be no other solution for this unless someone can be found to rewrite all the affected code.

Saroumane commented 2 years ago

So I understand that putting "Battery usage" to "Unrestricted" is purely cosmetic : it will restore Etar previous functions without increasing battery consumption (I mean : before Android 12) ?

Gitsaibot commented 2 years ago

Yes, that's exactly how it is.

Gitsaibot commented 2 years ago

Followed up in #1142

lzambarda commented 2 years ago

For the record on Emui 9 (Android 9) this seems to be unrelated to battery management. Even when on the foreground the app will log the same issue described at the top of the thread!

EukalyptusX commented 2 years ago

I don't receive any notifications, neither. I'm on Google Pixel 6 Stock, Android 12, latest Etar from F-Droid. Battery Management is on Unrestricted already.

f45tb00t commented 2 years ago

Hi guys.

@Gitsaibot I can confirm unfortunately. GrapheneOS on Google Pixel 6 Pro and notifications are not working. I only get notifications when I opened the app manually. And then for example for the last day the notification. So in otherwords with a +x day delay.

I've also tested it with opentasks. This works so far. But I am running also other tests to see if this works.

Anything what we can do here? I've also already set the unrestricted battery mode for the app, but no luck with this.

Gitsaibot commented 2 years ago

Actually, disabling the power saving settings for Etar should be enough for the notifications to work under Etar and android 12. Helpful for me would be a debug log to see what the problem is.

EukalyptusX commented 2 years ago

Strange thing: I just tried a different calendar, and I got almost the same issue. This time I got the notification, but much later, than it should. All apps related to calendars have unrestricted battery mode. Maybe it's an OS issue.

Edit: I just found, that the other app didn't react on Googles new restrictions. Maybe this was the cause...

f45tb00t commented 2 years ago

Hi,

not sure if this is also related to stock android 12, but it seems after an update of android, all settings are gone again of the app.... You have this option for the permissions to be removed after some time of not using the app. I just disabled that for etar as well.

What I also did, which might did the trick, is to just add a calender widget of etar on the desktop. So far I am getting the notifications.

chris42 commented 2 years ago

Actually, disabling the power saving settings for Etar should be enough for the notifications to work under Etar and android 12. Helpful for me would be a debug log to see what the problem is.

Not sure if it helps, but found the following behaviour and log when Etar is missing the notification. Notification was set for 2230h, etar app completely closed and device ins standby. Interesting, that I get the same error when closing etar and removing the app from overview and keep the phone on. If I keep the card and keep the phone on, notification is delivered.

06-10 22:30:01.352 D/AlertReceiver(19383): onReceive: a=android.intent.action.EVENT_REMINDER Intent { act=android.intent.action.EVENT_REMINDER dat=content://com.android.calendar/1654893000057 flg=0x1000010 cmp=ws.xsoh.etar/com.android.calendar.alerts.AlertReceiver (has extras) }
06-10 22:30:01.357 W/ActivityManager(1589): startForegroundService() not allowed due to mAllowStartForeground false: service ws.xsoh.etar/com.android.calendar.alerts.AlertService
06-10 22:30:01.361 E/AndroidRuntime(19383): Process: ws.xsoh.etar, PID: 19383
06-10 22:30:01.361 E/AndroidRuntime(19383): java.lang.RuntimeException: Unable to start receiver com.android.calendar.alerts.AlertReceiver: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service ws.xsoh.etar/com.android.calendar.alerts.AlertService
06-10 22:30:01.361 E/AndroidRuntime(19383): Caused by: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service ws.xsoh.etar/com.android.calendar.alerts.AlertService
06-10 22:30:01.421 I/ActivityManager(1589): Process ws.xsoh.etar (pid 19383) has died: fg  RCVR
nu111 commented 1 year ago

On Google Pixel 4a, running Android 13, Etar 1.0.34 from F-Droid: I receive no alarms or notifications from Etar. I think that sometimes (very rarely), when I open the app some notification of past events appear, but with no sound alarm. That app results enable in the Android notification settings Screenshot_20230330-100953~2

And has no limit on Android battery usage settings

Screenshot_20230330-104812

It seems that installing Calendar Notification from F-Droid makes Etar notification work again.