__ANDROID_API__ tracks min_sdk_version
Previously, for cc_* modules, __ANDROID_API__ tracked the sdk_version property. This however has caused a few number of problems: 1. It's confusing. __ANDROID_API__ has meant minSdkVersion. Therefore the sdk_version property should mean minSdkVersion (since the macro tracks the property). However, the introduction of the new min_sdk_version property (which is currently for APEX) made this very confusing. Also, this is not consistent with the java_* modules where sdk_version means compileSdkVersion. 2. This is preventing go/android-future-symbols. The plan is to make the APIs that are above the minSdkVersion available as weak symbols. Previously those APIs had to be accessed via dlsym because they are hidden behind the __ANDROID_API__ macro at build-time. To use make the APIs visible at build-time, the module authors had to __ANDROID_API__ beyond their minSdkVersion. This is against the definition of __ANDROID_API__. To solve above problems, __ANDROID_API__ now correctly tracks min_sdk_version. In addition, min_sdk_version now defaults to sdk_version. Therefore, most of the modules that don't set min_sdk_version aren't affected by this change. Bug: 163288375 Test: m Change-Id: I645e6bb1234c27ae0a69b7b87a59206cfd350744
Loading
Please register or sign in to comment