I am working on BLE Bluetooth scanning is working on all devices except the Android 10 & 11. After updating the application, Bluetooth scanning in Android 10 & 11 are not working. Sometimes even after the location permission is allowed, the application has to re-grant permission from the application settings. Why is this not being known while always getting true in the
if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(getContext(), Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED){ //Code here.. }