Skip to content
Snippets Groups Projects
Commit 53da9ac3 authored by Cole Faust's avatar Cole Faust
Browse files

Prepare for @RequiresApi class retention

The android framework has android.annotation.RequiresApi, which is a
copy of androidx.annotation.RequiresApi. However it was added with
source retention instead of class retention like androidx's version
has. This causes it to be missed if you compiled a library and then
used that library to compile something else, that library's public
methods won't have @RequiresApi on them when using that library's
compiled jar file.

To make @RequiresApi have class retention, we need to baseline the
NewApi issues that it would cause. These baselines also require
us to disable strict_updatability_linting in some places.

Bug: 323366771
Test: m lint-check
Change-Id: I0c984e3ba39e357ce102be442568f2d77a4f9034
parent 1042c175
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01">
<issue
id="NewApi"
message="Call requires API level 33 (current min is 30): `getUidRule`"
errorLine1=" return BpfNetMapsReader.getUidRule(sUidOwnerMap, childChain, uid);"
errorLine2=" ~~~~~~~~~~">
<location
file="packages/modules/Connectivity/service/src/com/android/server/BpfNetMaps.java"
line="643"
column="33"/>
</issue>
<issue
id="NewApi"
message="Call requires API level 31 (current min is 30): `BpfBitmap`"
......
......@@ -248,7 +248,7 @@ java_library {
"//apex_available:platform",
],
lint: {
strict_updatability_linting: true,
baseline_filename: "lint-baseline.xml",
error_checks: ["NewApi"],
},
}
......
<?xml version="1.0" encoding="UTF-8"?>
<issues format="6" by="lint 8.4.0-alpha04" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha04">
<issue
id="NewApi"
message="Call requires API level 31 (current min is 30): `makeNetlinkSocketAddress`"
errorLine1=" Os.bind(fd, makeNetlinkSocketAddress(0, mBindGroups));"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="packages/modules/Connectivity/staticlibs/device/com/android/net/module/util/ip/NetlinkMonitor.java"
line="111"
column="25"/>
</issue>
</issues>
......@@ -38,7 +38,6 @@ android_library {
"//packages/modules/NetworkStack/tests/integration",
],
lint: {
strict_updatability_linting: true,
test: true,
},
}
......@@ -56,7 +55,4 @@ android_test {
],
jarjar_rules: "jarjar-rules.txt",
test_suites: ["device-tests"],
lint: {
strict_updatability_linting: true,
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment