summaryrefslogtreecommitdiff
path: root/scripts/lint_project_xml.py
diff options
context:
space:
mode:
author Jiyong Park <jiyong@google.com> 2020-08-11 09:35:08 +0900
committer Jiyong Park <jiyong@google.com> 2021-01-15 09:43:35 +0900
commit423e37873b2fbec728ac615985ac2b7edbff482c (patch)
treebc8b4aca043c76ddb65c64d67a31608deb2aa1e6 /scripts/lint_project_xml.py
parentb35a8198341a3f83df98562b1a7e9bcc318acbba (diff)
API availability should be checked using __builtin_available
This change turns -Wunguarded-availability option which enforces calls to APIs which are introduced after the min_sdk_version of the compliation unit to be guarded with __builtin_available check. For example, let's assume that we have foo() which was introduced with API level 30. void foo() __INTRODUCED_IN(30); Then if foo() is called for a module whose min_sdk_version is less than 30, say 26, it should be called as below: if (__builtin_available(android 30, *)) { foo(); } else { // fallback impl } For modules whose min_sdk_version is >=30, the guard is not required. Bug: 150860940 Bug: 134795810 Test: m Change-Id: I084148b9a051350626a37cb394daa4398b7332d5
Diffstat (limited to 'scripts/lint_project_xml.py')
0 files changed, 0 insertions, 0 deletions