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

App doesn't work with GPS disabled in Android <11 (Exposure Notifications System bug) #5158

Closed prototyperspective closed 2 years ago

prototyperspective commented 2 years ago

Avoid duplicates

It is described in the FAQ and was reported here https://github.com/corona-warn-app/cwa-wishlist/issues/160 but it is not solved

Technical details

Describe the bug

The app's contract tracing doesn't work if GPS if disabled if Android <11 is used.

According to info such as what can be found in the FAQ this is because of issues of the Exposure Notifications System / Android of Alphabet Inc / Google.

This needs to be solved somehow. Just because it's a current limitation of the Exposure Notifications System doesn't mean that the problem is solved. It's still there and should be solved.

There are many reasons for why you may not want to have your GPS turned on all the time. Not just the battery drain. For example, the Corona Warn App itself can respect users' privacy all it wants...but if it requires GPS to be switched on, all other apps that run in the background (or in the foreground) that have permissions to use GPS can then also make use of it (a clear privacy violation).

Steps to reproduce the issue

  1. Run the latest version of the CWA on Android <11
  2. Turn on Bluetooth (with GPS remaining off)

Expected behaviour

The app's contact tracing should work with GPS disabled.

Possible Fix

It may or may not be necessary to put pressure on Google or to implement code changes in other Android code or to at least create an issue in another repository (please link it here).

Please do not close this issue before it's actually solved (and it may be important to solve this for the future).

Additional context

Ein-Tim commented 2 years ago

Suggestion to add the https://github.com/corona-warn-app/cwa-app-android/labels/google label to this issue if this is valid.

MikeMcC399 commented 2 years ago

@prototyperspective

In your title you write:

App doesn't work with GPS disabled in Android <11 (Exposure Notifications System bug)

It's not the whole app which is affected, only the Exposure Logging, and this depends on the Location setting being enabled for Android version 6 - 10 inclusive. Location is not necessarily the same as GPS. Depending on the device, it may be possible to disable GPS and enable the Location setting at the same time.

The FAQ https://www.coronawarn.app/en/faq/results/#android_location (or https://www.coronawarn.app/de/faq/results/#android_location for the German version) contains links to articles which explain about this.

This isn't a bug in the Corona-Warn-App and it is not even a restriction coming from the Google Play services implementation of the Exposure Notifications Service. It is a restriction of the Android operating system in Android 10 and earlier versions which requires Location to be enabled in order to have access to Bluetooth Low Energy (BLE). So, if anything, this issue could be considered an enhancement request against the Android operating system.

I doubt very much that Google would be able to change Android versions 10 and earlier due to compatibility constraints with device vendors and existing apps.

prototyperspective commented 2 years ago

It's not the whole app which is affected, only the Exposure Logging,

Yes, that's why I wrote "The app's contract tracing" in the description. However this functionality is a main purpose of the app and initially was the only purpose for which the app was created so if it stops working, core functionality of the app is broken so basically one can say the app isn't working.

Depending on the device, it may be possible to disable GPS and enable the Location setting at the same time.

Most people running Android < 11 don't have this option or if they have aren't aware of it. It's interesting and relevant here but at the very least it's not the full solution.

It is a restriction of the Android operating system in Android 10 and earlier versions which requires Location to be enabled in order to have access to Bluetooth Low Energy (BLE). So, if anything, this issue could be considered an enhancement request against the Android operating system.

Thanks for elaborating, making this clearer. In this case the issue to close this bug in Android should be linked here. I would consider this CWA issue then as an issue dependent on (resolution of) an external issue. In terms of coding as long as it is fixed nothing can be done so it's different from other 'Open' issues...however devs can still help fix the external issue and the project could let people know why this issue exists and put a public spotlight onto it* so Google devs or somebody else solves this. Android shouldn't require Location to be enabled in order to have access to Bluetooth Low Energy (BLE) and this seems like either intentional or a sloppy workaround on their part.

*for example with a public statement (inclusion in a press release or report to RKI/whoever is interested in this app) by the project or simply by some visibility of this problem to various devs. Problems of society's current digital ways of dealing with pandemics should be identified, communicated and solved – for example I think that such info may be useful at the Wikipedia article that I wrote "Use and development of software for COVID-19 pandemic mitigation". So far it seems like this is one of the 2-5 top issues that severely limit the actual usefulness of this app in practice (for the current and future pandemics).

I doubt very much that Google would be able to change Android versions 10 and earlier due to compatibility constraints with device vendors and existing apps.

This would need to be clarified in external issue/s in the appropriate repo/s. If somebody knows of them, please link them here. At worst case, I'll create them. For example, they could include it in an upgrade or it may be vendor devs that would be most responsible or capable at this point to solve this or it could be solved in some other way that we haven't thought of so far.

MikeMcC399 commented 2 years ago

Google shared some detailed background information in their blog post Jul 31, 2020 https://blog.google/inside-google/company-announcements/update-exposure-notifications/

The section starts as follows:

"... we’ve received questions about why your Android device location setting has to be turned on if you want to use an Exposure Notification app. We want to explain why this particular setting needs to be on, and how you can control your location settings on Android. ..."

MikeMcC399 commented 2 years ago

The issue described here is not a CWA bug, it's the way that Android works. It cannot be changed by the Android Corona-Warn-App, so I suggest to close the issue, since the purpose of this repository is to track issues which are under the control of the app itself.

mtwalli commented 2 years ago

@prototyperspective As already mentioned by the community members, it is an Android thing.