With Android 12.0, when asking for location permission requestLocationAuthorization(), the user is now presented with a choice to share a 'approximate'/COURSE or a 'precise'/FINE location.
When the user has set the location to be 'Approximate', getLocationAuthorizationStatus() will return DENIED_ALWAYS. As Android 12 in that case returns ACCESS_FINE_LOCATION is DENIED_ALWAYSACCESS_COARSE_LOCATION is GRANTED. However combineLocationStatuses()expects both statuses to be GRANTED or it returns DENIED_ALWAYS.
Screenshots
Console output
On allow "When in use" (approx location)
Android 12.0 - API 31
V/Diagnostic: Authorisation for ACCESS_FINE_LOCATION is DENIED_ALWAYS
V/Diagnostic: Authorisation for ACCESS_COARSE_LOCATION is GRANTED
Android 11.0 - API 30
V/Diagnostic: Authorisation for ACCESS_FINE_LOCATION is GRANTED
V/Diagnostic: Authorisation for ACCESS_COARSE_LOCATION is GRANTED
Android 10.0 - API 29
V/Diagnostic: Authorisation for ACCESS_FINE_LOCATION is GRANTED
V/Diagnostic: Authorisation for ACCESS_COARSE_LOCATION is GRANTED
Expected behavior:
I think the function getLocationAuthorizationStatus() should not return DENIED_ALWAYS if ACCESS_COARSE_LOCATION is granted but GRANTED/GRANTED_WHEN_IN_USE.
The specific type/precision (sh/c)ould be accessed by the one of the other fuctions like isGpsLocationAvailable().
Note: There might be a good reason why both statuses need to be granted, and this proposal is not right. But I lack the historic context/experience to make a judgement on that. @dpa99c a big thanks and lots of respect for carrying essential plugins like this and others.
Bug report
Current behavior:
With Android 12.0, when asking for location permission
requestLocationAuthorization()
, the user is now presented with a choice to share a 'approximate'/COURSE or a 'precise'/FINE location.When the user has set the location to be 'Approximate',
getLocationAuthorizationStatus()
will returnDENIED_ALWAYS
. As Android 12 in that case returnsACCESS_FINE_LOCATION is DENIED_ALWAYS
ACCESS_COARSE_LOCATION is GRANTED
. HowevercombineLocationStatuses()
expects both statuses to beGRANTED
or it returnsDENIED_ALWAYS
.Screenshots
Console output
On allow "When in use" (approx location)
Android 12.0 - API 31
Android 11.0 - API 30
Android 10.0 - API 29
Expected behavior:
I think the function
getLocationAuthorizationStatus()
should not returnDENIED_ALWAYS
ifACCESS_COARSE_LOCATION
is granted butGRANTED
/GRANTED_WHEN_IN_USE
.The specific type/precision (sh/c)ould be accessed by the one of the other fuctions like
isGpsLocationAvailable()
.Steps to reproduce:
Related code:
./cordova.plugins.diagnostic/www/android/diagnostic.location.js
Environment information
Note: There might be a good reason why both
statuses
need to be granted, and this proposal is not right. But I lack the historic context/experience to make a judgement on that. @dpa99c a big thanks and lots of respect for carrying essential plugins like this and others.