Remove class verification failure test files
The check no longer exists.
Test: ./gradlew lint-checks:test
Bug: 384483486
Change-Id: Iee0ceb7dbda59161533f5a3418eaa53899cbe1ef
diff --git a/lint-checks/integration-tests/lint-baseline.xml b/lint-checks/integration-tests/lint-baseline.xml
index 35eb074c..b1db38c 100644
--- a/lint-checks/integration-tests/lint-baseline.xml
+++ b/lint-checks/integration-tests/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.8.0-alpha06" type="baseline" client="gradle" dependencies="false" name="AGP (8.8.0-alpha06)" variant="all" version="8.8.0-alpha06">
+<issues format="6" by="lint 8.9.0-alpha01" type="baseline" client="gradle" dependencies="false" name="AGP (8.9.0-alpha01)" variant="all" version="8.9.0-alpha01">
<issue
id="MissingClass"
@@ -11,15 +11,6 @@
</issue>
<issue
- id="NewApi"
- message="Call requires API level 23 (current min is 21): `android.view.View#getAccessibilityClassName`"
- errorLine1=" return view.getAccessibilityClassName();"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/ClassVerificationFailureFromJava.java"/>
- </issue>
-
- <issue
id="BanKeepAnnotation"
message="Uses @Keep annotation"
errorLine1="@Keep"
@@ -146,6 +137,60 @@
</issue>
<issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" static boolean recreate(@NonNull final Activity activity) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/sample/core/app/ActivityRecreator.java"/>
+ </issue>
+
+ <issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" LifecycleCheckCallbacks(@NonNull Activity aboutToRecreate) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/sample/core/app/ActivityRecreator.java"/>
+ </issue>
+
+ <issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" static boolean recreate(@NonNull final Activity activity) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/sample/core/app/ActivityRecreatorChecked.java"/>
+ </issue>
+
+ <issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" LifecycleCheckCallbacks(@NonNull Activity aboutToRecreate) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/sample/core/app/ActivityRecreatorChecked.java"/>
+ </issue>
+
+ <issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" protected ParcelableUsageJava(@NonNull Parcel in) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/ParcelableUsageJava.java"/>
+ </issue>
+
+ <issue
+ id="JSpecifyNullness"
+ message="Switch nullness annotation to JSpecify"
+ errorLine1=" public void writeToParcel(@NonNull Parcel dest, int flags) {"
+ errorLine2=" ~~~~~~~~">
+ <location
+ file="src/main/java/androidx/ParcelableUsageJava.java"/>
+ </issue>
+
+ <issue
id="LongLogTag"
message="The logging tag can be at most 23 characters, was 24 (ActivityRecreatorChecked)"
errorLine1=" Log.e(LOG_TAG, "Exception while invoking performStopActivity", t);"
@@ -370,409 +415,4 @@
file="src/main/java/androidx/RestrictToTestsAnnotationUsageKotlin.kt"/>
</issue>
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" @RequiresApi(21)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sample/appcompat/widget/ActionBarBackgroundDrawable.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallToThis.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallToThis.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallToThis.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19"
- errorLine1=" @RequiresApi(19)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 21) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeReferenceWithExistingClassJava.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" @RequiresApi(21)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" @RequiresApi(21)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" @RequiresApi(21)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 17) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeStaticMethodReferenceJava.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 21) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeVoidMethodReferenceJava.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 17) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/ClassVerificationFailureFromJava.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 19) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sample/core/widget/ListViewCompat.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 19) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sample/core/widget/ListViewCompat.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" if (Build.VERSION.SDK_INT >= 19) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sample/core/widget/ListViewCompatKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 21"
- errorLine1=" return if (Build.VERSION.SDK_INT >= 19) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/sample/core/widget/ListViewCompatKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19"
- errorLine1="@RequiresApi(19)"
- errorLine2="~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiJava.java"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19"
- errorLine1="@RequiresApi(19)"
- errorLine2="~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19"
- errorLine1=" @RequiresApi(19)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19"
- errorLine1="@RequiresApi(19)"
- errorLine2="~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 19 from outer annotation (`@RequiresApi(19)`)"
- errorLine1=" @RequiresApi(16)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 16"
- errorLine1="@RequiresApi(16)"
- errorLine2="~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 16"
- errorLine1=" @RequiresApi(16)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 16"
- errorLine1="@RequiresApi(16)"
- errorLine2="~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="ObsoleteSdkInt"
- message="Unnecessary; `SDK_INT` is always >= 16"
- errorLine1=" @RequiresApi(16)"
- errorLine2=" ~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/RequiresApiKotlin.kt"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void callVarArgsMethodNoArgs(BaseAdapter adapter) {"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void callVarArgsMethodOneArg(BaseAdapter adapter, CharBuffer vararg) {"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void callVarArgsMethodOneArg(BaseAdapter adapter, CharBuffer vararg) {"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void callVarArgsMethodManyArgs(BaseAdapter adapter, CharBuffer vararg1,"
- errorLine2=" ~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void callVarArgsMethodManyArgs(BaseAdapter adapter, CharBuffer vararg1,"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" CharBuffer vararg2, CharBuffer vararg3) {"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" CharBuffer vararg2, CharBuffer vararg3) {"
- errorLine2=" ~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void unsafeReferenceOnCastObject(Object secretDisplayCutout) {"
- errorLine2=" ~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallOnCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void castReceiver(Notification.MessagingStyle style, Notification.Builder builder) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void castReceiver(Notification.MessagingStyle style, Notification.Builder builder) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void castParameter(Notification.Builder builder, Notification.CarExtender extender) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public void castParameter(Notification.Builder builder, Notification.CarExtender extender) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public Drawable createAdaptiveIconDrawableReturnDrawable() {"
- errorLine2=" ~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public AdaptiveIconDrawable createAndReturnAdaptiveIconDrawable() {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public Object methodReturnsIconAsObject() {"
- errorLine2=" ~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public Icon methodReturnsIconAsIcon() {"
- errorLine2=" ~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public Notification.DecoratedCustomViewStyle callQualifiedConstructor() {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeConstructorQualifiedClass.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" public PrintAttributes.Builder unsafeReferenceWithQualifiedClasses("
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" PrintAttributes.Builder builder,"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java"/>
- </issue>
-
- <issue
- id="UnknownNullness"
- message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://developer.android.com/kotlin/interop#nullability_annotations"
- errorLine1=" PrintAttributes.MediaSize mediaSize"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
- <location
- file="src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java"/>
- </issue>
-
</issues>
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java
deleted file mode 100644
index 2128027..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixOnUnsafeCallWithImplicitVarArgsCast.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2023 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 androidx;
-
-import android.widget.BaseAdapter;
-
-import androidx.annotation.RequiresApi;
-
-import java.nio.CharBuffer;
-
-/**
- * Contains unsafe calls to a method with a variable number of arguments which are implicitly cast.
- */
-@SuppressWarnings("unused")
-public class AutofixOnUnsafeCallWithImplicitVarArgsCast {
- /**
- * Calls the vararg method with no args.
- */
- @RequiresApi(27)
- public void callVarArgsMethodNoArgs(BaseAdapter adapter) {
- adapter.setAutofillOptions();
- }
-
- /**
- *Calls the vararg method with one args.
- */
- @RequiresApi(27)
- public void callVarArgsMethodOneArg(BaseAdapter adapter, CharBuffer vararg) {
- adapter.setAutofillOptions(vararg);
- }
-
- /**
- * Calls the vararg method with multiple args.
- */
- @RequiresApi(27)
- public void callVarArgsMethodManyArgs(BaseAdapter adapter, CharBuffer vararg1,
- CharBuffer vararg2, CharBuffer vararg3) {
- adapter.setAutofillOptions(vararg1, vararg2, vararg3);
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallOnCast.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallOnCast.java
deleted file mode 100644
index c3d7f33..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallOnCast.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.os.Build;
-import android.view.DisplayCutout;
-
-/**
- * Test class containing unsafe reference on cast object.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeCallOnCast {
- /**
- * Method making unsafe reference on cast object.
- */
- public void unsafeReferenceOnCastObject(Object secretDisplayCutout) {
- if (Build.VERSION.SDK_INT >= 28) {
- ((DisplayCutout) secretDisplayCutout).getSafeInsetTop();
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallToThis.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallToThis.java
deleted file mode 100644
index 6697751..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallToThis.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.os.Build;
-import android.view.ViewGroup;
-
-/**
- * Test class containing unsafe references to a parent's instance method.
- */
-@SuppressWarnings("unused")
-public abstract class AutofixUnsafeCallToThis extends ViewGroup {
- /*
- * Constructor to prevent complication error.
- */
- public AutofixUnsafeCallToThis() {
- super(null);
- }
-
- /**
- * Method making the unsafe reference on an implicit this.
- */
- public void unsafeReferenceOnImplicitThis() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- getClipToPadding();
- }
- }
-
- /**
- * Method making the unsafe reference on an explicit this.
- */
- public void unsafeReferenceOnExplicitThis() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- this.getClipToPadding();
- }
- }
-
- /**
- * Method making the unsafe reference on an explicit super.
- */
- public void unsafeReferenceOnExplicitSuper() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- super.getClipToPadding();
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java
deleted file mode 100644
index cc20718..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitParamCast.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2023 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 androidx;
-
-import android.app.Notification;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Tests to ensure the generated lint fix does not leave in implicit casts from a new argument type.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeCallWithImplicitParamCast {
- /**
- * This uses the Notification.MessagingStyle type, but setBuilder is defined on
- * Notification.Style, and the two classes were introduced in different API levels.
- */
- @RequiresApi(24)
- public void castReceiver(Notification.MessagingStyle style, Notification.Builder builder) {
- style.setBuilder(builder);
- }
-
- /**
- * This uses Notification.CarExtender, but extend is defined with Notification.Extender as a
- * parameter, and the two classes were introduced at different API levels.
- */
- @RequiresApi(23)
- public void castParameter(Notification.Builder builder, Notification.CarExtender extender) {
- builder.extend(extender);
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java
deleted file mode 100644
index 0eed5cb..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeCallWithImplicitReturnCast.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.app.Notification;
-import android.graphics.drawable.AdaptiveIconDrawable;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.Icon;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Tests to ensure the generated lint fix does not leave in implicit casts from a new return type.
- */
-@SuppressWarnings("unused")
-public abstract class AutofixUnsafeCallWithImplicitReturnCast {
- /**
- * This method creates an AdaptiveIconDrawable and implicitly casts it to Drawable.
- */
- @RequiresApi(26)
- public Drawable createAdaptiveIconDrawableReturnDrawable() {
- return new AdaptiveIconDrawable(null, null);
- }
-
- /**
- * This method also creates an AdaptiveIconDrawable but does not cast it to Drawable.
- */
- @RequiresApi(26)
- public AdaptiveIconDrawable createAndReturnAdaptiveIconDrawable() {
- return new AdaptiveIconDrawable(null, null);
- }
-
- /**
- * This calls a method returning an Icon and implicitly casts it to Object.
- */
- @RequiresApi(26)
- public Object methodReturnsIconAsObject() {
- return Icon.createWithAdaptiveBitmap(null);
- }
-
- /**
- * This calls a method returning an Icon and returns it as an Icon.
- */
- @RequiresApi(26)
- public Icon methodReturnsIconAsIcon() {
- return Icon.createWithAdaptiveBitmap(null);
- }
-
- /**
- * This uses the constructed value as Notification.Style in a method call.
- */
- @RequiresApi(24)
- public void methodUsesStyleAsParam() {
- useStyle(new Notification.DecoratedCustomViewStyle());
- }
-
- /**
- * This is here so there's a method to use the DecoratedCustomViewStyle as a Style.
- */
- static boolean useStyle(Notification.Style style) {
- return false;
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorQualifiedClass.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorQualifiedClass.java
deleted file mode 100644
index fbf96f9..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorQualifiedClass.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.app.Notification;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Class containing an unsafe constructor reference that uses a qualified type.
- */
-public class AutofixUnsafeConstructorQualifiedClass {
- /**
- * In the generated fix, the constructor call should not be `new DecoratedCustomViewStyle()`.
- */
- @RequiresApi(24)
- public Notification.DecoratedCustomViewStyle callQualifiedConstructor() {
- return new Notification.DecoratedCustomViewStyle();
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorReferenceJava.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorReferenceJava.java
deleted file mode 100644
index 6aac186..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeConstructorReferenceJava.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.content.Context;
-import android.os.Build;
-import android.view.View;
-import android.view.accessibility.AccessibilityNodeInfo;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeConstructorReferenceJava {
-
- /**
- * Unsafe reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- void unsafeReferenceWithSdkCheck(Context context) {
- if (Build.VERSION.SDK_INT >= 30) {
- AccessibilityNodeInfo node = new AccessibilityNodeInfo(new View(context), 1);
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeGenericMethodReferenceJava.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeGenericMethodReferenceJava.java
deleted file mode 100644
index 5628007..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeGenericMethodReferenceJava.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.content.Context;
-import android.os.Build;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeGenericMethodReferenceJava {
-
- /**
- * Unsafe reference to a generically-typed method with an SDK_INT check that satisfies the
- * NewApi lint.
- */
- <T> T getSystemService(Context context, Class<T> serviceClass) {
- if (Build.VERSION.SDK_INT >= 23) {
- return context.getSystemService(serviceClass);
- }
- return null;
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java
deleted file mode 100644
index 134b28f..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeMethodWithQualifiedClass.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.print.PrintAttributes;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Test class containing unsafe method reference that uses qualified class names.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeMethodWithQualifiedClass {
- /**
- * This method call:
- * - has a receiver of type PrintAttributes.Builder
- * - takes param of type PrintAttributes.MediaSize
- * - has return type PrintAttributes.Builder
- * In the generated fix, all three types should appear as qualified class names.
- */
- @RequiresApi(19)
- public PrintAttributes.Builder unsafeReferenceWithQualifiedClasses(
- PrintAttributes.Builder builder,
- PrintAttributes.MediaSize mediaSize
- ) {
- return builder.setMediaSize(mediaSize);
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingClassJava.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingClassJava.java
deleted file mode 100644
index eca9596..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingClassJava.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.content.res.ColorStateList;
-import android.os.Build;
-import android.view.View;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeReferenceWithExistingClassJava {
-
- /**
- * Unsafe reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- void unsafeReferenceWithSdkCheck(View view) {
- if (Build.VERSION.SDK_INT >= 21) {
- view.setBackgroundTintList(new ColorStateList(null, null));
- }
- }
-
- @RequiresApi(23)
- static class Api23Impl {
- private Api23Impl() {
- // This class is not instantiable.
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java
deleted file mode 100644
index efa821b..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeReferenceWithExistingFix.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 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 androidx;
-
-import android.content.res.ColorStateList;
-import android.graphics.drawable.Drawable;
-import android.view.View;
-
-import androidx.annotation.DoNotInline;
-import androidx.annotation.RequiresApi;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeReferenceWithExistingFix {
-
- /**
- * Unsafe reference to a new API with an already existing fix method in Api21Impl.
- */
- @RequiresApi(21)
- void unsafeReferenceFixMethodExists(View view) {
- view.setBackgroundTintList(new ColorStateList(null, null));
- }
-
- /**
- * Unsafe reference to a new API without an existing fix method, but requiring API 21.
- */
- @RequiresApi(21)
- void unsafeReferenceFixClassExists(Drawable drawable) {
- drawable.getOutline(null);
- }
-
- @RequiresApi(21)
- static class Api21Impl {
- private Api21Impl() {
- // This class is not instantiable.
- }
-
- @DoNotInline
- static void setBackgroundTintList(View view, ColorStateList tint) {
- view.setBackgroundTintList(tint);
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeStaticMethodReferenceJava.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeStaticMethodReferenceJava.java
deleted file mode 100644
index 4aec0ab..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeStaticMethodReferenceJava.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.os.Build;
-import android.view.View;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeStaticMethodReferenceJava {
-
- /**
- * Unsafe reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- int unsafeReferenceWithSdkCheck() {
- if (Build.VERSION.SDK_INT >= 17) {
- return View.generateViewId();
- }
- return -1;
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeVoidMethodReferenceJava.java b/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeVoidMethodReferenceJava.java
deleted file mode 100644
index ec43f28..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/AutofixUnsafeVoidMethodReferenceJava.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.content.res.ColorStateList;
-import android.os.Build;
-import android.view.View;
-
-/**
- * Test class containing unsafe method references.
- */
-@SuppressWarnings("unused")
-public class AutofixUnsafeVoidMethodReferenceJava {
-
- /**
- * Unsafe reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- void unsafeReferenceWithSdkCheck(View view) {
- if (Build.VERSION.SDK_INT >= 21) {
- view.setBackgroundTintList(new ColorStateList(null, null));
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/ClassVerificationFailureFromJava.java b/lint-checks/integration-tests/src/main/java/androidx/ClassVerificationFailureFromJava.java
deleted file mode 100644
index 9aaa657..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/ClassVerificationFailureFromJava.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import android.content.res.ColorStateList;
-import android.os.Build;
-import android.view.View;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Test class containing class verification failure scenarios.
- */
-@SuppressWarnings("unused")
-public class ClassVerificationFailureFromJava {
-
- /**
- * Unsafe reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- void unsafeReferenceWithSdkCheck(View view) {
- if (Build.VERSION.SDK_INT > 23) {
- ColorStateList tint = new ColorStateList(null, null);
- view.setBackgroundTintList(tint);
- }
- }
-
- /**
- * Unsafe static reference to a new API with an SDK_INT check that satisfies the NewApi lint.
- */
- int unsafeStaticReferenceWithSdkCheck() {
- if (Build.VERSION.SDK_INT >= 17) {
- return View.generateViewId();
- } else {
- return -1;
- }
- }
-
- /**
- * Unsafe reference to a new API whose auto-fix collides with the existing Api28Impl class.
- */
- CharSequence unsafeReferenceWithAutoFixCollision(View view) {
- return view.getAccessibilityClassName();
- }
-
- /**
- * Safe reference to a new API on a static inner class.
- */
- CharSequence safeGetAccessibilityPaneTitle(View view) {
- if (Build.VERSION.SDK_INT >= 28) {
- return Api28Impl.getAccessibilityPaneTitle(view);
- } else {
- return null;
- }
- }
-
- @RequiresApi(28)
- static class Api28Impl {
-
- private Api28Impl() {
- // Not instantiable.
- }
-
- public static CharSequence getAccessibilityPaneTitle(View view) {
- return view.getAccessibilityPaneTitle();
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/RequiresApiJava.java b/lint-checks/integration-tests/src/main/java/androidx/RequiresApiJava.java
deleted file mode 100644
index f90b49b..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/RequiresApiJava.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2021 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 androidx;
-
-import androidx.annotation.RequiresApi;
-
-/**
- * Character.isSurrogate requires API 19. Prior to addressing b/202415535, lint did not detect the
- * presence of @RequiresApi annotation in an outer class, and incorrectly flagged MyStaticClass
- * as needing a @RequiresApi annotation.
- */
-@RequiresApi(19)
-final class RequiresApiJava {
-
- // RequiresApi annotation should not be needed here; already present in containing class
- // @RequiresApi(19)
- public static final class MyStaticClass {
-
- private MyStaticClass() {
- // Not instantiable.
- }
-
- static int myStaticMethod(char c) {
- Character.isSurrogate(c);
- return 0;
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/RequiresApiKotlin.kt b/lint-checks/integration-tests/src/main/java/androidx/RequiresApiKotlin.kt
deleted file mode 100644
index a8cf4d0..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/RequiresApiKotlin.kt
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2021 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 androidx
-
-import androidx.annotation.RequiresApi
-
-/*
- * Character.isSurrogate requires API 19. Prior to addressing b/202415535, the
- * ClassVerificationFailure detector only checked for the @RequiresApi annotation on a method's
- * immediate containing class, and did not factor in @RequiresApi annotations on outer class(es).
- *
- * This sample file covers various cases of nested @RequiresApi usage.
- */
-
-// RequiresApi annotation not needed on MyStaticClass since it's already present in containing class
-@RequiresApi(19)
-internal class RequiresApiKotlinOuter19Passes {
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-// @RequiresApi declaration on MyStaticMethod's immediate containing class
-internal class RequiresApiKotlinInner19Passes {
- @RequiresApi(19)
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-// Even though MyStaticClass declares a @RequiresApi that is too low, the outer containing class's
-// definition of 19 will override it.
-@RequiresApi(19)
-internal class RequiresApiKotlinInner16Outer19Passes {
- @RequiresApi(16)
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-internal class RequiresApiKotlinNoAnnotationFails {
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-@RequiresApi(16)
-internal class RequiresApiKotlinOuter16Fails {
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-internal class RequiresApiKotlinInner16Fails {
- @RequiresApi(16)
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
-
-@RequiresApi(16)
-internal class RequiresApiKotlinInner16Outer16Fails {
- @RequiresApi(16)
- object MyStaticClass {
- fun MyStaticMethod(c: Char): Int {
- Character.isSurrogate(c)
- return 0
- }
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/sample/appcompat/widget/ActionBarBackgroundDrawable.java b/lint-checks/integration-tests/src/main/java/androidx/sample/appcompat/widget/ActionBarBackgroundDrawable.java
deleted file mode 100644
index 6fe87e2..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/sample/appcompat/widget/ActionBarBackgroundDrawable.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2015 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 androidx.sample.appcompat.widget;
-
-import android.graphics.Canvas;
-import android.graphics.ColorFilter;
-import android.graphics.Outline;
-import android.graphics.PixelFormat;
-import android.graphics.drawable.Drawable;
-
-import androidx.annotation.NonNull;
-import androidx.annotation.RequiresApi;
-
-@SuppressWarnings({"unused", "deprecation"})
-class ActionBarBackgroundDrawable extends Drawable {
-
- final ActionBarContainerStub mContainer;
-
- ActionBarBackgroundDrawable(ActionBarContainerStub container) {
- mContainer = container;
- }
-
- @Override
- public void draw(@NonNull Canvas canvas) {
- if (mContainer.mIsSplit) {
- if (mContainer.mSplitBackground != null) {
- mContainer.mSplitBackground.draw(canvas);
- }
- } else {
- if (mContainer.mBackground != null) {
- mContainer.mBackground.draw(canvas);
- }
- if (mContainer.mStackedBackground != null && mContainer.mIsStacked) {
- mContainer.mStackedBackground.draw(canvas);
- }
- }
- }
-
- @Override
- public void setAlpha(int alpha) {
- }
-
- @Override
- public void setColorFilter(ColorFilter cf) {
- }
-
- @Override
- public int getOpacity() {
- return PixelFormat.UNKNOWN;
- }
-
- @Override
- @RequiresApi(21)
- public void getOutline(@NonNull Outline outline) {
- if (mContainer.mIsSplit) {
- if (mContainer.mSplitBackground != null) {
- mContainer.mSplitBackground.getOutline(outline);
- }
- } else {
- // ignore the stacked background for shadow casting
- if (mContainer.mBackground != null) {
- mContainer.mBackground.getOutline(outline);
- }
- }
- }
-
- // Stub implementation to avoid appcompat dependency.
- static class ActionBarContainerStub {
- Drawable mBackground;
- Drawable mSplitBackground;
- Drawable mStackedBackground;
-
- boolean mIsSplit;
- boolean mIsStacked;
- }
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompat.java b/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompat.java
deleted file mode 100644
index 216ef20..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompat.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2021 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 androidx.sample.core.widget;
-
-import android.os.Build;
-import android.view.View;
-import android.widget.ListView;
-
-import androidx.annotation.NonNull;
-
-/**
- * Helper for accessing features in {@link ListView}
- */
-public class ListViewCompat {
-
- /**
- * Scrolls the list items within the view by a specified number of pixels.
- *
- * @param listView the list to scroll
- * @param y the amount of pixels to scroll by vertically
- */
- public static void scrollListBy(@NonNull ListView listView, int y) {
- if (Build.VERSION.SDK_INT >= 19) {
- // Call the framework version directly
- listView.scrollListBy(y);
- } else {
- // provide backport on earlier versions
- final int firstPosition = listView.getFirstVisiblePosition();
- if (firstPosition == ListView.INVALID_POSITION) {
- return;
- }
-
- final View firstView = listView.getChildAt(0);
- if (firstView == null) {
- return;
- }
-
- final int newTop = firstView.getTop() - y;
- listView.setSelectionFromTop(firstPosition, newTop);
- }
- }
-
- /**
- * Check if the items in the list can be scrolled in a certain direction.
- *
- * @param direction Negative to check scrolling up, positive to check
- * scrolling down.
- * @return true if the list can be scrolled in the specified direction,
- * false otherwise.
- * @see #scrollListBy(ListView, int)
- */
- public static boolean canScrollList(@NonNull ListView listView, int direction) {
- if (Build.VERSION.SDK_INT >= 19) {
- // Call the framework version directly
- return listView.canScrollList(direction);
- } else {
- // provide backport on earlier versions
- final int childCount = listView.getChildCount();
- if (childCount == 0) {
- return false;
- }
-
- final int firstPosition = listView.getFirstVisiblePosition();
- if (direction > 0) {
- final int lastBottom = listView.getChildAt(childCount - 1).getBottom();
- final int lastPosition = firstPosition + childCount;
- return lastPosition < listView.getCount()
- || (lastBottom > listView.getHeight() - listView.getListPaddingBottom());
- } else {
- final int firstTop = listView.getChildAt(0).getTop();
- return firstPosition > 0 || firstTop < listView.getListPaddingTop();
- }
- }
- }
-
- private ListViewCompat() {}
-}
diff --git a/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompatKotlin.kt b/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompatKotlin.kt
deleted file mode 100644
index d5e62a0..0000000
--- a/lint-checks/integration-tests/src/main/java/androidx/sample/core/widget/ListViewCompatKotlin.kt
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2021 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 androidx.sample.core.widget
-
-import android.os.Build
-import android.widget.ListView
-
-@Suppress("unused")
-object ListViewCompatKotlin {
- /**
- * Scrolls the list items within the view by a specified number of pixels.
- *
- * @param listView the list to scroll
- * @param y the amount of pixels to scroll by vertically
- */
- fun scrollListBy(listView: ListView, y: Int) {
- if (Build.VERSION.SDK_INT >= 19) {
- // Call the framework version directly
- listView.scrollListBy(y)
- } else {
- // provide backport on earlier versions
- val firstPosition = listView.firstVisiblePosition
- if (firstPosition == ListView.INVALID_POSITION) {
- return
- }
- val firstView = listView.getChildAt(0) ?: return
- val newTop = firstView.top - y
- listView.setSelectionFromTop(firstPosition, newTop)
- }
- }
-
- /**
- * Check if the items in the list can be scrolled in a certain direction.
- *
- * @param direction Negative to check scrolling up, positive to check scrolling down.
- * @return true if the list can be scrolled in the specified direction, false otherwise.
- * @see .scrollListBy
- */
- fun canScrollList(listView: ListView, direction: Int): Boolean {
- return if (Build.VERSION.SDK_INT >= 19) {
- // Call the framework version directly
- listView.canScrollList(direction)
- } else {
- // provide backport on earlier versions
- val childCount = listView.childCount
- if (childCount == 0) {
- return false
- }
- val firstPosition = listView.firstVisiblePosition
- if (direction > 0) {
- val lastBottom = listView.getChildAt(childCount - 1).bottom
- val lastPosition = firstPosition + childCount
- lastPosition < listView.count ||
- lastBottom > listView.height - listView.listPaddingBottom
- } else {
- val firstTop = listView.getChildAt(0).top
- firstPosition > 0 || firstTop < listView.listPaddingTop
- }
- }
- }
-}