summaryrefslogtreecommitdiff
path: root/android-lint/src
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2022-01-12 13:22:25 +0000
committerTor Norbye <tnorbye@google.com>2022-01-21 01:13:33 +0000
commitff8d544a96e2b3b90004011f6ef28daec153aeb0 (patch)
tree9d9aaa1bf096b8e49ce9dac8f530ccdfd95c7085 /android-lint/src
parent45129e7706f0f04cc733eca5013ad3197eceeecb (diff)
downloadidea-ff8d544a96e2b3b90004011f6ef28daec153aeb0.tar.gz
Add @ReturnThis, @OpenForTesting, @EmptySuper and @DeprecatedSinceApi
Register new lint checks as inspections. Test: Automatically generated inspections registration code; lint checks are tested in lint Fixes: 140249763 Fixes: 141539024 Fixes: 37116481 Change-Id: I0113569420c5c8f83c1de3e75cb0894d31427a80
Diffstat (limited to 'android-lint/src')
-rw-r--r--android-lint/src/META-INF/android-lint-plugin.xml1
-rw-r--r--android-lint/src/com/android/tools/idea/lint/inspections/AndroidLintDeprecatedSinceApiInspection.kt24
2 files changed, 25 insertions, 0 deletions
diff --git a/android-lint/src/META-INF/android-lint-plugin.xml b/android-lint/src/META-INF/android-lint-plugin.xml
index 31a3b9eb4d0..08f83342541 100644
--- a/android-lint/src/META-INF/android-lint-plugin.xml
+++ b/android-lint/src/META-INF/android-lint-plugin.xml
@@ -63,6 +63,7 @@
<globalInspection hasStaticDescription="true" shortName="AndroidLintDeletedProvider" displayName="Using Deleted Provider" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDeletedProviderInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDeprecated" displayName="Using deprecated resources" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDeprecatedInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDeprecatedProvider" displayName="Using BC Provider" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDeprecatedProviderInspection"/>
+ <globalInspection hasStaticDescription="true" shortName="AndroidLintDeprecatedSinceApi" displayName="Using a method deprecated in earlier SDK" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDeprecatedSinceApiInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDeviceAdmin" displayName="Malformed Device Admin" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDeviceAdminInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDevModeObsolete" displayName="Dev Mode Obsolete" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="WARNING" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDevModeObsoleteInspection"/>
<globalInspection hasStaticDescription="true" shortName="AndroidLintDiffUtilEquals" displayName="Suspicious DiffUtil Equality" bundle="messages.AndroidLintBundle" enabledByDefault="true" level="ERROR" implementationClass="com.android.tools.idea.lint.inspections.AndroidLintDiffUtilEqualsInspection"/>
diff --git a/android-lint/src/com/android/tools/idea/lint/inspections/AndroidLintDeprecatedSinceApiInspection.kt b/android-lint/src/com/android/tools/idea/lint/inspections/AndroidLintDeprecatedSinceApiInspection.kt
new file mode 100644
index 00000000000..af68a9ae304
--- /dev/null
+++ b/android-lint/src/com/android/tools/idea/lint/inspections/AndroidLintDeprecatedSinceApiInspection.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.tools.idea.lint.inspections
+
+import com.android.tools.idea.lint.common.AndroidLintInspectionBase
+import com.android.tools.lint.checks.DeprecatedSinceApiDetector
+import com.android.tools.idea.lint.AndroidLintBundle.Companion.message
+
+class AndroidLintDeprecatedSinceApiInspection : AndroidLintInspectionBase(
+ message("android.lint.inspections.deprecated.since.api"), DeprecatedSinceApiDetector.ISSUE
+) \ No newline at end of file