I am setting my targetSdkVersion to 23 and therefore I want to implement "Requesting permissions at runtime". (see here)
Lint directly calls out if you forget to check the permission and tells you the following:
Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with
checkPermission
) or explicitly handle a potential `SecurityException'
This is quite nice and I want to analyze my code for any call that I may have forgotten, but I can't find Lint option that I have to select in my Inspection profile.
How is the inspection called? Thanks!
First click on Hector the Inspector (the small icon of a man with a moustache at the very bottom-right of Android Studio). This will bring up an option to Configure inspections.
You should then type 'Permissions' into the searchbar, and ensure that "Constant and Resource Type Mismatches" is checked. After that, it's a simple case of running an inspection via Analyse > Inspect Code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With