Skip to content

Commit

Permalink
Add lint baseline to address NewApi errors
Browse files Browse the repository at this point in the history
We are enabling a new lint check where the min sdk != compile sdk.
It has produced a lot of errors and adding the baseline file(s)
allows us to continue work without introducing more problems.

Bug: 150847901

Test: m lint-check
Change-Id: I827a5b21dd52448d4f68da6743a1a1632d99573d
  • Loading branch information
Pedro Loureiro authored and Anton Hansson committed Apr 12, 2021
1 parent 5ecf571 commit 1e296c1
Show file tree
Hide file tree
Showing 5 changed files with 1,260 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ android_library {
manifest: "AndroidManifest-common.xml",
sdk_version: "current",
min_sdk_version: "26",
lint: {
baseline_filename: "lint-baseline-res-lib.xml",
},
}

//
Expand All @@ -127,6 +130,9 @@ android_library {
sdk_version: "current",
min_sdk_version: "26",
manifest: "AndroidManifest-common.xml",
lint: {
baseline_filename: "lint-baseline-common-deps-lib.xml",
},
}

//
Expand Down Expand Up @@ -171,6 +177,9 @@ android_app {
additional_manifests: [
"AndroidManifest-common.xml",
],
lint: {
baseline_filename: "lint-baseline-launcher3.xml",
},
}

// Library with all the dependencies for building quickstep
Expand Down Expand Up @@ -236,5 +245,8 @@ android_library {
"AndroidManifest-common.xml",
],
min_sdk_version: "29",
lint: {
baseline_filename: "lint-baseline-go-res-lib.xml",
},
}

48 changes: 48 additions & 0 deletions lint-baseline-common-deps-lib.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0">

<issue
id="NewApi"
message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 26)"
errorLine1=" android:topLeftRadius=&quot;?android:attr/dialogCornerRadius&quot;"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="packages/apps/Launcher3/res/drawable/add_item_dialog_background.xml"
line="6"
column="9"/>
</issue>

<issue
id="NewApi"
message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 26)"
errorLine1=" android:topRightRadius=&quot;?android:attr/dialogCornerRadius&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="packages/apps/Launcher3/res/drawable/add_item_dialog_background.xml"
line="7"
column="9"/>
</issue>

<issue
id="NewApi"
message="`@android:style/Widget.DeviceDefault.Button.Colored` requires API level 28 (current min is 26)"
errorLine1=" &lt;style name=&quot;Widget.DeviceDefault.Button.Rounded.Colored&quot; parent=&quot;@android:style/Widget.DeviceDefault.Button.Colored&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="packages/apps/Launcher3/res/values/styles.xml"
line="287"
column="63"/>
</issue>

<issue
id="NewApi"
message="`@android:dimen/system_app_widget_background_radius` requires API level 31 (current min is 26)"
errorLine1=" &lt;corners android:radius=&quot;@android:dimen/system_app_widget_background_radius&quot; />"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="packages/apps/Launcher3/res/drawable/widget_resize_frame.xml"
line="20"
column="14"/>
</issue>

</issues>
Loading

0 comments on commit 1e296c1

Please sign in to comment.