android icon indicating copy to clipboard operation
android copied to clipboard

Bluetooth permission should only be requested when needed for location sensor

Open TimoPtr opened this issue 4 months ago • 4 comments

Description

Today we are asking for Bluetooth permission when we want to enable the LocationSensors. Without this we are disabling the sensor.

Bluetooth in location tracking is only used for high accuracy tracking with some condition like being connected to a given device.

We should be able to enable the location without asking for Bluetooth permission. This would make one less popup during the onboarding of a user. Also the location should continue to work even if the user denied Bluetooth permission.

Additional context

No response

TimoPtr avatar Oct 14 '25 12:10 TimoPtr

Idea

Having a permission at a sensor settings level

We could attach a permission (or a set of permission) to a settings, so that we check the permission when we check the settings. We can then ask for permission when the user actually wants to turn on this setting.

TimoPtr avatar Oct 14 '25 12:10 TimoPtr

Idea

Instead of complicating sensors with permissions per setting (which are dynamically created), my suggestion would be to break location tracking out from the sensor interface. The three main 'sensors' are not actually sensors and already behave differently.

jpelgrom avatar Oct 14 '25 19:10 jpelgrom

I do recall that we did add location to sensor manager at the time because location tracking was a bit unreliable then due to bugs (both in app and play services). It was nice to have work manager there because it was able to periodically do checks like if we are still getting updates as expected. Which was for another bug fix as sometimes play services stops sending us updates.

I do like the permission at sensor setting level but I cant think of any other sensor that would need a permission like this one for the setting.

dshokouhi avatar Oct 14 '25 20:10 dshokouhi

We could still use WorkManager for location tracking setup/periodic checks, I'm just suggesting that we should not treat it like a sensor when this is making things needlessly complicated for actual sensors. (And I think it also is confusing to normal users to see it as a sensor while it does not behave like one.)

jpelgrom avatar Oct 14 '25 20:10 jpelgrom