aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2012-03-01 16:44:25 -0800
committerTor Norbye <tnorbye@google.com>2012-03-01 16:44:25 -0800
commitc266409db79aaa35b057f6fe2c045da8e2d8c051 (patch)
tree75d59000e128dbbbc40e6fc4de3b35becbe6d7f3
parent33c16676b738dfa433c267578ce37a93710cef7a (diff)
downloadsdk-c266409db79aaa35b057f6fe2c045da8e2d8c051.zip
sdk-c266409db79aaa35b057f6fe2c045da8e2d8c051.tar.gz
sdk-c266409db79aaa35b057f6fe2c045da8e2d8c051.tar.bz2
Remove R.attr resources from UnusedResource detector (26174)
Change-Id: I46abcb93537b3d288234729dd01005c41394d227
-rw-r--r--lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java b/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java
index a5ae165..49fdab3 100644
--- a/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java
+++ b/lint/libs/lint_checks/src/com/android/tools/lint/checks/UnusedResourceDetector.java
@@ -178,11 +178,12 @@ public class UnusedResourceDetector extends ResourceXmlDetector implements Detec
mReferences = null;
mDeclarations = null;
- // Remove styles: they may be used
+ // Remove styles and attributes: they may be used, analysis isn't complete for these
List<String> styles = new ArrayList<String>();
for (String resource : unused) {
- // R.style.x, R.styleable.x
- if (resource.startsWith("R.style")) { //$NON-NLS-1$
+ // R.style.x, R.styleable.x, R.attr
+ if (resource.startsWith("R.style") //$NON-NLS-1$
+ || resource.startsWith("R.attr")) { //$NON-NLS-1$
styles.add(resource);
}
}