From 53da9ac34c8093096f7e2c87e63618ca3f19dac3 Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 1 Feb 2024 16:57:31 -0800 Subject: [PATCH] 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 --- service/lint-baseline.xml | 11 +++++++++++ staticlibs/Android.bp | 2 +- staticlibs/lint-baseline.xml | 15 +++++++++++++++ staticlibs/tests/unit/Android.bp | 4 ---- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 staticlibs/lint-baseline.xml diff --git a/service/lint-baseline.xml b/service/lint-baseline.xml index b09589c9d0..3e11d5237b 100644 --- a/service/lint-baseline.xml +++ b/service/lint-baseline.xml @@ -1,6 +1,17 @@ + + + + + + + + + + + diff --git a/staticlibs/tests/unit/Android.bp b/staticlibs/tests/unit/Android.bp index d203bc0a0b..4c226cccdc 100644 --- a/staticlibs/tests/unit/Android.bp +++ b/staticlibs/tests/unit/Android.bp @@ -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, - }, }