corona-warn-app / cwa-app-ios

Native iOS app using the exposure notification framework from Apple. 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
1.68k stars 284 forks source link

Battery draining #671

Closed Krumelur closed 4 years ago

Krumelur commented 4 years ago

Describe the bug

Installed the release version of the app on iPhone X. The app completely drained my battery over night. Power usage protocol shows Health’s COVID-19 contact protocol being responsible for between 60% and 100% of battery usage.

Expected behaviour

Battery life shouldn’t be affected as documented.

Steps to reproduce the issue

Check the battery section in the settings.

image

image

Technical details

iPhone X, iOS 13.5.1

Possible Fix

Additional context

The COVID-19 context protocol doesn’t contain any entries.

I noticed that a message popped up twice yesterday about my region not being supported and was asked to check the Corona warning app used. The CWA is the only such app installed and configured. Maybe this problem is related? Note: I live in Germany and didn’t travel abroad, so the region thing looks like a bug to me.


Internal Tracking ID: EXPOSUREAPP-1882

user858753257 commented 4 years ago

The same here on iPhone 11 Pro . Normally I have at the end of the day 50-60% . Yesterday after the first day it was down to 30% . No other changes made to the device .

22880824-5FCF-43DB-9AA3-3071E5BCD7E5

dietrichb commented 4 years ago

I also observed high battery drain on an older iphone. The package 'Corona Warn App + Covid-19-Kontaktprotokoll' together account for 26% battery drain.

Phone

Battery Usage (24h)

Compare: Other Battery Usage (24h)

iphoneSECovidBatteryDrain

thomasaugsten commented 4 years ago

I think this high percentage is because there is no other App running in this time period.

The COVID-19-Kontaktprotokoll is implemented by Apple. We will give this feedback back to Apple to improve this behavior in the future.

n-thumann commented 4 years ago

The battery usage of COVID-19 Exposure Logging is controlled by Apple, so there´s probably no way to fix as a developer. Also, the battery statistics can be misleading, especially when there´s barely any other app running at the time: On my iPhone XR the Exposure Logging took 100% between 04:00 and 05:00, because no other app was running ✌️

chris-redbeed commented 4 years ago

I used my phone (after installing the app) normally and running on iOS 13.6 Beta 2: "COVID-19 Exposure Logging" just needs 2% battery

dietrichb commented 4 years ago

I think this high percentage is because there is no other App running in this time period.

The COVID-19-Kontaktprotokoll is implemented by Apple. We will give this feedback back to Apple to improve this behavior in the future.

Sure: The percentage depends on activities by other apps, it is relative.

However: One can try to estimate what it means in absolute numbers. In my case the battery drained from 100% to 15% in 24h (85%). Multiplying with 26% relative usage of (Warn App + Covid 19 Exposure Logging) this translates to an absolute 22% battery drain within 24 hours. This might be an issue, if one has no possibility to recharge the phone for a longer period.

marcohorstmann commented 4 years ago

I have installed it yesterday morning right after getting up. In hours where I was not using my phone activity of "Covid-19-Kontaktprotokoll" was up to 38%. In hours I used my phone it was down to 1-3%. Actually I didn't observed a much bigger battery drain as usual. Maybe this depends on my personal bluetooth use? I have a Apple Watch and AirPods which both are connected by Bluetooth.

Krumelur commented 4 years ago

Please, let’s not try to change facts by interpreting the numbers differently. Although the battery usage must be seen in relation to other applications running, the fact remains that after leaving the phone untouched for about eight hours the battery was empty. This was never the case prior to using the app or the involved frameworks. Over the last 24 hours the impact of the app and the corona framework contributed 30% to the battery usage according to the battery protocol. As a user I don’t care whose fault this is. It must be fixed. Otherwise, you’ll end up getting negative PR and people won’t install the application.

thomasaugsten commented 4 years ago

@Krumelur can you please provide more information about your device and connected bluetooth devices. You using iOS 13.5.1 or iOS 13.6? Also your using behavior would be interesting can you reproduce this battery consumption?

Krumelur commented 4 years ago

@thomasaugsten please see original report: Phone X, iOS 13.5.1. I'll have an eye on it and see if it happens again. Last night, the phone wasn't used at all and just idling. No music played, no other apps used.

There are other bluetooth devices the phone is using, but none of them was in actual use during that time period: Car BT Key, Apple Watch & AirPods.

I'll do a test today and tomorrow. Will charge to 100% with contact tracing enabled and check tomorrow morning and then do the same the day after with contact tracing off.

robertoschwald commented 4 years ago

Installed the App yesterday evening. Was home the whole day, but Battery usage of the Health "COVID-19 contact protocol" is at 8%. The Corona-Warn battery usage is at "--", so I think Apple needs to fix this...

max-hzi commented 4 years ago

Using the App for around 28h now. Stats on an iPhone 8, iOS 13.5.1 (last 24h):

Everything as expected, phone used as always with light Safari, Mail and Messages use, Music for approx 3h (mainly background).

thomasaugsten commented 4 years ago

@Krumelur Thanks for your help. If this behavior today the same please give here the feedback I will than contact you via e-mail.

imdatceleste commented 4 years ago

Same here, iPhone 6s: usually at the end of the day, I have around 50-60% left. I installed CWA yesterday (afternoon), and at the end of the day I had only 38%. Looking at usage, "Health (Covid-19 Exposure Logging) uses 17% and is on position 3.

Knowing how much I used the other apps (pos 1: 20%, pos 2: 18), the battery usage of "Health..." is not acceptable.

It is not your fault, but in the end this will result in less and less people using it, so it needs to be fixed - by Apple - and fixed fast(!)

This not only requires you to charge your battery more often but it also reduces the life-time of your battery significantly...

jwildeboer commented 4 years ago

Just adding my observation as a FYI - On my iPhone SE (Old 2016 version) no problems, battery usage normal. On my iPhone 11 I noticed significant higher battery usage and it got really hot this morning after it did the CWA update at 9:20. Solution: I switched the iPhone 11 off and on again, that seems to fix it. Temperature normal and battery usage seems to be OK again too.

felixbuenemann commented 4 years ago

On an iPhone SE 2020 running iOS 13.5.5 beta, I drained about 40% of the battery over 18 hours and 35% of that was the COVID-19 Contact Protocol, so that’s about 14% of the total capacity.

I’ll try if it differs on iOS 13.6 Beta.

Krumelur commented 4 years ago

Here’s the promised update. After another night of idling, the battery went from 98% to 74% within 11h. Over the past 24h the app contributed 13% of overall battery usage. During the night battery usage was almost exclusively caused by the contact protocol with a contribution of 60% to 100% (second screenshot).

Conclusion: 24% loss over 11h doesn’t seem too bad and better than the initial observation where it had used 37% within roughly the same time period.

Does contact tracing run more tasks initially, thus causing more energy use? The photos app has a similar behavior: excessive CPU use until all photos are processed, then very little usage.

I’ll post another update in 24h with contact tracing disable to see the difference in energy consumption.

image

image

mrgrauel commented 4 years ago

Irgendwas scheint seltsam. Die App hat laut Apple bisher 0-mal die Codes überprüft. Die Installation und Aktivierung war am Dienstag gegen 8 Uhr morgens. Könnte es zusammenhängen, dass hier das System potentiell Amok läuft und unter gewissen Umständen in einer Loop hängt, wodurch so viel Akku verbraucht wird? Will überprüfen, aber kann es nicht etc. 🤔

IMG_6996

ferdinand commented 4 years ago

@mrgrauel Bisher hat sich noch niemand über die App positiv gemeldet, dementsprechend gibt es noch keine IDs zu überprüfen (siehe #675).

imdatceleste commented 4 years ago

So, I had to switch off tracing because the battery usage is really, really horrendous.

Background

I have not moved outside of my apartment during the test-pages. The iPhone was on WiFi about 100% of the time.

I had installed CWA and switched on Exposure Loggin, the result is really bad. Within 24hrs the battery was used mostly by Health (COVID-19 Exposure Loggin).

Environment

Again, this is probably not a problem that you guys can solve, but this is more of an FYI: I have to switch off Exposure Logging because I don't want to charge my battery 2x per day (even though I am not moving at all)

IMG_3983

dietrichb commented 4 years ago

I also observed high battery drain on an older iphone. The package 'Corona Warn App + Covid-19-Kontaktprotokoll' together account for 26% battery drain.

Phone

* iphone SE (old)

* ios 13.5.1

* Corona Warn App 1.0.2

Battery Usage (24h)

* Corana Warn: 5%

* Health (Covid-19-Kontaktprotokoll): 21%

Compare: Other Battery Usage (24h)

* Spotify: 23% (~ 90 minutes streaming via Wifi and Bluetooth Headset)

* WhatsApp: 5% (11 minutes)

iphoneSECovidBatteryDrain

Yesterday I tried to reproduce the behaviour from 'day 1' by charging my phone to 100% followed by a powercycle and then using it for 24 hours (without charging). Within 24 hours, the battery drained from 100% to 10%.

--> The battery drain caused by 'COVID-19 Exposure Logging' is reduced to 1/2 of what was observed on the first day: It still causes ~10% of the total battery drain within 24 hours.

Wild guess:

Conclusion from my side: The battery drain of the 'Corona Warn App' itself seems ok., but Apples 'COVID-19 Exposure Logging' has room for improvement.

Krumelur commented 4 years ago

Another 24h later with contact tracing disabled in settings, the energy consumption was 32% - conclusion: I can no longer keep my claim up that battery life is negatively affected by the app or Apple’s new feature.

The energy consumption seems to be within similar ranges.

mrgrauel commented 4 years ago

I can confirm @Krumelur findings. After 48 hours of battery draining it seems to be back to a normal energy consumption.

EmDee commented 4 years ago

Just a heads up: There seems to be a bug in iOS 13.5.1 regarding battery consumption and Bluetooth: https://discussions.apple.com/thread/251435983

There are numerous confirmed reports on Twitter as well. So this is less likely an issue with the app, but with iOS itself.

bufemc commented 4 years ago

Unfortunately I can confirm that "sometimes" not Mail (see 2nd image, I consider this also to be a bug [by Apple], Push is off), but the Covid 19 Contact Protocol seems to drain the battery:

image

image

image

It's an unused iPhone 8plus while sleeping, latest iOS, in my case.

ChristianKienle commented 4 years ago

Thank you all for reporting the energy consumption on your end. An app should obviously not needlessly drain your battery. We will go over all the information you provided and think about what we can do here.

That being said it may be good to know that we only every do at most one call to the Apple API per 24 hours. We actually have a mechanism built into the app that prevents it from doing more than one actual detection per 24 hours.

(This ignores the API calls needed to setup the exposure notification framework)

Even though it looks like not to be an issue with the app itself there are a few things we should consider/do:

I will let this issue remain open until we have more information/follow up issues that address the root of this issue. And yes: The user does not care about what drained he/his battery.

jlang027 commented 4 years ago

Even the app itself seem very economical in using the battery, the also needed Health app from Apple uses 30% for the COVID-19-Kontakprotokoll. Please check, as the overall time to the next recharge is dramatically reduced.

This happens even I'm at home and no other - unknown - BT devices around me. Maybe the issue is related to my Garmin watch also connected by BT to my iPhone 8; SW 13.5.1

image

mac-dev commented 4 years ago

On friday 2020/7/3 I installed the new version of the Corona-warn-app iPhone completely useless since then. Freezes in apps running perfectly bevor an extreme battery drainage. I could fix it a bit by disabling Bluetooth and mobile data for music app and remove of the COVID app. Strang thing is - battery displays background activity for music app which I did not use at all. It started on Friday morning. As it shows music app here I think it is something apple needs to fix but it was started by updating Corona-warn-app 8F05CDFE-BA03-416E-AC79-FA0285DD63F5 F6877195-FD97-4C37-9DA0-F8D6C1302362 18B7F9A7-4022-4776-8619-13E1811D70E9

felixbuenemann commented 4 years ago

I'm no longer seeing battery usage reported for the COVID-19 contact protocol since upgrading from iOS 13.6 Public Beta 2 to Public Beta 3, while it was showing up as non-stop background activity in the days before the upgrade.

I think the new behavior makes a lot more sense, since the battery usage stats also don't show other always-on services like WiFi or cellular connections.

This is because the battery usage shown in the list is only the percentage of the battery drain that can be directly attributed to apps, but the battery level graph shows the total drain that included lots of other causes of battery usage.

That means that it is impossible to correlate the total battery level from the graph and the battery usage from the list to get the relative battery usage of an app for a certain period.

So overall I think the battery usage stats in iOS are a very flawed tool for accurately checking the impact of contact tracing on battery time.

A better test would probably be to reset an iPhone to factory defaults, fully charge it, leave it in one place, wait till it powers off due to low battery and then redo the same with the Corona Warn App installed and COVID-19 contact tracing enabled.

mss1010 commented 4 years ago

Hello,

in the closed issue #912 I described another type of issue with the battery usage. In short: After initial 14 days of usage, the battery started to drain faster, while the device usage (based on screen time) was less than before. Otherwise the usage of the device did not change basiclly. See details in that issue.

I have the suspicion that it could have to do with the EM framework and the app. So I hope this could also be checked with Apple.

mss1010 commented 4 years ago

Hello,

in the closed issue #912 I described another type of issue with the battery usage. In short: After initial 14 days of usage, the battery started to drain faster, while the device usage (based on screen time) was less than before. Otherwise the usage of the device did not change basiclly. See details in that issue.

I have the suspicion that it could have to do with the EM framework and the app. So I hope this could also be checked with Apple.

In the meanwhile I think this was misleading and not really an issue. What disturbed my findings was the wrong behavior if iOS 13.5.1 in regards to the background usage of apps. This was causing a high battery usage. After I applied the update to iOS 13.6 this issue is gone, and now I have a much longer battery life with the same normal usage.

philipp-heinrich commented 4 years ago

Please see my Battery usage reports attached. Normally Health consumed 4-6% in a regular day, starting from Saturday background usage went up to 14 and 28% on Sunday

Running on iOS 13.5.1 and CWA 1.1.1 (3)

443543DD-9D86-465E-BCFB-40BC165FD30A

0804205A-937E-4014-88CB-FA6B8264436F

AC865C78-BD13-4937-A793-BBEAA7CA6866

sicbb commented 4 years ago

I am using my iPhone 11 Pro Max with iOS 14 Developer Beta 5 and COVID-19 Contac Protocol is using 24% pur of 100% Battery (10 Days stats). It is too damn high!

thomasaugsten commented 4 years ago

@sicbb Can you please try Beta 6?

sicbb commented 4 years ago

@sicbb Can you please try Beta 6?

Download in progress...

svengabr commented 4 years ago

@sicbb Thank you for your effort. Have you already tried a test with the Developer Beta 6?

Best regards, SG

Corona-Warn-App Open Source Team

sicbb commented 4 years ago

@svengabr Yes, i installed yesterday the Developer Beta 6. Since then, my Battery Status Screen shows COVID-19 at 16% usage for the last 24h.

thomasaugsten commented 4 years ago

@sicbb How long was your overall Bildschirm ein and aus time? Because this percentage is not based on your battery capacity it is based on you complete usage of the phone in the last 24h. This means a not used phone has a high percentage and a heavy used phone has 1% here

sicbb commented 4 years ago

24h: IMG_0085

10 Days: IMG_0086

thomasaugsten commented 4 years ago

Thanks for the insights. As you can see for example yesterday you have an overall Batterienutzung of ~12% 16% of this are for Covid19 Framework this means around 2% of your battery capacity are used for Covid19 Framework. We have seen around 1%-2% as normal. I hope interpret the numbers right. But please check if you have a real significant drop in battery capacity when you are not using your phone.

huebi82 commented 4 years ago

49912723-7894-4E0D-9954-D8ECCF86A08A 5154C6D0-92E0-414D-87F2-38A204FA99AA EB6F76B6-042C-4D01-A061-631A4B7E64D1

Moin moin Ich war einer der ersten die diese "warnapp" geladen hat! Anfangs sind mir keine Probleme aufgefallen außer das mit "Tag 13/14" ... Mittlerweile is diese app zum Stromfresser mutiert was garnicht geht! Auch wenn's ne schöne/sinnvolle idee war is es mir wichtiger abends noch jemanden zu erreichen! Seit heute is das Kontaktprotokoll deaktiviert! Wenn sich in der Entwicklung der app nix tut bleibt es für mich auch dabei!d.h. die app fliegt runter! Was ich definitiv nicht machen werde ist meinen Jailbreak wegen dem furz aufzugeben!

Iphone8 Ios 13.5

Mfg 🤘🏼

thomasaugsten commented 4 years ago

Hi,

wie gesagt dieser Prozentsatz bezieht auf die relative Nutzung der letzte 24h. Das heißt wenn du dein Gerät intensiv nutzt dann fällt der Prozentsatz auf 1-2%. Ich würde dir ja ein Update auf 13.7 aber ich denke du möchtest den Zustand deines Gerätes beibehalten. Außerdem sind in dem Zustand deines Gerätes schwer Aussagen über Energieverbrauch zu machen.

ferdinand commented 4 years ago

@huebi82 Nicht die App verbraucht bei dir den Akku sondern das von Apple ins Betriebssystem integrierte Exposure Notification Framework. Die App hat auf dessen Akkuverbrauch keinen Einfluss. Wenn du, wegen dem Jailbreak, nicht bereit bist eine aktuelle iOS Version zu verwenden wird dir leider nicht zu helfen sein.

huebi82 commented 4 years ago

Ausreden gibt es wie Sand am Meer. Deswegen sind diese auch so wertlos! Leute ich bin kein vollidiot! 1.wenn ich mein gerät NICHT intensiv nutze müsste Abends noch akku vorhanden sein! Seit EUREN updates is das nicht mehr so!

Nachdem ich die App entfernt habe is auch wieder ruhe mit dem nutzlosen Stromverbrauch

Mfg

D48DB3FE-0AB8-43FD-B9F5-C20FA1ACDED4

jankout commented 4 years ago

Ich kann das auch nur bestätigen. Mit iOS 13.7 und 14 ist es noch mehr geworden - innerhalb der 10 Tage stand es mit 16% an der ersten Stelle. Ich nutze iPhone 8.

Ein-Tim commented 4 years ago

Aber was steht dort? "Corona-Warn App" oder "Begegnungsmitteilungen". Wenn "Begegnungsmitteilungen" steht, dann weiße ich darauf hin das diese von Apple stammt und somit die Entwickler der CWA keinen Einfluss auf diese Schnittstelle noch auf ihren Batterieverbrauch haben.

@jankout Bitte schau dir mal diese Aussage von @thomasaugsten an:

Hi, wie gesagt dieser Prozentsatz bezieht auf die relative Nutzung der letzte 24h. Das heißt wenn du dein Gerät intensiv nutzt dann fällt der Prozentsatz auf 1-2%. Ich würde dir ja ein Update auf 13.7 aber ich denke du möchtest den Zustand deines Gerätes beibehalten. Außerdem sind in dem Zustand deines Gerätes schwer Aussagen über Energieverbrauch zu machen.

jlang027 commented 4 years ago

Bei mir haben die Bewegungsmitteilungen seit iOS 13.7 über die letzten 10 Tage jetzt 53% der Batterienutzung erreicht :-(

Und ja - die CWA kann direkt nichts dafür, allerdings ist sie die einzige Anwendung die Bewegungsmitteilungen braucht. Und damit indirekt schon verantwortlich, dass ich mein IPhone seit der Aktivierung der CWA oft mehr als einmal am Tag laden muss.

Dieses Problem zu lösen kann nicht auf mich als Endanwender abgeschoben werden - und trägt, da jetzt seit Wochen bekannt, auch nicht zur freudigen Nutzung der CWA bei. Und Tatsache ist leider, dass die Batterie, bei ansonsten gleicher Nutzung, nach der Installation der CWA deutlich öfter zu laden ist.

Auch ich habe ein iPhone 8 mit iOS 13.7

Ein-Tim commented 4 years ago

Und ja - die CWA kann direkt nichts dafür, allerdings ist sie die einzige Anwendung die Bewegungsmitteilungen braucht. Und damit indirekt schon verantwortlich, dass ich mein IPhone seit der Aktivierung der CWA oft mehr als einmal am Tag laden muss.

Das ist natürlich korrekt, aber ich denke nicht das die Entwickler durch umstellen von Einstellungen das ENF dazu bringen können weniger Strom zu verbrauchen (da dieses ja von Apple kommt). Oder was meinst du?

jankout commented 4 years ago

Ich denke, dass es wichtig wäre, direkt mit Apple zu sprechen und darauf hinzuweisen.

thomasaugsten commented 4 years ago

Dazu benötigen wir detaillierte Screenshots der Batterynutzung, denn die 16% sind die relative zu deiner Gesamtnutzung und nicht zu deinem Batteryverbrauch.