corona-warn-app / cwa-app-android

Native Android app using the Apple/Google exposure notification API. The CWA development ends on May 31, 2023. You still can warn other users until April 30, 2023. More information:
https://coronawarn.app/en/faq/#ramp_down
Apache License 2.0
2.44k stars 495 forks source link

Warn about deactivated battery optimization on main screen #2682

Closed fynngodau closed 1 year ago

fynngodau commented 3 years ago

Current situation

Over at CCTG, we have talked to users who had problems with background exposure notifications. In a lot of cases, the underlying issue was simply that users had forgotten to disable battery optimizations for the app.

Since CWA is also not able to sync reliably in the background when battery optimizations are enabled, I feel this is a topic that could be dealt with in CWA.

Suggestion

Show a warning on the main screen that informs users that they should change their device's settings to disable battery optimization.

Expected benefits

Users might read the text and be more aware of the cause of issues they might encounter, and might try to fix them themselves accordingly, reducing workload for technical support.


Related issues https://github.com/corona-warn-app/cwa-app-android/issues/1606 https://github.com/corona-warn-app/cwa-app-android/issues/2683


Internal Tracking-ID: EXPOSUREAPP-6663

thomasaugsten commented 3 years ago

For the CWA the battery optimization is not so critical because we are whitelisted from the battery optimization from all vendors and the Google Play Service wakes all 6hours the CWA up.

MikeMcC399 commented 3 years ago

Perhaps if the deadman notification is triggered (after 36 hours) there could be a check done to see if battery optimization is enabled (or to use CWA app terminology, Prioritized Background Activity is disabled)? If so, the user could additionally be given the hint to disable battery optimization (enable Prioritized Background Activity) if possible.

Your Risk Status expanded

di-sc commented 3 years ago

I had the same issue with CCTG on my phone recently and I found out the reason why it was not working because of the contact overview screen which is not available for CWA. If the CWA does not work, I won't recognize at all. My feeling is that disabling the battery optimization is too complex for most users. It is not so clear what to do and how important it is to do it. For the user it is not obvious that the app will work for some days but may stop working later because of this battery optimization setting.

My suggestion:

Add an algorithm to check if the app is working. If the user does not collect any new Ids anymore the app may not work anymore. By using the number of Ids that were collected in recent days it can be forcasted how likely it is that the user doesn't have had any contacts or if the app is not working. If this algorithm detects that the app may not work anymore it should:

fynngodau commented 3 years ago

If the user does not collect any new Ids anymore the app may not work anymore.

As mentioned in the CCTG issue, this is not technically possible with Google's Exposure Notifications API.

vaubaehn commented 3 years ago

@di-sc @fynngodau Fynn is right, CWA can't do anything about it, because it already went to sleep and is not having enough processor time anymore, and also the ENS Api does not provide an function to check the amount of collected RPIs (= contacts). Also, as long as the device/bluetooth is not switched off, the phone will continue to receive beacons. If at all, then the Google Exposure Notification System would need to add such a feature: if there is a contact tracing app installed, but it stopped to provide diagnosis keys for matching for some time (more than 36 hours for example), then the ENS could notify the user, that user should open the contact tracing app to wake it up again. How's this?

Edit: After the 'battery optimization trouble' from the beginning till late summer, Google implemented a watch dog to the ENS, that should wake up the contact tracing app at least once per day, even if it was force-stopped before. Any additional user notification from ENS to open (wake up) the app would likely be for few edge cases only, as a last resort.

di-sc commented 3 years ago

@vaubaehn Okay, good to know that this has been improved. But still the user cannot distinguish between "having no positive tested contacts" and "app not working". Don't know how likely it is that the app stops working because of other reasons. Anyway it isn't worth thinking about it until Google extends the ENS API.

mtwalli commented 1 year ago

No planned