I'm trying to do a method that checks for android permissions. But when I call it I have a Missing Permission warning.
Here is a simplification of my code:
public void lintTestMethod(){
if(isPermissionGranted()) {
requiresLocationPermission();
}
}
public boolean isPermissionGranted(){
return true;
}
@RequiresPermission(anyOf = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION})
public void requiresLocationPermission(){
}
I tried adding:
@SuppressLint("MissingPermission")
public boolean isPermissionGranted(){
return true;
}
But it's not working (I also tried using SuppressWarning).
Ideally, I would like to not have to modify the lintTestMethod method.
Does anyone have an idea on how to deal with that ?