public class WakelockDetector
extends com.android.tools.lint.detector.api.Detector
implements com.android.tools.lint.detector.api.ClassScanner, com.android.tools.lint.detector.api.SourceCodeScanner
com.android.tools.lint.detector.api.Detector.BinaryResourceScanner, com.android.tools.lint.detector.api.Detector.ClassScanner, com.android.tools.lint.detector.api.Detector.GradleScanner, com.android.tools.lint.detector.api.Detector.OtherFileScanner, com.android.tools.lint.detector.api.Detector.ResourceFolderScanner, com.android.tools.lint.detector.api.Detector.UastScanner, com.android.tools.lint.detector.api.Detector.XmlScanner| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANDROID_APP_ACTIVITY |
static com.android.tools.lint.detector.api.Issue |
ISSUE
Problems using wakelocks
|
static com.android.tools.lint.detector.api.Issue |
TIMEOUT
Using non-timeout version of wakelock acquire
|
| Constructor and Description |
|---|
WakelockDetector()
Constructs a new
WakelockDetector |
| Modifier and Type | Method and Description |
|---|---|
void |
afterCheckRootProject(com.android.tools.lint.detector.api.Context context) |
void |
checkCall(com.android.tools.lint.detector.api.ClassContext context,
org.objectweb.asm.tree.ClassNode classNode,
org.objectweb.asm.tree.MethodNode method,
org.objectweb.asm.tree.MethodInsnNode call) |
protected static int |
dfs(ControlFlowGraph.Node node)
Search from the given node towards the target; return false if we reach an exit point such as
a return or a call on the way there that is not within a try/catch clause.
|
java.util.List<java.lang.String> |
getApplicableCallNames() |
java.util.List<java.lang.String> |
getApplicableMethodNames() |
void |
visitMethodCall(com.android.tools.lint.detector.api.JavaContext context,
org.jetbrains.uast.UCallExpression call,
com.intellij.psi.PsiMethod method) |
afterCheckEachProject, afterCheckFile, afterCheckLibraryProject, afterCheckProject, analyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesTo, appliesTo, appliesToResourceRefs, beforeCheckEachProject, beforeCheckFile, beforeCheckLibraryProject, beforeCheckProject, beforeCheckRootProject, checkBinaryResource, checkClass, checkClass, checkDslPropertyAssignment, checkDslPropertyAssignment, checkFolder, checkInstruction, checkMethodCall, createPsiVisitor, createUastHandler, fix, getApplicableAsmNodeTypes, getApplicableAttributes, getApplicableCallOwners, getApplicableConstructorTypes, getApplicableElements, getApplicableFiles, getApplicablePsiTypes, getApplicableReferenceNames, getApplicableUastTypes, getCustomVisitor, getSpeed, inheritAnnotation, isApplicableAnnotationUsage, isCallGraphRequired, run, visitAnnotationUsage, visitAnnotationUsage, visitAttribute, visitBuildScript, visitClass, visitClass, visitConstructor, visitConstructor, visitDocument, visitElement, visitElementAfter, visitMethod, visitMethod, visitReference, visitReference, visitResourceReference, visitResourceReferenceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckClass, checkInstruction, getApplicableAsmNodeTypes, getApplicableCallOwnersanalyzeCallGraph, applicableAnnotations, applicableSuperClasses, appliesToResourceRefs, createUastHandler, getApplicableConstructorTypes, getApplicableReferenceNames, getApplicableUastTypes, inheritAnnotation, isApplicableAnnotationUsage, isCallGraphRequired, visitAnnotationUsage, visitAnnotationUsage, visitClass, visitClass, visitConstructor, visitMethod, visitReference, visitResourceReferencepublic static final java.lang.String ANDROID_APP_ACTIVITY
public static final com.android.tools.lint.detector.api.Issue ISSUE
public static final com.android.tools.lint.detector.api.Issue TIMEOUT
public WakelockDetector()
WakelockDetectorpublic void afterCheckRootProject(@NonNull
com.android.tools.lint.detector.api.Context context)
afterCheckRootProject in class com.android.tools.lint.detector.api.Detector@Nullable public java.util.List<java.lang.String> getApplicableCallNames()
getApplicableCallNames in interface com.android.tools.lint.detector.api.ClassScannergetApplicableCallNames in class com.android.tools.lint.detector.api.Detectorpublic void checkCall(@NonNull
com.android.tools.lint.detector.api.ClassContext context,
@NonNull
org.objectweb.asm.tree.ClassNode classNode,
@NonNull
org.objectweb.asm.tree.MethodNode method,
@NonNull
org.objectweb.asm.tree.MethodInsnNode call)
checkCall in interface com.android.tools.lint.detector.api.ClassScannercheckCall in class com.android.tools.lint.detector.api.Detectorprotected static int dfs(ControlFlowGraph.Node node)
node - the current node@Nullable public java.util.List<java.lang.String> getApplicableMethodNames()
getApplicableMethodNames in interface com.android.tools.lint.detector.api.SourceCodeScannergetApplicableMethodNames in class com.android.tools.lint.detector.api.Detectorpublic void visitMethodCall(@NonNull
com.android.tools.lint.detector.api.JavaContext context,
@NonNull
org.jetbrains.uast.UCallExpression call,
@NonNull
com.intellij.psi.PsiMethod method)
visitMethodCall in interface com.android.tools.lint.detector.api.SourceCodeScannervisitMethodCall in class com.android.tools.lint.detector.api.Detector