On Android 12 devices (API 31),
User has GRANTED both the precise and approximate permissions and app is working fine post that.
When user turns off the device location by going into settings, I see the ACCESS_FINE_LOCATION permission as NOT GRANTED.
When checked by navigating into settings, we see precise location is turned on and location is set to allow all the time. Still the ACCESS_FINE_LOCATION is returned as NOT GRANTED.
In this scenario below code returns false -
override fun hasLocationPermission(): Boolean {
return PermissionChecker.checkSelfPermission(
mContext,
android.Manifest.permission.ACCESS_FINE_LOCATION
) === PermissionChecker.PERMISSION_GRANTED
}
So if user turns off device location then FORGROUND LOCATION PERMISSION IS NOT GRANTED. is this the expected behaviour in Android 12?
Please assist.