Risk state only updated when starting the app or after long idle time (deep sleep/ doze) for certain devices and manufacturers #756
Comments
+1, experiencing the same for the last ~48 hours. Samsung Galaxy S10, Android 10, Power Mode set to "Optimized", CWA is allowed to run in the background. |
Can you check whether CWA is impacted by battery optimizations on your devices? It would help to know that you are affected by your device restrictions and we will take this into account on the decision of #621 |
On my Samsung S10, the app was impacted by battery optimizations. However, for the first ~6 days, the app updated the risk status without opening the app, even though battery optimizations were active then as well. I have now excluded the app from battery optimizations to check whether this was the root cause. |
So just to clarify here, the battery optimizations will not always kill the job as they are general restrictions that are applied as soon as the device decides it needs to save power. the harder the restrictions, the more likely this job-killing is. This could mean that for you it worked for a certain time, and then the job was killed. |
Related and possible Duplicate of #626 |
Changing the battery saving settings worked for me. |
@crcsn please enter the app and wait up to 24 hours if not done already. |
@jakobmoellersap did that already. Opened the app regularly during the last two days, after I had modified the battery settings. |
This comment might sound very naive, but shouldn't it be possible to "register" an app in the system for a kind of "wake up" after some time later? Imagine an alarm clock application. Once the alarm is set, you can even kill the app, but it wakes you anyway. Is it really the only possible way to go to avoid at all cost that an app once started gets displaced by various hacks in energy management to achive this? |
I experience this as well (Pixel 4). App always shows the date of when I opened it manually.
Definitely not. Android provides foreground services to do this (which require a notification being shown while it's active, you can see this on other google apps as well) or various APIs which build on top of it. https://developer.android.com/guide/components/services I do not know whether this may actually be the issue here. However I haven't seen a foreground service notification of the app yet, so it maybe the case. |
Same issue with Samsung Galaxy A3 (2017) with Android 8.0.0, I allowed CWA to work in the background via "Nicht überwachte Apps" in "Gerätewartung" as well as not optimizing battery settings via Apps -> "Spezieller Zugriff" already 2 weeks ago. Update time is always the first time that I open the app. I did experience the issue of Not having enough storage even though having around 500Mb available, but that was solved by deleting even more stuff. Edited to add that I have version 1.1.1 of the CWA |
I still have this issue with CWA 1.1.1 that the risk status is not being updated in the background.
After updating to CWA 1.1.1 I used the CWA settings to switch Prioritized Background Activity to On. Then to check, I looked in Android > Settings > Apps > Corona-Warn > Battery usage in section In Android > Settings > Google > COVID-19 exposure notifications So there must still be something else preventing the risk state being updated in the background. Let me know if there is anything additional you would like me to check. I'm just using this device for testing. It's not my "production" phone that I take with me when I am coming into contact with other people. EDIT: |
Taking a wild guess... Are both phones using the same (main) google account? |
@vaubaehn |
@MikeMcC399 I suppose that you know, that there is a rate limitation from Google's side, on how often the EN Api may be called per day (20 times). If API is called too often, exception 39508 is thrown. I saw your edit from your preceeding post now... That would point to priorization problem then, imho - if your 'production' device also was updating. But like I wrote, that was just a wild guess. |
@vaubaehn |
@MikeMcC399 thanks for your reply. Then at least on possible reason may be excluded. |
I also still got the issue, that the risk state is just updated when opening the app (the respective setting is set). But somehow I don't care anymore in the meantime. |
Edit: after almost two days without update, my phone updated in the background again this early morning. When looking at calendar days in UTC, no day was actually missed; but the consistent checking around 7am in the morning does not seem to happen anymore. I edited the log timeline below in the original post and will update it for a few more days for completeness. Original post:I'm afraid that something has changed one to three days ago (possibly update to 1.1.1) so the automatic background updates stopped working for me as well:
I'm a little concerned as this behaviour is not usual on a Pixel phone, and everything has worked fine for more than a month. In fact, the timeline of my log is consistent with this behaviour appearing in version 1.1.1. |
I was curious about the implementation of the background processing and looked through the code. |
I believe this is not a bug. Daily update time slots seem to vary between users. My phone used to to them at ~6pm, but now I just manually open the app in the morning, so that I notice warnings early and to be sure that no background service failures affect me. Your phone seems to have switched to ~2am checks recently. |
Just wanted to update that it is working now on my Samsung Galaxy A3 (2017) with Android 8.0.0, CWA version 1.1.1, it updates at around 23:15 in the evening if I don't open the app manually. |
Last update was 31th Juli until I opened the app manually. This is a serious issue. Disabling battery optimizations which are enabled by default is no solution as millions of users won't do it. |
@shoeper you are right, this is a very serious problem. Unfortunately, some device manufacturers messed it up. This thread testifies on how hard (or even impossible) it is for developers to regain the control over (scheduled) background tasks. |
Hi @DannySchumann, and community, Thanks for all the contributions. We think that this issue is resolved with release 1.5. We will close this issue now. Best, DS Corona-Warn-App Open Source Team |
Describe the bug
The risk state seems to be only updated after starting the app. When opening the app the first time a day it always displays the current time, independent if it is in the morning or in the evening.
Expected behaviour
Risk state should also update in background. Sometimes the risk update time should lie in the past, especially when opening the app later than 10 pm.
Steps to reproduce the issue
Open the app the first time a day.
Technical details
Workaround
Switch battery saving settings from automatic to manual and allow auto-start and background activity explicitly.
Additional context
This is a follow up ticket of #621 taking this comment into account.
Internal Tracking ID: EXPOSUREAPP-1922
The text was updated successfully, but these errors were encountered: