Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Prevent battey optimisation #522

Closed
tobidwest opened this issue Jun 16, 2020 · 16 comments
Closed

Prevent battey optimisation #522

tobidwest opened this issue Jun 16, 2020 · 16 comments

Comments

@tobidwest
Copy link

Feature description

When first starting the app, the app shoud open the device's settings explain how to disable battery optimisation.

Problem and motivation

By default, Android optimises the battery consumption by killing apps running in the background. This might cause tracing not to work as intended.

Is this something you're interested in working on

No, unfortunately, I do not have any experience on how to implement this.

@corneliusroemer
Copy link

Very good point. Made me think about the difficulty of verifying correct operation (it's a black box right now without logging). See my issue #525 that would help test if this is indeed an issue.

@uschindler
Copy link

uschindler commented Jun 16, 2020

This is not an issue for the app. The actual contact tracing is done by Google Play Services which are exempt from battery savings (you can easily check this):

20200616_123326

The Corona Warn Android App is just a "display" and "data store". If you kill it or put it to sleep nothing bad happens. Google Play Services still collect beacons. When app wakes up, it gets all collected information as bulk (see code and also example implementation provided by Google).
The actual warn functionality is done once per day. If that is delayed for short time, it doe snot matter at all.

So this issue can be closed, IMHO.

@tobidwest
Copy link
Author

tobidwest commented Jun 16, 2020

The actual contact tracing is done by Google Play Services

I already assumed this. But doesn't that mean that the app cannot inform you of any contact with infected persons, when it is not opened regularly?

The actual warn functionality is done once per day

I guess you know what you're talking about, just for my interest: How then does it work?

@uschindler
Copy link

uschindler commented Jun 16, 2020

The inform is only done once per day. And the app is woken up by OS for this and downloads a quite large file (depending on how many infections are there). For privacy reasons they don't use push services. See the scheduling code. The same applies for sending data of infected people. And trust me: Most people will open app from time to time...

@tobidwest
Copy link
Author

Thanks for clearing things up, @uschindler :D

@tobidwest
Copy link
Author

tobidwest commented Jun 16, 2020

For privacy reasons they don't use push services.

So, you need the app to see whether there are any problematic encounters? You wont't get notified?

@mhellmeier
Copy link

Especially Xiaomi Devices (MIUI operating system) uses a very aggressive MIUI power management system which kills apps running in the background and lead to missed notifications.

Perhaps another check in the first-start-setup-wizard which leads the user to the settings to disable the power optimization will improve things.

And trust me: Most people will open app from time to time...

I think some people will install the app and leave it untouched on their system. They won't get notifications with an aggressive power management system.

In my opinion, this issue is still relevant.

@uschindler
Copy link

For privacy reasons they don't use push services.

So, you need the app to see whether there are any problematic encounters? You wont't get notified?

Sorry, after download they show a notification.

Only the Android internal (provided by Google Play Services) PUSH notfications through Google's infrastructure are not used.

@tobidwest
Copy link
Author

Especially Xiaomi Devices (MIUI operating system) uses a very aggressive MIUI power management system which kills apps running in the background and lead to missed notifications.

So one needs to know whether

the app is woken up by OS

on Xiaom devices as well or if they modified something related to this.

@mohe2015
Copy link

afaik Xiaomi devices don't work because they don't support Google Play services (see Play Store reviews). But maybe this is only the case for some devices

@tobidwest
Copy link
Author

Btw wouldn't it be better to exclude devices that

don't support Google Play services

from installing in the Play Developer Console?

This might be confusing for some users.

@mhellmeier
Copy link

afaik Xiaomi devices don't work because they don't support Google Play services (see Play Store reviews). But maybe this is only the case for some devices

If you buy a Xiaomi phone you can choose between a Google Play Service or a non Google Play Service version. The first option is the default for most European citizens, the second one more for Asian, especially Chinese citizens due to several governance regulations.

So the app will work on the first version.

@mhellmeier
Copy link

This is not an issue for the app.
-- @uschindler

More than one month later, exactly this problems seems to be an issue for the app:
https://www.welt.de/politik/deutschland/article212133521/Bei-Android-Nutzern-Corona-Warn-App-stellte-sich-wochenlang-von-selbst-ab.html

@tobidwest
Copy link
Author

tobidwest commented Jul 24, 2020 via email

@uschindler
Copy link

@tobidwest this issue was about the exposure notifications. The daily update was discussed in another issue.

@uschindler
Copy link

Sorry, we also discussed about the background risk calculation, sorry, this may have been delayed (but I said this in my original post). Still I have to say: the recently deployed fixes don't fully prevent the issue, it's still a good idea. It often happens that the risk status is only updated when you open the app (you see the status message). This happens with and without background notifications. E.g., if the phone is on deep sleep, it can't wake up.

On the other hand the BILD Zeitung is as usual very aggressive, because they just have the black-and-white (sorry for this term) communication to readers.

As said in my original post, most people will open the app from time to time, so the issue is not as bad as communicated. As the update is daily only a delay of some hours don't make the "kraut fett".

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants