From be30b3e96eb760bc0a04fff1a4e47e82487ac2f6 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 25 Jan 2024 02:41:58 +0000 Subject: [PATCH] Baseline NewApi issues NewApi is a lint check that you don't call framework methods that were introduced in versions later than your min_sdk_version. We want to make this an error, so we're baselineing all existing issues. This cl was generated automatically, by taking all the NewApi issues from the reference baselines, and all the non-NewApi issues from the existing checked in baselines. Bug: 268261262 Test: Presubmits (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810) Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03 Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03 --- Tethering/Android.bp | 9 +- Tethering/lint-baseline.xml | 4 +- framework/Android.bp | 12 - framework/lint-baseline.xml | 417 ++++++----- nearby/service/lint-baseline.xml | 4 +- service-t/Android.bp | 2 +- service-t/lint-baseline.xml | 345 +++++---- service/Android.bp | 15 +- service/lint-baseline.xml | 1199 +++++++++++++++++++----------- 9 files changed, 1217 insertions(+), 790 deletions(-) diff --git a/Tethering/Android.bp b/Tethering/Android.bp index 73c11baae1..c30e25103d 100644 --- a/Tethering/Android.bp +++ b/Tethering/Android.bp @@ -104,6 +104,7 @@ android_library { lint: { strict_updatability_linting: true, baseline_filename: "lint-baseline.xml", + }, } @@ -122,6 +123,7 @@ android_library { lint: { strict_updatability_linting: true, baseline_filename: "lint-baseline.xml", + }, } @@ -215,7 +217,7 @@ android_app { apex_available: ["com.android.tethering"], lint: { strict_updatability_linting: true, - baseline_filename: "lint-baseline.xml", + }, } @@ -235,7 +237,7 @@ android_app { lint: { strict_updatability_linting: true, error_checks: ["NewApi"], - baseline_filename: "lint-baseline.xml", + }, } @@ -263,9 +265,6 @@ java_library_static { static_libs: ["tetheringprotos"], apex_available: ["com.android.tethering"], min_sdk_version: "30", - lint: { - baseline_filename: "lint-baseline.xml", - }, } genrule { diff --git a/Tethering/lint-baseline.xml b/Tethering/lint-baseline.xml index 37511c682e..4f92c9c2d4 100644 --- a/Tethering/lint-baseline.xml +++ b/Tethering/lint-baseline.xml @@ -1,5 +1,5 @@ - + diff --git a/framework/Android.bp b/framework/Android.bp index 432cabf992..b7ff04fec1 100644 --- a/framework/Android.bp +++ b/framework/Android.bp @@ -139,9 +139,6 @@ java_library { "framework-wifi.stubs.module_lib", ], visibility: ["//packages/modules/Connectivity:__subpackages__"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } java_defaults { @@ -259,9 +256,6 @@ java_library { apex_available: [ "com.android.tethering", ], - lint: { - baseline_filename: "lint-baseline.xml", - }, } java_genrule { @@ -322,9 +316,6 @@ droidstubs { java_library { name: "framework-connectivity-module-api-stubs-including-flagged", srcs: [":framework-connectivity-module-api-stubs-including-flagged-droidstubs"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } // Library providing limited APIs within the connectivity module, so that R+ components like @@ -349,7 +340,4 @@ java_library { visibility: [ "//packages/modules/Connectivity/Tethering:__subpackages__", ], - lint: { - baseline_filename: "lint-baseline.xml", - }, } diff --git a/framework/lint-baseline.xml b/framework/lint-baseline.xml index f68aad734e..2c0b15fd32 100644 --- a/framework/lint-baseline.xml +++ b/framework/lint-baseline.xml @@ -1,5 +1,5 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + message="Call requires API level 31 (current min is 30): `libcore.net.http.HttpURLConnectionFactory#openConnection`" + errorLine1=" return urlConnectionFactory.openConnection(url, socketFactory, proxy);" + errorLine2=" ~~~~~~~~~~~~~~"> - - - - - - - - + file="packages/modules/Connectivity/framework/src/android/net/Network.java" + line="372" + column="37"/> + message="Class requires API level 31 (current min is 30): `android.telephony.data.EpsBearerQosSessionAttributes`" + errorLine1=" (EpsBearerQosSessionAttributes)attributes));" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> @@ -360,8 +316,63 @@ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~"> + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nearby/service/lint-baseline.xml b/nearby/service/lint-baseline.xml index a4761abb61..3477594c70 100644 --- a/nearby/service/lint-baseline.xml +++ b/nearby/service/lint-baseline.xml @@ -1,5 +1,5 @@ - + diff --git a/service-t/Android.bp b/service-t/Android.bp index de879f303e..78c7d35531 100644 --- a/service-t/Android.bp +++ b/service-t/Android.bp @@ -98,7 +98,7 @@ java_library { min_sdk_version: "21", lint: { error_checks: ["NewApi"], - baseline_filename: "lint-baseline.xml", + }, srcs: [ "src/com/android/server/connectivity/mdns/**/*.java", diff --git a/service-t/lint-baseline.xml b/service-t/lint-baseline.xml index 38d3ab0ce9..7f05b8c657 100644 --- a/service-t/lint-baseline.xml +++ b/service-t/lint-baseline.xml @@ -1,103 +1,15 @@ - + + message="Call requires API level 31 (current min is 30): `BpfMap`" + errorLine1=" return new BpfMap<>(IFACE_INDEX_NAME_MAP_PATH, BpfMap.BPF_F_RDWR," + errorLine2=" ~~~~~~~~~~~~"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + file="packages/modules/Connectivity/service-t/src/com/android/server/net/BpfInterfaceMapUpdater.java" + line="69" + column="24"/> + + + + - - - - - - - - - - - - + + + + + + + + + message="Call requires API level 31 (current min is 30): `java.net.InetAddress#parseNumericAddress`" + errorLine1=" staticIpConfigBuilder.setGateway(InetAddress.parseNumericAddress(value));" + errorLine2=" ~~~~~~~~~~~~~~~~~~~"> + file="packages/modules/Connectivity/service-t/src/com/android/server/ethernet/EthernetTracker.java" + line="885" + column="66"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/service/Android.bp b/service/Android.bp index 7c5da0ddaa..0d7e8d0a87 100644 --- a/service/Android.bp +++ b/service/Android.bp @@ -70,9 +70,6 @@ java_library { apex_available: [ "com.android.tethering", ], - lint: { - baseline_filename: "lint-baseline.xml", - }, } // The library name match the service-connectivity jarjar rules that put the JNI utils in the @@ -206,6 +203,7 @@ java_library { lint: { strict_updatability_linting: true, baseline_filename: "lint-baseline.xml", + }, visibility: [ "//packages/modules/Connectivity/service-t", @@ -231,7 +229,7 @@ java_library { ], lint: { strict_updatability_linting: true, - baseline_filename: "lint-baseline.xml", + }, } @@ -290,18 +288,12 @@ java_defaults { java_library { name: "service-connectivity-for-tests", defaults: ["service-connectivity-defaults"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } java_library { name: "service-connectivity", defaults: ["service-connectivity-defaults"], installable: true, - lint: { - baseline_filename: "lint-baseline.xml", - }, } java_library_static { @@ -316,9 +308,6 @@ java_library_static { ], static_libs: ["ConnectivityServiceprotos"], apex_available: ["com.android.tethering"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } genrule { diff --git a/service/lint-baseline.xml b/service/lint-baseline.xml index 5149e6d5d7..a091a2b01e 100644 --- a/service/lint-baseline.xml +++ b/service/lint-baseline.xml @@ -1,5 +1,137 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + message="Call requires API level 33 (current min is 30): `updateUidLockdownRule`" + errorLine1=" mBpfNetMaps.updateUidLockdownRule(uid, add);" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -503,8 +767,107 @@ errorLine2=" ~~~~~~~~~~~~~~~"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file