| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL contains a number of unrelated lint bug fixes:
* Fix API detector such that it warns about ?android:name attrs
* Fix API detector for inlined constants such that it's more rigorous
in how it determines whether a constant is used in a valid (if
conditional or case value) context
* Fix 43070: Analytics resources should not be flagged as needing
translations
* Fix 42994: Android lint should not complain about 'Custom view is
missing constructor used by tools' for classes that are declared
abstract
* Finally, pass in the right node context for a few places it was
missing it (when missing, adding suppress annotations only works
on the root class AST node)
Change-Id: I044140c865dbd3d0e964dae7f13c66eeb450509e
|
|
|
|
|
|
|
|
| |
Fix missing dispose() call for manifest files, and add a method
to the TypographyDetector such that clients don't need a DOM node
to look up the suggested replacement.
Change-Id: If048a62a6b0b1c8af83a3e0b62a28876d4449764
|
|
|
|
|
|
|
|
|
|
|
| |
The other file visitor would unconditionally scan the full
project contents for each scope, even when project.getSubset()
(used for incremental analysis in IDEs) was non null.
Also avoid NPE when lint is scanning a java file without a
package declaration.
Change-Id: I74e813b41c2e32acac879b277dc974619156adbd
|
|
|
|
| |
Change-Id: Ibc54b1a23688217666b60ce7dc692f0bba00419a
|
|
|
|
| |
Change-Id: Ibd997301864981ceb863a30b36034a784ab13392
|
|
|
|
| |
Change-Id: I180cba4a0f71d86ae7b61643bd0b36cc8c4c6b28
|
|
|
|
|
|
|
|
|
|
| |
This adds a new scope, Scope.OTHER, which can be used to indicate
that the check wants to investigate files other than the ones
specially handled as XML, Java, manifest or ProGuard files.
The PrivateKeyDetector now uses this such that it doesn't have
to perform its own directory iteration.
Change-Id: Ic38bf2db656f00c01d94c0c4e0112bc77218ea08
|
|
|
|
| |
Change-Id: I783e001fe84d825e116c6b2a882bcf2d22c61884
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, fix the error message; it was sharing code with the
recycle detector and accidentally mentioned recycle rather
than commit in the error message.
Second, fix a bug where it would fail to find committed
transactions if the commit() was reached through setter
chaining (where each setter returns this).
Also, remove checking for recycling of Message objects;
according to the following thread it looks unnecessary:
https://groups.google.com/forum/?fromgroups=#!\
topic/android-developers/9pHuc7lGunY
Finally, the unit test class had the wrong name (was not
moved when the recycle detector was generalized to handle
other types of cleanup.)
Change-Id: I80f4bf65acf304660c8a7e7a5b9e1b4f932e25c0
|
|
|
|
| |
Change-Id: I27f5714539f1d28efc6ace1b9c9918fbd5f47825
|
|
|
|
|
|
|
|
|
| |
The issue has severity warning instead of error.
Also, deliberately filter out constants which moved to a
base class.
Change-Id: I4976c421aa589cdb0a673c2d49bcafdd80ff005e
|
|
|
|
|
|
|
| |
This should help track down problems like
https://github.com/JakeWharton/ActionBarSherlock/issues/446
Change-Id: I5ed721189fcdd1090b2dfd5f64d2222e223aa4c5
|
|
|
|
| |
Change-Id: Ib923638c305105e84f79a18a79ece48d391129c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, lint has hardcoded where the project resources are to be
found: in $project/res.
With the new build system this will no longer necessarily be the case;
there can be multiple resource folders, and the locations might not be
just res/.
Therefore, this CL generalizes lint's handling of resource folders: it
is now provided by the LintClient, and the command line lint tool uses
this to offer a new --resources flag which can be used to set the
resource directory/directories for a project.
Change-Id: I3717c6474141776ee5541d476f9bad5bb8e1a9c7
|
|
|
|
|
|
|
|
| |
Without this the lint check for instantiatable classes
might incorrectly conclude that a custom view should
have a default constructor.
Change-Id: I5c2281d5681e3b344c9dc78e13960408886f383c
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds a check for cases where you have a LinearLayout which
does not specify an orientation (meaning it's horizontal), yet
it contains multiple children, and one of the children prior to
the last one sets its width to fill_parent or match_parent (without
a weight).
This is a common pitfall for new developers who create the layout
and assume it's vertical, and at runtime only see the first child,
not realizing the remainder are off screen to the right.
Change-Id: Ief9604d8a8fc84849d1a8f2df6d7ec0b75b13eaa
|
|/
|
|
|
|
|
|
| |
Fix typos, remove redundant semicolons, fix incorrect names
(using an m prefix where they should be using s, turn fields
with constant names into actual constants), etc.
Change-Id: I44a5ab82c1158007d0803d43ce14b361aff240b8
|
|
|
|
|
|
| |
Also update constants to stay in sync with sdk/ version.
Change-Id: I8e454a03d83c81036bf8cc73609babc96a9c7739
|
|
|
|
| |
Change-Id: I33f3284368a9dd199b2cd70c023d6a22f2426c00
|
|
|
|
| |
Change-Id: I55ec4385e782ec8d5eff80b2206a0bcfe755201a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lint currently checks the .class files for field references and method
references to APIs that require a version higher than the
minSdkVersion in the manifest.
However, constants (such as final static integers) will be copied into
the .class file, so there is no reference to the original API and its
API version, which means lint can't flag these.
In some cases, such as referencing LayoutParams.MATCH_PARENT, that's
no problem; the constant value works on older versions, and there is
no problem, since the value rather than the reference is
used. However, in other cases this may lead to runtime crashes.
This CL updates lint to look at the source files and flag field
references. It excludes some constants that are known to be okay
(such as referencing say android.os.Build.VERSION_CODES.JELLY_BEAN_MR1
(which is typically done precisely to conditionally branch based on
the current device's version). It also ignores usages as case
constants or in conditional if checks. We may need to do additional
tweaks to this in the future, since unlike method and field references
there are probably many cases where referencing these constants are
fine on older devices, but there are also cases where it's
dangerous. For now, we're erring on the side of warning the developer
rather than being certain that it's not a problem.
Change-Id: Ieba4c15d7fdda02756b7b7f5a1b79f7698c1915b
|
|
|
|
| |
Change-Id: I428628956c7790b5206d83310211411c4ea54c68
|
|
|
|
| |
Change-Id: Ia43c2436e01032ace7e2b13e59d60d10f71e7004
|
|
|
|
|
|
| |
Cherrypick from https://android-review.googlesource.com/#/c/48540/
Change-Id: Ic3d4552324c319899f908c4741ed263514713c1a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Lint already checks that classes registered in the manifest (such as
activities and services) exist and are instantiatable.
This lint check expands this check to also make sure that custom views
and fragments referenced in layouts also exist, as well as class names
registered in analytics config files (requested in issue 41567).
It also fixes the typography detector to not flag IDs as needing
em dashes.
Change-Id: Idd42be60dae6c0747324d600d15b01d6d8a3240f
|
|
|
|
|
|
|
|
|
|
| |
This implements
41339: Forgetting .commit() after .beginTransaction()
Also renames the RecycleDetector to something more generic
since it checks for other types of cleanup as well.
Change-Id: I19ca6537ba88745845ad452f87b6562085a47fe5
|
|
|
|
|
|
|
| |
Adds a lint check which flags using resource ids for versionName,
versionCode, minSdkVersion and targetSdkVersion in the manifest.
Change-Id: I5b4e25d0b114cdf84f446a193fe5d3a095b2f415
|
|
|
|
|
|
|
|
| |
Ran some static analysis on the lint code and fixed
various issues - some typos, made some fields final, made
some methods static, sorted modifier order etc.
Change-Id: Ibdcdec5745f040eb7b0880cf6999c0f0ea7f7e6f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lint check looks for missing recycle() calls on resources such as
TypedArrays, MotionEvents, and Messages.
41140 New Lint Check: Check Recycling VelocityTracker
41138 New Lint Check: Check Recycling Message
41137 New Lint Check: Check Recycling MotionEvent
41136 New Lint Check: Check Recycling TypedArray
In addition, it also flags cases where a method is called on a resource
after the resource has been recycled.
Change-Id: Ia06a1779519971d5459f1cd98914a6aededc4b83
|
|
|
|
|
|
|
|
| |
This fixes
41154: Template Android Application Project for API v3 reports AAPT
problem with android:allowBackup="true"
Change-Id: I74b4cd0f8df9a74fe9221250cc83b1d15821ce51
|
|
|
|
|
|
|
|
|
|
|
| |
The unit tests for lint have lived in the lint/libs/lint_checks
library, but that's not a natural place since the cli library depends
on the lint_checks library, yet the lint_check *tests* also depend on
cli. Furthermore, the tests also test stuff in the cli library. Thus,
move the test sources over to the cli library, which also pulls in the
lint_checks library.
Change-Id: Ia8527ea894b287915ad12c04c16daf80ace67bdc
|
|
|
|
|
|
|
|
|
|
| |
Move folders around to match default gradle/maven
folder structure.
The custom structure confused some IDEs when importing
the project as a Gradle project.
Change-Id: I5c059cc6fdf0ac2444b03d435f83f853363cfa32
|
|
|
|
|
|
|
| |
Fix a couple of issues found by findbugs,
and some test stability fixes.
Change-Id: I97390ea606ea25d6a68e5b7f8245e5e689117995
|
|
|
|
| |
Change-Id: I2cb3a51e2ddf914acb9129a82294b75c568c3949
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, don't complain about an unexpected namespace
if the offending attribute is a layout parameter,
since it applies to the parent, not the current view.
Second, for the res-auto warning, report the error
only on the xmlns namespace declaration, not each
usage of that namespace.
Change-Id: If6a7576cf56c0936a24be851cfc48bc54d374ea4
|
|
|
|
| |
Change-Id: I427e498a314aeaeb2a302811bfde1dc719e435d5
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This lint detector finds method declarations which are likely
to clash and accidentally override framework classes defined
on newer platforms
Also, fix method position computation in class files.
Change-Id: If0d03feb55e44816f75938dae3164c53ed5b3183
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It appears Dalvik is very forgiving and doesn't try to preload classes
until actually needed, so there is no need to flag variable and field
declarations, and in fact, patterns used for supporting new and old
versions sometimes declares these methods and only conditionally end
up actually accessing methods and fields, so only check method and
field accesses.
Also fix lint such that it doesn't flag XML resource warnings for
tools URI namespace elements, such as ListView preview layout
selections.
Change-Id: I9018a64845b5b29744926e3d0be371801bbdd167
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| | |
Also add XML editor quickfix to set the attribute on
an API violation.
Change-Id: Ife95d73659656e98a6fb1a322354f5fcfcef1888
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: I4683dc68a9f74ad8a2c709c8313c17ccbfbd64a1
|
|/
|
|
| |
Change-Id: I0e96e4b3d5d9c3fa14e4f84d73a6bd023f44162a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The inefficient weight detector looks for horizontal layouts with
weights where all the children are layouts. It didn't have a very good
heuristic for finding out whether all children are layouts; it just
looked for whether the tag name contains "Layout".
This changeset generalizes this a bit, adding other layouts, as well
as <fragment> tags to the lint check.
It also updates the Master/Detail template to set the baseline
alignment attribute to false (to avoid triggering the updated lint
check), as well as android:textIsSelectable to clear another recent
new lint rule.
Change-Id: I887962b5e29a9ad0c5b5c01970b0c66f884125d8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If you include a library in your class path which was not built as an
Android project it's possible for it to include references to classes
in the java.* and javax.* namespace which are not valid in Android.
This changeset adds a new lint detector for this. It augments the API
database used by the API Checker to record the set of platform
packages, and to be able to quickly query whether an internal class
reference is in one of the valid packages.
The new lint check runs only on libraries (since tools will typically
set up the right classpath to give immediate errors if you try to
access invalid packages from your own code).
This was requested in issue 39109.
Change-Id: Id1ce7982e683bae9a484e7b75d7e77a256ca4414
|
|
|
|
| |
Change-Id: Ie99e3e7b75f1ac8cf6447c70afc5901437e2d600
|
|
|
|
| |
Change-Id: I48ecfea6304abedb942161bf2fec1d9867ddf0c6
|