use of com.android.tools.klint.checks.PermissionHolder.SetPermissionLookup in project kotlin by JetBrains.
the class SupportAnnotationDetector method getPermissions.
private PermissionHolder getPermissions(@NonNull JavaContext context) {
if (mPermissions == null) {
Set<String> permissions = Sets.newHashSetWithExpectedSize(30);
Set<String> revocable = Sets.newHashSetWithExpectedSize(4);
LintClient client = context.getClient();
// Gather permissions from all projects that contribute to the
// main project.
Project mainProject = context.getMainProject();
for (File manifest : mainProject.getManifestFiles()) {
addPermissions(client, permissions, revocable, manifest);
}
for (Project library : mainProject.getAllLibraries()) {
for (File manifest : library.getManifestFiles()) {
addPermissions(client, permissions, revocable, manifest);
}
}
AndroidVersion minSdkVersion = mainProject.getMinSdkVersion();
AndroidVersion targetSdkVersion = mainProject.getTargetSdkVersion();
mPermissions = new SetPermissionLookup(permissions, revocable, minSdkVersion, targetSdkVersion);
}
return mPermissions;
}
Aggregations