Code analysis with Lint for calls requiring permissions

I set my targetSdkVersion to 23, and therefore I want to implement "Request Permissions at Runtime". (see here )

Lint directly calls if you forgot to check the resolution and reports the following:

A call requires permission, which can be rejected by the user: the code must explicitly check whether the permission is available (with checkPermission ) or explicitly handle the `SecurityException 'potential

This is pretty nice, and I want to analyze my code for any call that I can forget, but I can’t find the Lint option that I have to select in my inspection profile.

What is the name of the inspection? Thanks!

+5
android android permissions lint
source share
1 answer

First, click on the Hector the Inspector (a small icon of a person with a mustache in the lower right corner of Android Studio). This will bring up the “Configure checks” option.

Then you should enter “Permissions” in the search bar and make sure that “Constant mapping and resource type” is checked. After that, this is a simple test case using Analyze> Inspect Code.

+8
source share

All Articles