Commit graph

11 commits

Author SHA1 Message Date
Justin Yun
c0659f0107 libvendorsupport provides an API to replace vndk version
ro.vndk.version cannot be simply replaced with ro.board.api_level with
the vndk deprecation. Even with the latest system updates, devices may
still run on old vendor images that do not define ro.board.api_level,
but define ro.vndk.version.
To provide the replacement of ro.vndk.version, provide a platform API
AVendorSupport_getVendorApiLevel() to return the expected vendor
version.

Bug: 312311458
Bug: 312315580
Test: manual test for AVendorSupport_getVendorApiLevel()
Change-Id: Id7c04483956d95fd49414cebde41d7cc4d2fb1d1
2024-04-30 10:59:07 +09:00
Justin Yun
dcce9e044a Do not disable LLNDK symbols in header files
Compiler still requires the LLNDK symbols even if they are removed
when compiling. Still the unavailable symbols break the build in
linking if called with wrong api level.

Bug: 333973388
Bug: 320347314
Test: TH
Change-Id: I79cb921cf6f2789e97f11b88cddf7ca1325998a5
2024-04-12 13:12:57 +09:00
Justin Yun
0fb8da9a05 Avoid duplicated definition in llndk-versioning.h
Non-vendor modules may define llndk versioning macros manually. Avoid
redefining the macros if they are already defined outside of
llndk-versioning.h header.

Bug: 302113279
Test: m && m cts

Change-Id: Ibf984f2f2eed3594c824f2e97e17f2698e0515dd
2024-03-19 16:42:26 +09:00
Justin Yun
47f9182e49 Remove bionic dependency from llndk-versioning.h
llndk-versioning.h only defines macros for LLNDK versioning.
Remove unused bionic header.

Bug: 302113279
Test: lunch cf_x86_64-trunk_staging-userdebug && m && m cts
Change-Id: I8d3ebbd765a223a2241e1a0bc95c84d726bacb9d
2024-03-15 23:05:09 +09:00
Justin Yun
f8292344cd Define macros for LLNDK versioning
__INTRODUCED_IN_LLNDK(vendor_api_level) is for the LLNDK APIs
introduced in the vendor_api_level. It is ignored for non-vendor
modules.

API_LEVEL_AT_LEAST(sdk_api_level, vendor_api_level) is used as a
statement for 'if' to guard the API callers. For example:

if API_LEVEL_AT_LEAST(__ANDROID_API_V__, 202404) {
  new_api_for_V_and_202404();
} else {
  fallback_function();
}

Bug: 302113279
Test: build trunk-staging and next configurations
Change-Id: I60d40655b1f8afdfa5c69b2ac4be2205f8057bea
2024-03-11 20:24:07 +09:00
Hsin-Yi Chen
80dca7ba59 Annotate LLNDK functions in non-vendor libraries
The ABI tool analyzes the source code of LLNDK libraries. It compiles
the source with the flags for core variants where __INTRODUCED_IN_LLNDK
does not version the API. To expose the version information to the ABI
tool, __INTRODUCED_IN_LLNDK is defined as an "annotate" attribute in
core variants.

Test: make
Bug: 314010764
Change-Id: I798a397f0e7567ca54db5e4aff4235933ebd3943
2024-03-05 09:18:39 +00:00
Justin Yun
2768cf6ea2 Make libvendorsupport_llndk_headers available to APEXes
libvendorsupport_llndk_headers provide libvendorsupport_llndk_headers
macro that can be used in any libraries including APEXes.

Bug: 302113279
Test: TH
Change-Id: I8fc7879a378a3711ae7264c9a2d8b0955895147f
2024-02-27 18:46:58 +09:00
Justin Yun
f3e89b8db4 Define __INTRODUCED_IN_LLNDK
Symbols with __INTRODUCED_IN_LLNDK are available for LLNDK only if
the vendor api level set by the RELEASE_BOARD_API_LEVEL is equal to
or newer than the target vendor api level in __INTRODUCED_IN_LLNDK.

This works only for the vendor variants at the same time ignoring
__INTRODUCED_IN annotation for the vendor variants. On the other
hand, __INTRODUCED_IN_LLNDK will be ignored from non-vendor variants.

Bug: 302113279
Test: build
Change-Id: I5317a73dbc73095f8d5d95131ca4d9ed39df6be1
2024-02-27 07:48:43 +00:00
Justin Yun
8ce23dc44e Rename functions in libvendorsupport
Follow platform naming conventions for an LLNDK library.

Bug: 325093550
Test: atest libvendorsupport-tests
Change-Id: Id93f7e66a47ae9250191f9827a76ce819e8f6f88
2024-02-16 23:53:04 +09:00
Justin Yun
6bc1bfe160 Use libvendorsupport for vendor api level calculation
Remove temporary 'vendor_api_level_of' function from init and replace
the function with the same in libvendorsupport.

Bug: 312403948
Test: getprop ro.vendor.api_level
Change-Id: I095353e602397220571e131431e7cbd1b8511fa6
Merged-In: I095353e602397220571e131431e7cbd1b8511fa6
2024-01-10 14:06:43 +09:00
Justin Yun
a68aa85624 Provide a new LLNDK for the vendor api level handling
The library provides mapping functions between SDK versions and
vendor api levels.

Bug: 315056516
Test: atest libvendorsupport-tests
Change-Id: I4a4eae0456ebf756badcc80f09a2946f741843c5
2024-01-05 22:56:09 +09:00