Merge "Prefer the app-developer targetSdkVersion over "api level"." into main
diff --git a/linker/linker.cpp b/linker/linker.cpp
index 5b200eb..2393f13 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -798,7 +798,7 @@
for (auto it = start, end = soinfo_list.end(); it != end; ++it) {
soinfo* si = *it;
// Do not skip RTLD_LOCAL libraries in dlsym(RTLD_DEFAULT, ...)
- // if the library is opened by application with target api level < M.
+ // if the library is opened by an application with target sdk version < 23.
// See http://b/21565766
if ((si->get_rtld_flags() & RTLD_GLOBAL) == 0 && si->get_target_sdk_version() >= 23) {
continue;
@@ -1224,7 +1224,7 @@
const soinfo* needed_or_dlopened_by = task->get_needed_by();
const char* sopath = needed_or_dlopened_by == nullptr ? "(unknown)" :
needed_or_dlopened_by->get_realpath();
- // is_exempt_lib() always returns true for api levels < 24,
+ // is_exempt_lib() always returns true for targetSdkVersion < 24,
// so no need to check the return value of DL_ERROR_AFTER().
// We still call it rather than DL_WARN() to get the extra clarification.
DL_ERROR_AFTER(24, "library \"%s\" (\"%s\") needed or dlopened by \"%s\" "
@@ -3327,7 +3327,7 @@
if (soname_.empty() && this != solist_get_somain() && !relocating_linker &&
get_application_target_sdk_version() < 23) {
soname_ = basename(realpath_.c_str());
- // The `if` above means we don't get here for api levels >= 23,
+ // The `if` above means we don't get here for targetSdkVersion >= 23,
// so no need to check the return value of DL_ERROR_AFTER().
// We still call it rather than DL_WARN() to get the extra clarification.
DL_ERROR_AFTER(23, "\"%s\" has no DT_SONAME (will use %s instead)",
diff --git a/linker/linker_globals.cpp b/linker/linker_globals.cpp
index c3a3bcd..0d820b6 100644
--- a/linker/linker_globals.cpp
+++ b/linker/linker_globals.cpp
@@ -61,10 +61,12 @@
if (get_application_target_sdk_version() < target_sdk_version) {
android::base::StringAppendF(&result,
- " and will not work when the app moves to API level %d or later "
+ " and will not work when the app moves to "
+ "targetSdkVersion %d or later "
"(see https://android.googlesource.com/platform/bionic/+/main/"
"android-changes-for-ndk-developers.md); "
- "allowing for now because this app's target API level is still %d",
+ "allowing for now because this app's "
+ "targetSdkVersion is still %d",
target_sdk_version,
get_application_target_sdk_version());
DL_WARN("Warning: %s", result.c_str());
diff --git a/linker/linker_soinfo.cpp b/linker/linker_soinfo.cpp
index 176c133..b626313 100644
--- a/linker/linker_soinfo.cpp
+++ b/linker/linker_soinfo.cpp
@@ -811,7 +811,7 @@
// This function returns api-level at the time of
// dlopen/load. Note that libraries opened by system
-// will always have 'current' api level.
+// will always have 'current' target sdk version.
int soinfo::get_target_sdk_version() const {
if (!has_min_version(2)) {
return __ANDROID_API__;