use of com.android.tools.klint.client.api.JavaEvaluator in project kotlin by JetBrains.
the class PreferenceActivityDetector method checkClass.
@Override
public void checkClass(@NonNull JavaContext context, @NonNull UClass declaration) {
if (!context.getProject().getReportIssues()) {
return;
}
JavaEvaluator evaluator = context.getEvaluator();
String className = declaration.getQualifiedName();
if (InheritanceUtil.isInheritor(declaration, false, PREFERENCE_ACTIVITY) && mExportedActivities.containsKey(className)) {
// valid fragments.
if (context.getMainProject().getTargetSdk() >= 19 && overridesIsValidFragment(evaluator, declaration)) {
return;
}
String message = String.format("`PreferenceActivity` subclass `%1$s` should not be exported", className);
Location location = mExportedActivities.get(className).resolve();
context.reportUast(ISSUE, declaration, location, message);
}
}
Aggregations